Skip to content

Commit e8c6f18

Browse files
committed
MC-40021: Unexpected behavior after changing the quantity on one line of the shipping address and clicking the Back button in the browser.
1 parent be82efb commit e8c6f18

File tree

5 files changed

+121
-1
lines changed

5 files changed

+121
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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="AssertStorefrontMultishippingAddressAndItemActionGroup">
12+
<annotations>
13+
<description>Verify item information on Ship to Multiple Addresses page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="sequenceNumber" type="string" defaultValue="1"/>
17+
<argument name="productName" type="string" defaultValue="{{SimpleProduct.name}}"/>
18+
<argument name="quantity" type="string" defaultValue="1"/>
19+
<argument name="firstName" type="string" defaultValue="{{US_Address_CA.firstname}}"/>
20+
<argument name="lastName" type="string" defaultValue="{{US_Address_CA.lastname}}"/>
21+
<argument name="city" type="string" defaultValue="{{US_Address_CA.city}}"/>
22+
<argument name="state" type="string" defaultValue="{{US_Address_CA.state}}"/>
23+
<argument name="postCode" type="string" defaultValue="{{US_Address_CA.postcode}}"/>
24+
<argument name="country" type="string" defaultValue="{{US_Address_CA.country}}"/>
25+
<argument name="addressStreetLine1" type="string" defaultValue="{{US_Address_CA.street[0]}}"/>
26+
<argument name="addressStreetLine2" type="string" defaultValue="{{US_Address_CA.street[1]}}"/>
27+
</arguments>
28+
29+
<seeElement selector="{{MultishippingSection.productLink(productName, sequenceNumber)}}" stepKey="verifyProductName"/>
30+
<seeInField selector="{{MultishippingSection.productQty(sequenceNumber)}}" userInput="{{quantity}}" stepKey="verifyQuantity"/>
31+
<seeInField selector="{{MultishippingSection.shippingAddressSelector(sequenceNumber)}}" userInput="{{firstName}} {{lastName}}, {{addressStreetLine1}} {{addressStreetLine2}}, {{city}}, {{state}} {{postCode}}, {{country}}" stepKey="verifyAddress"/>
32+
</actionGroup>
33+
</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="StorefrontChangeMultishippingItemQtyActionGroup">
12+
<annotations>
13+
<description>Change multishipping item quantity on Ship to Multiple Addresses page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="sequenceNumber" type="string" defaultValue="1"/>
17+
<argument name="quantity" type="string" defaultValue="1"/>
18+
</arguments>
19+
20+
<fillField selector="{{MultishippingSection.productQty(sequenceNumber)}}" userInput="{{quantity}}" stepKey="setQuantity"/>
21+
</actionGroup>
22+
</actionGroups>

app/code/Magento/Multishipping/Test/Mftf/Section/MultishippingSection/MultishippingSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
<element name="shippingAddressSelector" type="select" selector="//tr[position()={{addressPosition}}]//td[@data-th='Send To']//select" parameterized="true"/>
1515
<element name="shippingAddressOptions" type="select" selector="#multiship-addresses-table tbody tr:nth-of-type({{addressPosition}}) .col.address select option:nth-of-type({{optionIndex}})" parameterized="true"/>
1616
<element name="selectShippingAddress" type="select" selector="(//table[@id='multiship-addresses-table'] //div[@class='field address'] //select)[{{sequenceNumber}}]" parameterized="true"/>
17+
<element name="productQty" type="input" selector="#multiship-addresses-table tbody tr:nth-of-type({{sequenceNumber}}) .col.qty input" parameterized="true"/>
18+
<element name="productLink" type="button" selector="(//form[@id='checkout_multishipping_form']//a[contains(text(),'{{productName}}')])[{{sequenceNumber}}]" parameterized="true"/>
1719
<element name="removeItemButton" type="button" selector="//a[contains(@title, 'Remove Item')][{{var}}]" parameterized="true"/>
1820
<element name="back" type="button" selector=".action.back"/>
1921
</section>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="StorefrontMultishippingUpdateProductQtyTest">
11+
<annotations>
12+
<features value="Multishipping"/>
13+
<stories value="Checkout with multiple addresses."/>
14+
<title value="Update Product Quantity on Ship to Multiple Addresses Page."/>
15+
<description value="Verify customer will see correct product quantity after return to Ship to Multiple Addresses from Shipping information page."/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="MC-41697"/>
18+
<useCaseId value="MC-40021"/>
19+
<group value="multishipping"/>
20+
</annotations>
21+
22+
<before>
23+
<createData entity="SimpleProduct2" stepKey="product"/>
24+
<createData entity="Simple_US_CA_Customer" stepKey="customer"/>
25+
</before>
26+
<after>
27+
<deleteData createDataKey="product" stepKey="deleteProduct"/>
28+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
29+
<deleteData createDataKey="customer" stepKey="deleteCustomer"/>
30+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
31+
</after>
32+
33+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
34+
<argument name="Customer" value="$customer$"/>
35+
</actionGroup>
36+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="navigateToSimpleProductDetailsPage">
37+
<argument name="product" value="$product$"/>
38+
</actionGroup>
39+
<actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addSimpleProductToCart">
40+
<argument name="productQty" value="2"/>
41+
</actionGroup>
42+
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/>
43+
<actionGroup ref="StorefrontCheckoutWithMultipleAddressesActionGroup" stepKey="checkoutWithMultipleAddresses"/>
44+
<actionGroup ref="StorefrontChangeMultishippingItemQtyActionGroup" stepKey="setProductQuantity">
45+
<argument name="quantity" value="2"/>
46+
</actionGroup>
47+
<actionGroup ref="StorefrontNavigateToShippingInformationPageActionGroup" stepKey="navigateToShippingInformation"/>
48+
<moveBack stepKey="moveBackToShippingInformation"/>
49+
<actionGroup ref="AssertStorefrontMultishippingAddressAndItemActionGroup" stepKey="verifyLine1Qty">
50+
<argument name="productName" value="$product.name$"/>
51+
</actionGroup>
52+
<actionGroup ref="AssertStorefrontMultishippingAddressAndItemActionGroup" stepKey="verifyLine2Qty">
53+
<argument name="sequenceNumber" value="2"/>
54+
<argument name="productName" value="$product.name$"/>
55+
</actionGroup>
56+
<actionGroup ref="AssertStorefrontMultishippingAddressAndItemActionGroup" stepKey="verifyLine3Qty">
57+
<argument name="sequenceNumber" value="3"/>
58+
<argument name="productName" value="$product.name$"/>
59+
</actionGroup>
60+
</test>
61+
</tests>

app/code/Magento/Multishipping/view/frontend/templates/checkout/addresses.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@
6464
size="2"
6565
min="0"
6666
class="input-text qty"
67-
data-validate="{number: true, required:true, 'validate-greater-than-zero':true}"/>
67+
data-validate="{number: true, required:true, 'validate-greater-than-zero':true}"
68+
autocomplete="off"
69+
/>
6870
</div>
6971
</div>
7072
</td>

0 commit comments

Comments
 (0)