Skip to content

Commit a3223ed

Browse files
committed
Merge branch '2.3-tests-pr' of github.com:magento-pangolin/magento2ce into MC-12599
2 parents 8a28fa6 + 15277c0 commit a3223ed

14 files changed

+662
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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="AdminAssignCategoryToProductAndSaveActionGroup">
12+
<arguments>
13+
<argument name="categoryName" type="string"/>
14+
</arguments>
15+
<!-- on edit Product page catalog/product/edit/id/{{product_id}}/ -->
16+
<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="openDropDown"/>
17+
<checkOption selector="{{AdminProductFormSection.selectCategory(categoryName)}}" stepKey="selectCategory"/>
18+
<click selector="{{AdminProductFormSection.done}}" stepKey="clickDone"/>
19+
<waitForPageLoad stepKey="waitForApplyCategory"/>
20+
<click selector="{{AdminProductFormSection.save}}" stepKey="clickSave"/>
21+
<waitForPageLoad stepKey="waitForSavingProduct"/>
22+
<see userInput="You saved the product." selector="{{CatalogProductsSection.messageSuccessSavedProduct}}" stepKey="seeSuccessMessage"/>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 22 additions & 0 deletions
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="AdminUnassignCategoryOnProductAndSaveActionGroup">
12+
<arguments>
13+
<argument name="categoryName" type="string"/>
14+
</arguments>
15+
<!-- on edit Product page catalog/product/edit/id/{{product_id}}/ -->
16+
<click selector="{{AdminProductFormSection.unselectCategories(categoryName)}}" stepKey="clearCategory"/>
17+
<waitForPageLoad stepKey="waitForDelete"/>
18+
<click selector="{{AdminProductFormSection.save}}" stepKey="clickSave"/>
19+
<waitForPageLoad stepKey="waitForSavingProduct"/>
20+
<see userInput="You saved the product." selector="{{CatalogProductsSection.messageSuccessSavedProduct}}" stepKey="seeSuccessMessage"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="StorefrontGoToCategoryPageActionGroup">
12+
<arguments>
13+
<argument name="categoryName" type="string"/>
14+
</arguments>
15+
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="onFrontend"/>
16+
<waitForPageLoad stepKey="waitForStorefrontPageLoad"/>
17+
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryName)}}" stepKey="toCategory"/>
18+
<waitForPageLoad stepKey="waitForCategoryPage"/>
19+
</actionGroup>
20+
<actionGroup name="StorefrontGoToSubCategoryPageActionGroup" extends="StorefrontGoToCategoryPageActionGroup">
21+
<arguments>
22+
<argument name="subCategoryName" type="string"/>
23+
</arguments>
24+
<moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryName)}}" stepKey="toCategory"/>
25+
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName(subCategoryName)}}" stepKey="openSubCategory" after="toCategory"/>
26+
</actionGroup>
27+
</actionGroups>

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

Lines changed: 314 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="OpenStoreFrontCheckoutShippingPageActionGroup">
11+
<amOnPage url="{{CheckoutShippingPage.url}}" stepKey="amOnCheckoutShippingPage"/>
12+
<waitForPageLoad stepKey="waitForCheckoutShippingPageLoad"/>
13+
</actionGroup>
14+
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
<element name="shipHereButton" type="button" selector="//div/following-sibling::div/button[contains(@class, 'action-select-shipping-item')]"/>
2020
<element name="shippingMethodLoader" type="button" selector="//div[contains(@class, 'checkout-shipping-method')]/following-sibling::div[contains(@class, 'loading-mask')]"/>
2121
<element name="freeShippingShippingMethod" type="input" selector="#s_method_freeshipping_freeshipping" timeout="30"/>
22+
<element name="noQuotesMsg" type="text" selector="#checkout-step-shipping_method div"/>
2223
</section>
2324
</sections>
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontGuestCheckoutForSpecificCountriesTest">
12+
<annotations>
13+
<features value="One Page Checkout"/>
14+
<stories value="Checkout for Specific Countries"/>
15+
<title value="Storefront guest checkout for specific countries test"/>
16+
<description value="Checkout flow if shipping rates are not available"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-13414"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
<before>
22+
<!-- Create simple product -->
23+
<createData entity="SimpleProduct2" stepKey="createProduct"/>
24+
25+
<!-- Enable free shipping to specific country - Afghanistan -->
26+
<magentoCLI command="config:set {{EnableFreeShippingConfigData.path}} {{EnableFreeShippingConfigData.value}}" stepKey="enableFreeShipping"/>
27+
<magentoCLI command="config:set {{EnableFreeShippingToSpecificCountriesConfigData.path}} {{EnableFreeShippingToSpecificCountriesConfigData.value}}" stepKey="allowFreeShippingSpecificCountries"/>
28+
<magentoCLI command="config:set {{EnableFreeShippingToAfghanistanConfigData.path}} {{EnableFreeShippingToAfghanistanConfigData.value}}" stepKey="enableFreeShippingToAfghanistan"/>
29+
30+
<!-- Enable flat rate shipping to specific country - Afghanistan -->
31+
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/>
32+
<magentoCLI command="config:set {{EnableFlatRateToSpecificCountriesConfigData.path}} {{EnableFlatRateToSpecificCountriesConfigData.value}}" stepKey="allowFlatRateSpecificCountries"/>
33+
<magentoCLI command="config:set {{EnableFlatRateToAfghanistanConfigData.path}} {{EnableFlatRateToAfghanistanConfigData.value}}" stepKey="enableFlatRateToAfghanistan"/>
34+
</before>
35+
<after>
36+
<!-- Rollback all configurations -->
37+
<magentoCLI command="config:set {{DisableFreeShippingConfigData.path}} {{DisableFreeShippingConfigData.value}}" stepKey="disableFreeShipping"/>
38+
<magentoCLI command="config:set {{EnableFreeShippingToAllAllowedCountriesConfigData.path}} {{EnableFreeShippingToAllAllowedCountriesConfigData.value}}" stepKey="allowFreeShippingToAllCountries"/>
39+
<magentoCLI command="config:set {{EnableFlatRateToAllAllowedCountriesConfigData.path}} {{EnableFlatRateToAllAllowedCountriesConfigData.value}}" stepKey="allowFlatRateToAllCountries"/>
40+
41+
<!-- Delete product -->
42+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
43+
</after>
44+
45+
<!-- Add product to cart -->
46+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductPage">
47+
<argument name="productUrlKey" value="$$createProduct.custom_attributes[url_key]$$"/>
48+
</actionGroup>
49+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
50+
<argument name="product" value="$$createProduct$$"/>
51+
<argument name="productCount" value="1"/>
52+
</actionGroup>
53+
54+
<!-- Go to checkout page -->
55+
<actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="openCheckoutShippingPage"/>
56+
57+
<!-- Assert shipping methods are unavailable -->
58+
<actionGroup ref="AssertStoreFrontShippingMethodUnavailableActionGroup" stepKey="dontSeeFlatRateShippingMethod">
59+
<argument name="shippingMethodName" value="Flat Rate"/>
60+
</actionGroup>
61+
<actionGroup ref="AssertStoreFrontShippingMethodUnavailableActionGroup" stepKey="dontFreeShippingMethod"/>
62+
63+
<!-- Assert no quotes message -->
64+
<actionGroup ref="AssertStoreFrontNoQuotesMessageActionGroup" stepKey="assertNoQuotesMessage"/>
65+
66+
<!-- Assert Next button -->
67+
<dontSeeElement selector="{{CheckoutShippingMethodsSection.next}}" stepKey="dontSeeNextButton"/>
68+
69+
<!-- Fill form with valid data for US > California -->
70+
<selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{US_Address_CA.country}}" stepKey="selectCountry"/>
71+
<selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{US_Address_CA.state}}" stepKey="selectState"/>
72+
<fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{US_Address_CA.postcode}}" stepKey="fillPostcode"/>
73+
74+
<!-- Assert shipping methods are unavailable for US > California -->
75+
<actionGroup ref="AssertStoreFrontShippingMethodUnavailableActionGroup" stepKey="dontSeeFlatRateShippingMtd">
76+
<argument name="shippingMethodName" value="Flat Rate"/>
77+
</actionGroup>
78+
<actionGroup ref="AssertStoreFrontShippingMethodUnavailableActionGroup" stepKey="dontFreeShippingMtd"/>
79+
80+
<!-- Assert no quotes message for US > California -->
81+
<actionGroup ref="AssertStoreFrontNoQuotesMessageActionGroup" stepKey="assertNoQuotesMsg"/>
82+
83+
<!-- Assert Next button for US > California -->
84+
<dontSeeElement selector="{{CheckoutShippingMethodsSection.next}}" stepKey="dontSeeNextBtn"/>
85+
86+
<!-- Fill form for specific country - Afghanistan -->
87+
<selectOption selector="{{CheckoutShippingSection.country}}" userInput="Afghanistan" stepKey="selectSpecificCountry"/>
88+
89+
<!-- Assert shipping methods are available -->
90+
<actionGroup ref="AssertStoreFrontShippingMethodAvailableActionGroup" stepKey="seeFlatRateShippingMethod"/>
91+
<actionGroup ref="AssertStoreFrontShippingMethodAvailableActionGroup" stepKey="seeFreeShippingMethod">
92+
<argument name="shippingMethodName" value="Free Shipping"/>
93+
</actionGroup>
94+
95+
<!-- Assert Next button is available -->
96+
<seeElement selector="{{CheckoutShippingMethodsSection.next}}" stepKey="seeNextButton"/>
97+
</test>
98+
</tests>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontRefreshPageDuringGuestCheckoutTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Guest checkout"/>
15+
<title value="Storefront refresh page during guest checkout test"/>
16+
<description value="Address is not lost for guest checkout if guest refresh page during checkout"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-12084"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
<before>
22+
<!-- Login as admin -->
23+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
24+
25+
<!-- Create simple product -->
26+
<createData entity="SimpleProduct2" stepKey="createProduct"/>
27+
</before>
28+
<after>
29+
<!-- Delete simple product -->
30+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
31+
32+
<!-- Logout admin -->
33+
<actionGroup ref="logout" stepKey="logoutAsAdmin"/>
34+
</after>
35+
<!-- Add simple product to cart as Guest -->
36+
<amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/>
37+
<waitForPageLoad stepKey="waitForPageLoad"/>
38+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="cartAddSimpleProductToCart">
39+
<argument name="product" value="$$createProduct$$"/>
40+
<argument name="productCount" value="1"/>
41+
</actionGroup>
42+
43+
<!-- Go to Checkout page -->
44+
<actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/>
45+
<click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="clickProceedToCheckout"/>
46+
<waitForPageLoad stepKey="waitForProceedToCheckout"/>
47+
48+
<!-- Fill email field and addresses form and go next -->
49+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping">
50+
<argument name="shippingMethod" value="Flat Rate"/>
51+
</actionGroup>
52+
53+
<!-- Refresh page -->
54+
<reloadPage stepKey="refreshPage"/>
55+
56+
<!-- Click Place Order and assert order is placed -->
57+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/>
58+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>
59+
60+
<!-- Order review page has address that was created during checkout -->
61+
<amOnPage url="{{AdminOrderPage.url({$grabOrderNumber})}}" stepKey="navigateToOrderPage"/>
62+
<waitForPageLoad stepKey="waitForCreatedOrderPage"/>
63+
<see selector="{{AdminShipmentAddressInformationSection.shippingAddress}}" userInput="{{CustomerAddressSimple.street[0]}} {{CustomerAddressSimple.city}}, {{CustomerAddressSimple.state}}, {{CustomerAddressSimple.postcode}}" stepKey="checkShippingAddress"/>
64+
</test>
65+
</tests>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="AdminSwitchAllIndexerToActionModeActionGroup">
12+
<arguments>
13+
<argument name="action" type="string" defaultValue="Update by Schedule"/>
14+
</arguments>
15+
<amOnPage url="{{AdminIndexManagementPage.url}}" stepKey="onIndexManagement"/>
16+
<waitForPageLoad stepKey="waitForManagementPage"/>
17+
<selectOption userInput="selectAll" selector="{{AdminIndexManagementSection.selectMassAction}}" stepKey="checkIndexer"/>
18+
<selectOption userInput="{{action}}" selector="{{AdminIndexManagementSection.massActionSelect}}" stepKey="selectAction"/>
19+
<click selector="{{AdminIndexManagementSection.massActionSubmit}}" stepKey="clickSubmit"/>
20+
<waitForPageLoad stepKey="waitForSubmit"/>
21+
<see userInput="indexer(s) are in &quot;{{action}}&quot; mode." stepKey="seeMessage"/>
22+
</actionGroup>
23+
</actionGroups>
Lines changed: 22 additions & 0 deletions
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="AdminSwitchIndexerToActionModeActionGroup">
12+
<arguments>
13+
<argument name="indexerValue" type="string"/>
14+
<argument name="action" type="string" defaultValue="Update by Schedule"/>
15+
</arguments>
16+
<checkOption selector="{{AdminIndexManagementSection.indexerCheckbox(indexerValue)}}" stepKey="checkIndexer"/>
17+
<selectOption userInput="{{action}}" selector="{{AdminIndexManagementSection.massActionSelect}}" stepKey="selectAction"/>
18+
<click selector="{{AdminIndexManagementSection.massActionSubmit}}" stepKey="clickSubmit"/>
19+
<waitForPageLoad stepKey="waitForSubmit"/>
20+
<see selector="{{AdminIndexManagementSection.successMessage}}" userInput="1 indexer(s) are in &quot;{{action}}&quot; mode." stepKey="seeMessage"/>
21+
</actionGroup>
22+
</actionGroups>

0 commit comments

Comments
 (0)