Skip to content

Commit 744ffc8

Browse files
authored
Merge pull request #166 from magento-pangolin/MC-8893
MC-8893 Backport for MC-12599
2 parents d412edb + 3c9a52d commit 744ffc8

12 files changed

+223
-6
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/OpenStorefrontProductPageActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10-
<actionGroup name="OpenStorefrontProductPageActionGroup">
10+
<actionGroup name="OpenStoreFrontProductPageActionGroup">
1111
<arguments>
1212
<argument name="productUrlKey" type="string"/>
1313
</arguments>

app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,14 @@
128128
<click selector="{{CheckoutPaymentSection.placeOrderNoWait}}" stepKey="clickPlaceOrder"/>
129129
<waitForText selector="{{StorefrontMessagesSection.errorMessage}}" userInput="{{errorMessage}}" time="30" stepKey="seeShippingMethodError"/>
130130
</actionGroup>
131+
132+
<!-- Check shipping method in checkout -->
133+
<actionGroup name="CheckShippingMethodInCheckoutActionGroup">
134+
<arguments>
135+
<argument name="shippingMethod"/>
136+
</arguments>
137+
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/>
138+
<seeElement selector="{{CheckoutPaymentSection.isPaymentSection}}" stepKey="assertPaymentSection"/>
139+
<see userInput="{{shippingMethod}}" selector="{{CheckoutPaymentSection.shippingMethodInformation}}" stepKey="assertshippingMethodInformation"/>
140+
</actionGroup>
131141
</actionGroups>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="GuestCheckoutFillNewShippingAddressActionGroup">
12+
<arguments>
13+
<argument name="customer" type="entity"/>
14+
<argument name="address" type="entity"/>
15+
</arguments>
16+
<fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customer.email}}" stepKey="fillEmailField"/>
17+
<fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customer.firstName}}" stepKey="fillFirstName"/>
18+
<fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customer.lastName}}" stepKey="fillLastName"/>
19+
<fillField selector="{{CheckoutShippingSection.street}}" userInput="{{address.street}}" stepKey="fillStreet"/>
20+
<fillField selector="{{CheckoutShippingSection.city}}" userInput="{{address.city}}" stepKey="fillCity"/>
21+
<selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{address.state}}" stepKey="selectRegion"/>
22+
<fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{address.postcode}}" stepKey="fillZipCode"/>
23+
<fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{address.telephone}}" stepKey="fillPhone"/>
24+
</actionGroup>
25+
</actionGroups>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<!-- Free shipping -->
12+
<entity name="EnableFreeShippingConfigData">
13+
<data key="path">carriers/freeshipping/active</data>
14+
<data key="scope">carriers</data>
15+
<data key="scope_id">1</data>
16+
<data key="label">Yes</data>
17+
<data key="value">1</data>
18+
</entity>
19+
<entity name="DisableFreeShippingConfigData">
20+
<data key="path">carriers/freeshipping/active</data>
21+
<data key="scope">carriers</data>
22+
<data key="scope_id">1</data>
23+
<data key="label">No</data>
24+
<data key="value">0</data>
25+
</entity>
26+
27+
<!-- Flat Rate shipping -->
28+
<entity name="EnableFlatRateConfigData">
29+
<data key="path">carriers/flatrate/active</data>
30+
<data key="scope">carriers</data>
31+
<data key="scope_id">1</data>
32+
<data key="label">Yes</data>
33+
<data key="value">1</data>
34+
</entity>
35+
<entity name="DisableFlatRateConfigData">
36+
<data key="path">carriers/flatrate/active</data>
37+
<data key="scope">carriers</data>
38+
<data key="scope_id">1</data>
39+
<data key="label">No</data>
40+
<data key="value">0</data>
41+
</entity>
42+
</entities>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,6 @@
4949
<element name="billingAddressSelectShared" type="select" selector=".checkout-billing-address select[name='billing_address_id']"/>
5050
<element name="billingAddressSameAsShippingShared" type="checkbox" selector="#billing-address-same-as-shipping-shared"/>
5151
<element name="addressAction" type="button" selector="//div[@class='actions-toolbar']//span[text()='{{action}}']" parameterized="true"/>
52+
<element name="shippingMethodInformation" type="text" selector=".ship-via .shipping-information-content"/>
5253
</section>
5354
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
<element name="shippingMethodRowByName" type="text" selector="//div[@id='checkout-shipping-method-load']//td[contains(., '{{var1}}')]/.." parameterized="true"/>
1717
<element name="flatRate" type="radio" selector="#label_carrier_flatrate_flatrate"/>
1818
<element name="freeShippingShippingMethod" type="input" selector="#s_method_freeshipping_freeshipping" timeout="30"/>
19+
<element name="shippingMethodFreeShipping" type="radio" selector="#checkout-shipping-method-load input[value='freeshipping_freeshipping']"/>
1920
</section>
2021
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
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="AdminCheckConfigsChangesAreNotAffectedStartedCheckoutProcessTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Changes in configs are not affecting checkout process"/>
15+
<title value="Admin check configs changes are not affected started checkout process test"/>
16+
<description value="Changes in admin for shipping rates are not affecting checkout process that has been started"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-8893"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
<before>
22+
<!-- Create simple product -->
23+
<createData entity="SimpleProduct3" stepKey="createProduct"/>
24+
25+
<!-- Enable free shipping method -->
26+
<magentoCLI command="config:set {{EnableFreeShippingConfigData.path}} {{EnableFreeShippingConfigData.value}}" stepKey="enableFreeShipping"/>
27+
28+
<!-- Disable flat rate method -->
29+
<magentoCLI command="config:set {{DisableFlatRateConfigData.path}} {{DisableFlatRateConfigData.value}}" stepKey="disableFlatRate"/>
30+
</before>
31+
<after>
32+
<!-- Roll back configuration -->
33+
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/>
34+
<magentoCLI command="config:set {{DisableFreeShippingConfigData.path}} {{DisableFreeShippingConfigData.value}}" stepKey="disableFreeShipping"/>
35+
36+
<!-- Delete simple product -->
37+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
38+
39+
<!-- Log out -->
40+
<actionGroup ref="logout" stepKey="logout"/>
41+
</after>
42+
43+
<!-- Add product to cart -->
44+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductPage">
45+
<argument name="productUrlKey" value="$$createProduct.custom_attributes[url_key]$$"/>
46+
</actionGroup>
47+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
48+
<argument name="product" value="$$createProduct$$"/>
49+
<argument name="productCount" value="1"/>
50+
</actionGroup>
51+
52+
<!-- Proceed to Checkout from mini shopping cart -->
53+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckout"/>
54+
55+
<!-- Fill all required fields -->
56+
<actionGroup ref="GuestCheckoutFillNewShippingAddressActionGroup" stepKey="fillNewShippingAddress">
57+
<argument name="customer" value="Simple_Customer_Without_Address"/>
58+
<argument name="address" value="US_Address_TX"/>
59+
</actionGroup>
60+
61+
<!-- Assert Free Shipping checkbox -->
62+
<seeCheckboxIsChecked selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="freeShippingMethodCheckboxIsChecked"/>
63+
64+
<!-- Click Next button -->
65+
<click selector="{{GuestCheckoutShippingSection.next}}" stepKey="clickNext"/>
66+
<waitForPageLoad stepKey="waitForShipmentPageLoad"/>
67+
68+
<!-- Payment step is opened -->
69+
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/>
70+
71+
<!-- Order Summary block contains information about shipping -->
72+
<actionGroup ref="CheckShippingMethodInCheckoutActionGroup" stepKey="guestCheckoutCheckShippingMethod">
73+
<argument name="shippingMethod" value="freeTitleDefault.value"/>
74+
</actionGroup>
75+
76+
<!-- Open new browser's window and login as Admin -->
77+
<openNewTab stepKey="openNewTab"/>
78+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
79+
80+
<!-- Go to Store > Configuration > Sales > Shipping Methods -->
81+
<actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodConfigPage"/>
82+
83+
<!-- Enable "Flat Rate" -->
84+
<actionGroup ref="AdminChangeFlatRateShippingMethodStatusActionGroup" stepKey="enableFlatRateShippingStatus"/>
85+
86+
<!-- Flush cache -->
87+
<magentoCLI command="cache:flush" stepKey="cacheFlush"/>
88+
89+
<!-- Back to the Checkout and refresh the page -->
90+
<switchToPreviousTab stepKey="switchToPreviousTab"/>
91+
<reloadPage stepKey="refreshPage"/>
92+
<waitForPageLoad stepKey="waitPageReload"/>
93+
94+
<!-- Payment step is opened after refreshing -->
95+
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSection"/>
96+
97+
<!-- Order Summary block contains information about free shipping -->
98+
<actionGroup ref="CheckShippingMethodInCheckoutActionGroup" stepKey="guestCheckoutCheckFreeShippingMethod">
99+
<argument name="shippingMethod" value="freeTitleDefault.value"/>
100+
</actionGroup>
101+
</test>
102+
</tests>

app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<before>
2121
<!--Set default flat rate shipping method settings-->
22-
<createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/>
22+
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/>
2323

2424
<!--Create simple customer-->
2525
<createData entity="Simple_US_CA_Customer" stepKey="simpleCustomer"/>

app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<field key="price">100</field>
2525
</createData>
2626
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
27-
<createData entity="DisableFlatRateShippingMethodConfig" stepKey="disableFlatRate"/>
27+
<magentoCLI command="config:set {{DisableFlatRateConfigData.path}} {{DisableFlatRateConfigData.value}}" stepKey="disableFlatRate"/>
2828
<createData entity="FreeShippinMethodConfig" stepKey="enableFreeShippingMethod"/>
2929
<createData entity="setFreeShippingSubtotal" stepKey="setFreeShippingSubtotal"/>
3030
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
@@ -34,7 +34,7 @@
3434
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
3535
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
3636
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
37-
<createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRate"/>
37+
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/>
3838
<createData entity="FreeShippinMethodDefault" stepKey="disableFreeShippingMethod"/>
3939
<createData entity="setFreeShippingSubtotalToDefault" stepKey="setFreeShippingSubtotalToDefault"/>
4040
<actionGroup ref="logout" stepKey="logout"/>
@@ -60,4 +60,4 @@
6060
<dontSeeElement selector="{{AdminMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/>
6161
<seeElement selector="{{AdminMessagesSection.errorMessage}}" stepKey="seeErrorMessage"/>
6262
</test>
63-
</tests>
63+
</tests>

app/code/Magento/Sales/Test/Mftf/Test/CheckXSSVulnerabilityDuringOrderCreationTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</after>
3232

3333
<!-- Add product to the shopping cart -->
34-
<actionGroup ref="OpenStorefrontProductPageActionGroup" stepKey="openProductPage">
34+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductPage">
3535
<argument name="productUrlKey" value="$$createProduct.custom_attributes[url_key]$$"/>
3636
</actionGroup>
3737
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="AdminChangeFlatRateShippingMethodStatusActionGroup">
12+
<arguments>
13+
<argument name="status" type="string" defaultValue="1"/>
14+
</arguments>
15+
<conditionalClick selector="{{AdminShippingMethodFlatRateSection.carriersFlatRateTab}}" dependentSelector="{{AdminShippingMethodFlatRateSection.carriersFlatRateActive}}" visible="false" stepKey="expandTab"/>
16+
<selectOption selector="{{AdminShippingMethodFlatRateSection.carriersFlatRateActive}}" userInput="{{status}}" stepKey="changeFlatRateMethodStatus"/>
17+
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfigs"/>
18+
<waitForPageLoad stepKey="waitForPageLoad"/>
19+
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration." stepKey="seeSuccessMessage"/>
20+
</actionGroup>
21+
</actionGroups>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminShippingMethodFlatRateSection">
12+
<element name="carriersFlatRateTab" type="button" selector="#carriers_flatrate-head"/>
13+
<element name="carriersFlatRateActive" type="select" selector="#carriers_flatrate_active"/>
14+
</section>
15+
</sections>

0 commit comments

Comments
 (0)