Skip to content

Commit 1758af8

Browse files
author
Devagouda Patil
committed
MAGETWO-90970: State field becomes required after page refresh during checkout
-Added functional test to cover the bug fix
1 parent 4e1ffe3 commit 1758af8

File tree

3 files changed

+81
-0
lines changed

3 files changed

+81
-0
lines changed
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
11+
<page name="CheckoutShippingPage" url="/checkout/#shipping" module="Checkout" area="storefront">
12+
<section name="CheckoutShippingGuestInfoSection"/>
13+
<section name="CheckoutShippingSection"/>
14+
</page>
15+
</pages>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="AddressStateFieldForUKCustomerRemainOptionAfterRefreshTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="MAGETWO-90970"/>
15+
<title value="Guest Checkout"/>
16+
<description value="Address State Field For UK Customers Remain Option even After Browser Refresh"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MAGETWO-93329"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
<before>
22+
<createData entity="_defaultCategory" stepKey="createCategory"/>
23+
<createData entity="ApiSimpleProduct" stepKey="createProduct">
24+
<requiredEntity createDataKey="createCategory"/>
25+
</createData>
26+
</before>
27+
<after>
28+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
29+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
30+
</after>
31+
32+
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/>
33+
<waitForPageLoad stepKey="waitForPageLoad1"/>
34+
<moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverProduct"/>
35+
<click selector="{{StorefrontCategoryMainSection.AddToCartBtn}}" stepKey="addToCart"/>
36+
<waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="waitForProductAdded"/>
37+
<see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added $$createProduct.name$$ to your shopping cart." stepKey="seeAddedToCartMessage"/>
38+
<see selector="{{StorefrontMinicartSection.quantity}}" userInput="1" stepKey="seeCartQuantity"/>
39+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="guestGoToCheckoutFromMinicart" />
40+
<selectOption stepKey="selectCounty" selector="{{CheckoutShippingSection.country}}" userInput="{{UK_Address.country_id}}"/>
41+
<waitForPageLoad stepKey="waitFormToReload"/>
42+
<reloadPage stepKey="refreshPage"/>
43+
<waitForPageLoad stepKey="waitFormToReload1"/>
44+
<fillField selector="{{CheckoutShippingSection.email}}" userInput="{{CustomerEntityOne.email}}" stepKey="enterEmail"/>
45+
<fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{CustomerEntityOne.firstname}}" stepKey="enterFirstName"/>
46+
<fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{CustomerEntityOne.lastname}}" stepKey="enterLastName"/>
47+
<fillField selector="{{CheckoutShippingSection.street}}" userInput="{{UK_Address.street[0]}}" stepKey="enterStreet"/>
48+
<fillField selector="{{CheckoutShippingSection.city}}" userInput="{{UK_Address.city}}" stepKey="enterCity"/>
49+
<waitForPageLoad stepKey="waitFormToReload2"/>
50+
<see userInput="State/Province" stepKey="StateFieldStillExists"/>
51+
<fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{UK_Address.telephone}}" stepKey="enterTelephone"/>
52+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/>
53+
<click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/>
54+
<waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/>
55+
<click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/>
56+
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/>
57+
<seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/>
58+
59+
</test>
60+
</tests>

app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@
8585
</entity>
8686
<!--If required other field can be added to UK_Address entity, dont modify any existing data-->
8787
<entity name="UK_Address" type="address">
88+
<array key="street">
89+
<item>7700 xyz street</item>
90+
<item>113</item>
91+
</array>
92+
<data key="city">London</data>
8893
<data key="country_id">GB</data>
94+
<data key="telephone">512-345-6789</data>
8995
</entity>
9096
</entities>

0 commit comments

Comments
 (0)