Skip to content

Commit f4f4dae

Browse files
author
Joan He
committed
Merge remote-tracking branch 'origin/MAGETWO-90970' into MAGETWO-90995
2 parents 73fc2f7 + c6a4ec9 commit f4f4dae

File tree

4 files changed

+84
-0
lines changed

4 files changed

+84
-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: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
<title value="Guest Checkout"/>
15+
<description value="Address State Field For UK Customers Remain Option even After Browser Refresh"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="MAGETWO-93329"/>
18+
<group value="checkout"/>
19+
</annotations>
20+
<before>
21+
<createData entity="_defaultCategory" stepKey="createCategory"/>
22+
<createData entity="ApiSimpleProduct" stepKey="createProduct">
23+
<requiredEntity createDataKey="createCategory"/>
24+
</createData>
25+
</before>
26+
<after>
27+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
28+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
29+
</after>
30+
31+
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/>
32+
<waitForPageLoad stepKey="waitForPageLoad1"/>
33+
<moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverProduct"/>
34+
<click selector="{{StorefrontCategoryMainSection.AddToCartBtn}}" stepKey="addToCart"/>
35+
<waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="waitForProductAdded"/>
36+
<see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added $$createProduct.name$$ to your shopping cart." stepKey="seeAddedToCartMessage"/>
37+
<see selector="{{StorefrontMinicartSection.quantity}}" userInput="1" stepKey="seeCartQuantity"/>
38+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="guestGoToCheckoutFromMinicart" />
39+
<selectOption stepKey="selectCounty" selector="{{CheckoutShippingSection.country}}" userInput="{{UK_Address.country_id}}"/>
40+
<waitForPageLoad stepKey="waitFormToReload"/>
41+
<reloadPage stepKey="refreshPage"/>
42+
<waitForPageLoad stepKey="waitFormToReload1"/>
43+
<fillField selector="{{CheckoutShippingSection.email}}" userInput="{{CustomerEntityOne.email}}" stepKey="enterEmail"/>
44+
<fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{CustomerEntityOne.firstname}}" stepKey="enterFirstName"/>
45+
<fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{CustomerEntityOne.lastname}}" stepKey="enterLastName"/>
46+
<fillField selector="{{CheckoutShippingSection.street}}" userInput="{{UK_Address.street[0]}}" stepKey="enterStreet"/>
47+
<fillField selector="{{CheckoutShippingSection.city}}" userInput="{{UK_Address.city}}" stepKey="enterCity"/>
48+
<waitForPageLoad stepKey="waitFormToReload2"/>
49+
<see userInput="State/Province" stepKey="StateFieldStillExists"/>
50+
<fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{UK_Address.telephone}}" stepKey="enterTelephone"/>
51+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/>
52+
<click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/>
53+
<waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/>
54+
<click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/>
55+
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/>
56+
<seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/>
57+
58+
</test>
59+
</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>

app/code/Magento/Ui/view/base/web/js/form/element/region.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ define([
4949
if (option && !option['is_region_required']) {
5050
this.error(false);
5151
this.validation = _.omit(this.validation, 'required-entry');
52+
registry.get(this.customName, function (input) {
53+
input.validation['required-entry'] = false;
54+
input.required(false);
55+
});
5256
} else {
5357
this.validation['required-entry'] = true;
5458
}

0 commit comments

Comments
 (0)