Skip to content

Commit a225939

Browse files
Merge pull request #8700 from magento-gl/functional-mainline-ce
[Bengals] Test Fixes and Regular Automation of tests
2 parents 39d54c2 + 6953c7d commit a225939

File tree

23 files changed

+608
-17
lines changed

23 files changed

+608
-17
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCategoryIndexerInUpdateOnScheduleModeTest.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
</annotations>
2323
<before>
2424
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
25+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="performReindex">
26+
<argument name="indices" value=""/>
27+
</actionGroup>
28+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="cleanCache">
29+
<argument name="tags" value=""/>
30+
</actionGroup>
2531
<!-- Create category A without products -->
2632
<createData entity="_defaultCategory" stepKey="createCategoryA"/>
2733

app/code/Magento/CatalogInventory/Test/Mftf/Test/StoreFrontAddOutOfStockProductToShoppingCartTest.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
</before>
4040
<!-- Delete the Data after execution-->
4141
<after>
42-
<deleteData createDataKey="createCategory" stepKey="deleteProduct"/>
43-
<deleteData createDataKey="simpleProductOne" stepKey="deleteCategory"/>
42+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
43+
<deleteData createDataKey="simpleProductOne" stepKey="deleteProduct"/>
4444
<magentoCLI command="config:set {{EnableInventoryCheckOnCartLoad.path}} {{EnableInventoryCheckOnCartLoad.value}}" stepKey="enableCartLoad"/>
4545
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
4646
</after>
@@ -62,8 +62,8 @@
6262
<!-- Mouse Hover Product On Category Page-->
6363
<actionGroup ref="StorefrontHoverProductOnCategoryPageActionGroup" stepKey="hoverProduct"/>
6464
<!-- Select Add to cart-->
65-
<waitForElementClickable selector="{{StorefrontCategoryMainSection.addToCartProductBySku($$simpleProductOne.sku$$)}}" stepKey="waitForAddToCartButton"/>
66-
<click selector="{{StorefrontCategoryMainSection.addToCartProductBySku($$simpleProductOne.sku$$)}}" stepKey="toCategory"/>
65+
<waitForElementClickable selector="{{StorefrontCategoryMainSection.AddToCartBtn}}" stepKey="waitForAddToCartButton"/>
66+
<click selector="{{StorefrontCategoryMainSection.AddToCartBtn}}" stepKey="toCategory"/>
6767
<waitForElementVisible selector="{{StorefrontProductPageSection.errorMsg}}" stepKey="wait"/>
6868
<!-- Assert the Error Message-->
6969
<see selector="{{StorefrontProductPageSection.errorMsg}}" userInput="Product that you are trying to add is not available." stepKey="seeErrorMessage"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontCheckForFlatRateShippingMethodAvailabilityActionGroup">
12+
<annotations>
13+
<description>Validates that the Shipping method is visible in the checkout page or not.</description>
14+
</annotations>
15+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFlatRateLabel}}" stepKey="waitForFlatRateLabelVisible"/>
16+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFlatRate}}" stepKey="waitForFlatRatePriceVisible"/>
17+
</actionGroup>
18+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontVerifyDHLShippingMethodIsVisibilityActionGroup">
12+
<annotations>
13+
<description>Validates that the DHL Shipping method is visible in the checkout page.</description>
14+
</annotations>
15+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlWorldWideExpressLabel}}" stepKey="waitForShippingDHLWorldWideExpressLabelVisible"/>
16+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlWorldWideExpress}}" stepKey="waitForShippingDHLPriceVisible"/>
17+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlExpressTwelveLabel}}" stepKey="waitForShippingDhlExpressTwelveLabelVisible"/>
18+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlExpressTwelve}}" stepKey="waitForShippingDhlExpressTwelveVisible"/>
19+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlMedicalExpressLabel}}" stepKey="waitForShippingDhlMedicalExpressLabelVisible"/>
20+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlMedicalExpress}}" stepKey="waitForShippingDhlMedicalExpressVisible"/>
21+
</actionGroup>
22+
</actionGroups>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingMethodsSection.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,15 @@
2626
<element name="showShippingVatNumber" type="text" selector="div.shipping-address-item"/>
2727
<element name="showBillingVatNumber" type="text" selector="div.billing-address-details"/>
2828
<element name="showShippingInfoVatNumber" type="text" selector="div.shipping-information-content"/>
29+
<element name="shippingMethodDhlLabel" type="text" selector="#label_carrier_null_dhl"/>
30+
<element name="shippingMethodFlatRateLabel" type="text" selector="#label_carrier_flatrate_flatrate"/>
31+
<element name="shippingMethodDhlWorldWideExpressLabel" type="text" selector="#label_method_P_dhl"/>
32+
<element name="shippingMethodDhlWorldWideExpress" type="radio" selector="#checkout-shipping-method-load input[value='dhl_P']"/>
33+
<element name="shippingMethodDhlExpressTwelveLabel" type="text" selector="#label_method_Y_dhl"/>
34+
<element name="shippingMethodDhlExpressTwelve" type="radio" selector="#checkout-shipping-method-load input[value='dhl_Y']"/>
35+
<element name="shippingMethodDhlMedicalExpressLabel" type="text" selector="#label_method_Q_dhl"/>
36+
<element name="shippingMethodDhlMedicalExpress" type="radio" selector="#checkout-shipping-method-load input[value='dhl_Q']"/>
37+
<element name="shippingMethodFreeShippingLabel" type="text" selector="#label_carrier_freeshipping_freeshipping"/>
38+
<element name="shippingDHLErrorMessage" type="text" selector="#checkout-shipping-method-load .table-checkout-shipping-method tr.row-error .error div"/>
2939
</section>
3040
</sections>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutSuccessMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
<element name="orderNumberWithoutLink" type="text" selector="//div[contains(@class, 'checkout-success')]//p/span"/>
2323
<element name="orderLinkByOrderNumber" type="text" selector="//div[contains(@class,'success')]//a[contains(.,'{{orderNumber}}')]" parameterized="true" timeout="30"/>
2424
<element name="purchaseOrderNumber" type="text" selector="div.checkout-success > p:nth-child(1) > a span"/>
25+
<element name="billingAgreement" type="text" selector="//div[contains(@class, 'checkout-success')]/p[contains(text(), 'Your billing agreement # is:')]"/>
2526
</section>
2627
</sections>

app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckZeroSubtotalOrderWithCustomStatusTest.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@
4949
<magentoCLI command="config:set {{EnableFreeOrderStatusPending.path}} {{EnableFreeOrderStatusPending.value}}" stepKey="disablePaymentMethodsSettingConfig"/>
5050
<magentoCLI command="config:set {{EnableFreeOrderPaymentAutomaticInvoiceAction.path}} {{EnableFreeOrderPaymentAutomaticInvoiceAction.value}}" stepKey="enableFreeOrderPaymentAutomaticInvoiceAction"/>
5151
<actionGroup ref="CliDisableFreeShippingMethodActionGroup" stepKey="disableFreeShippingConfig"/>
52+
<!-- Unassign order status -->
53+
<actionGroup ref="AdminGoToOrderStatusPageActionGroup" stepKey="goToOrderStatus"/>
54+
<actionGroup ref="FilterOrderStatusByLabelAndCodeActionGroup" stepKey="filterStatusGrid">
55+
<argument name="statusLabel" value="{{defaultOrderStatus.label}}"/>
56+
<argument name="statusCode" value="{{defaultOrderStatus.status}}"/>
57+
</actionGroup>
58+
<click selector="{{AdminOrderStatusGridSection.unassign}}" stepKey="unassignOrderStatus"/>
59+
<waitForPageLoad stepKey="waitForGridLoad"/>
60+
5261
<deleteData createDataKey="simplecategory" stepKey="deleteCategory"/>
5362
<deleteData createDataKey="simpleproduct" stepKey="deleteProduct"/>
5463
<deleteData createDataKey="createCartPriceRule" stepKey="deleteSalesRule"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="StoreFrontValidateDynamicChangeOfShippingRateForGuestUserTest">
11+
<annotations>
12+
<features value="Checkout"/>
13+
<stories value="Shipping rate in Guest Checkout"/>
14+
<title value="Available shipping rate is changed on fly according to inputed data"/>
15+
<description value="Should be able to change the shipping rate while changing the input data based on the specific country and zipcode."/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="AC-6139"/>
18+
<group value="pr_exclude"/>
19+
<group value="3rd_party_integration"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
23+
<!-- Creating subcategory -->
24+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
25+
<!-- Creating Simple Product -->
26+
<createData entity="_defaultProduct" stepKey="createSimpleProduct">
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
<!-- Go to Store > Configuration > Sales > Shipping Methods -->
30+
<actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodConfigPage"/>
31+
<!-- Free Shipping Configuration -->
32+
<magentoCLI command="config:set {{EnableFreeShippingConfigData.path}} {{EnableFreeShippingConfigData.value}}" stepKey="enableFreeShipping"/>
33+
<magentoCLI command="config:set {{EnableFreeShippingToSpecificCountriesConfigData.path}} {{EnableFreeShippingToSpecificCountriesConfigData.value}}" stepKey="selectSpecificCountries"/>
34+
<magentoCLI command="config:set {{EnableFreeShippingToAfghanistanConfigData.path}} {{EnableFreeShippingToAfghanistanConfigData.value}}" stepKey="selectCountry"/>
35+
<!-- DHL Shipping Configuration -->
36+
<actionGroup ref="AdminEnableDHLConfigurationActionGroup" stepKey="dhlConfig"/>
37+
<!--Set Shipping settings origin data-->
38+
<actionGroup ref="AdminSetShippingOriginConfigActionGroup" stepKey="setShippingOriginConfigurationData">
39+
<argument name="country" value="United States"/>
40+
<argument name="state" value="California"/>
41+
<argument name="postcode" value="90230"/>
42+
</actionGroup>
43+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCachePostChangingConfigurationSettings">
44+
<argument name="tags" value="config"/>
45+
</actionGroup>
46+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexPostChangingConfigurationSettings">
47+
<argument name="indices" value="cataloginventory_stock catalog_product_price"/>
48+
</actionGroup>
49+
</before>
50+
<!-- Go to storefront page to add product -->
51+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/>
52+
<waitForPageLoad stepKey="waitForProductPage"/>
53+
<!-- Add Simple product in the cart -->
54+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart">
55+
<argument name="product" value="$createSimpleProduct$"/>
56+
</actionGroup>
57+
<actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="goToShippingPage"/>
58+
<!-- Guest checkout -->
59+
<actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="goToShippingAndFillDetails">
60+
<argument name="customerAddress" value="US_CA_Address"/>
61+
</actionGroup>
62+
<selectOption selector="{{CheckoutShippingSection.region}}" userInput="California" stepKey="fillStateField"/>
63+
<waitForPageLoad stepKey="waitForChangeAfterStateLoad"/>
64+
<actionGroup ref="CheckForFlatRateShippingMethodAvailabilityActionGroup" stepKey="verifyShippingMethod"/>
65+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlLabel}}" stepKey="waitForDHLLabelVisible"/>
66+
<waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlWorldWideExpress}}" stepKey="waitForDHLPriceNotVisibleAfterStateChange"/>
67+
<waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="waitForFreeShippingNotVisible"/>
68+
<waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShippingLabel}}" stepKey="waitForFreeShippingLabelNotVisible"/>
69+
<!-- Change country value -->
70+
<selectOption selector="{{CheckoutShippingSection.country}}" userInput="Afghanistan" stepKey="fillCountryField"/>
71+
<waitForPageLoad stepKey="waitForChangeAfterCountryLoad"/>
72+
<actionGroup ref="CheckForFlatRateShippingMethodAvailabilityActionGroup" stepKey="verifyShippingMethodAfterCountryChange"/>
73+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="waitForFreeShippingVisibleAfterCountryChange"/>
74+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShippingLabel}}" stepKey="waitForFreeShippingLabelVisibleAfterCountryChange"/>
75+
<waitForElementVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlLabel}}" stepKey="waitForDHLLabelVisibleAfterCountryChange"/>
76+
<waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodDhlWorldWideExpress}}" stepKey="waitForDHLPriceNotVisibleAfterCountryChange"/>
77+
<waitForText selector="{{CheckoutShippingMethodsSection.shippingDHLErrorMessage}}" userInput="This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us." stepKey="seeDhlErrorMessage"/>
78+
<!-- Fill New Data for checkout page -->
79+
<selectOption selector="{{CheckoutShippingSection.country}}" userInput="United Kingdom" stepKey="fillCountry"/>
80+
<fillField selector="{{CheckoutShippingSection.city}}" userInput="London" stepKey="fillCity"/>
81+
<fillField selector="{{CheckoutShippingSection.postcode}}" userInput="N14 5JP" stepKey="fillPostcode"/>
82+
<actionGroup ref="CheckForFlatRateShippingMethodAvailabilityActionGroup" stepKey="verifyShippingMethodAfterNewData"/>
83+
<waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="waitForFreeShippingVisibleAfterNewFormData"/>
84+
<waitForElementNotVisible selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShippingLabel}}" stepKey="waitForFreeShippingLabelVisibleAfterNewFormData"/>
85+
<actionGroup ref="VerifyDHLShippingMethodIsVisibilityActionGroup" stepKey="dhlShippingVisibility"/>
86+
<after>
87+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
88+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
89+
<!-- Reset shipping origin -->
90+
<actionGroup ref="AdminResetShippingOriginConfigurationActionGroup" stepKey="ResetCaliforniaShippingOrigin"/>
91+
<actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="shippingMethodConfigPage"/>
92+
<!-- Reset free shipping origin -->
93+
<magentoCLI command="config:set {{DisableFreeShippingConfigData.path}} {{DisableFreeShippingConfigData.value}}" stepKey="disableFreeShipping"/>
94+
<magentoCLI command="config:set {{EnableFreeShippingToAllAllowedCountriesConfigData.path}} {{EnableFreeShippingToAllAllowedCountriesConfigData.value}}" stepKey="selectAllCountries"/>
95+
<!-- Reset dhl configuration origin -->
96+
<actionGroup ref="AdminDisableDHLConfigurationActionGroup" stepKey="resetDhlConfig"/>
97+
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="resetSaveConfigurationForDHL"/>
98+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
99+
</after>
100+
</test>
101+
</tests>

app/code/Magento/Cms/Test/Mftf/Test/AdminCmsBlockGridUrlFilterApplierTest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
</after>
3333
<amOnPage url="{{CmsBlocksPage.url}}?filters[title]=$$createBlock.title$$" stepKey="navigateToBlockGridWithFilters"/>
3434
<waitForPageLoad stepKey="waitForBlockGrid"/>
35-
<see selector="{{BlockPageActionsSection.blockGridRowByTitle($$createBlock.title$$)}}" userInput="$$createBlock.title$$" stepKey="seeBlock"/>
36-
<seeElement selector="{{BlockPageActionsSection.activeFilterDiv}}" stepKey="seeEnabledFilters"/>
37-
<see selector="{{BlockPageActionsSection.activeFilterDiv}}" userInput="Title: $$createBlock.title$$" stepKey="seeBlockTitleFilter"/>
35+
<waitForText selector="{{BlockPageActionsSection.blockGridRowByTitle($$createBlock.title$$)}}" userInput="$$createBlock.title$$" stepKey="seeBlock"/>
36+
<waitForElementVisible selector="{{BlockPageActionsSection.activeFilterDiv}}" stepKey="seeEnabledFilters"/>
37+
<waitForText selector="{{BlockPageActionsSection.activeFilterDiv}}" userInput="Title: $$createBlock.title$$" stepKey="seeBlockTitleFilter"/>
3838
</test>
3939
</tests>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminDisableDHLConfigurationActionGroup">
12+
<magentoCLI command="config:set {{AdminDHLDisableConfigData.path}} {{AdminDHLDisableConfigData.value}}" stepKey="disableDHL"/>
13+
<magentoCLI command="config:set {{AdminCarriersDHLAllowedAllCountries.path}} {{AdminCarriersDHLAllowedAllCountries.value}}" stepKey="DHLAllowedAllCountries"/>
14+
<magentoCLI command="config:set {{AdminDisableDHLShowMethod.path}} {{AdminDisableDHLShowMethod.value}}" stepKey="disableDHLShowMethod"/>
15+
<magentoCLI command="config:set {{AdminDisableDHLDebug.path}} {{AdminDisableDHLDebug.value}}" stepKey="disableDHLDebug"/>
16+
<magentoCLI command="config:set {{AdminDisableSandboxMode.path}} {{AdminDisableSandboxMode.value}}" stepKey="disableSandboxMode"/>
17+
</actionGroup>
18+
</actionGroups>

0 commit comments

Comments
 (0)