Skip to content

Commit 03d0363

Browse files
authored
ENGCOM-5842: Bugfix/22964 #24597
2 parents 882ea8f + da46ff4 commit 03d0363

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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="StorefrontRegionUpdatesAfterChangingCountryAndLeavingRegionSelectUnselectedTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Region updates after changing country "/>
15+
<title value="Region updates after changing country "/>
16+
<description value="Region dupdates after changing country and leaving region select unselected"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="https://github.com/magento/magento2/issues/23460"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
<before>
22+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
23+
</before>
24+
<after>
25+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
26+
</after>
27+
28+
<!-- Login to storefront from customer -->
29+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCustomer">
30+
<argument name="Customer" value="$$createCustomer$$"/>
31+
</actionGroup>
32+
33+
<actionGroup ref="StorefrontOpenMyAccountPageActionGroup" stepKey="goToMyAccountPage"/>
34+
35+
<actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="goToAddressBookPage">
36+
<argument name="menu" value="Address Book"/>
37+
</actionGroup>
38+
<actionGroup ref="StoreFrontClickEditDefaultShippingAddressActionGroup" stepKey="clickEditAddress"/>
39+
<selectOption selector="{{StorefrontCustomerAddressFormSection.country}}" userInput="{{updateCustomerFranceAddress.country}}" stepKey="selectCountry"/>
40+
<actionGroup ref="AdminSaveCustomerAddressActionGroup" stepKey="saveAddress"/>
41+
42+
<see selector="{{StorefrontCustomerAddressesSection.defaultShippingAddress}}" userInput="{{updateCustomerFranceAddress.country}}" stepKey="seeAssertCustomerDefaultShippingAddressCountry"/>
43+
</test>
44+
</tests>

app/code/Magento/Checkout/view/frontend/web/js/region-updater.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ define([
162162
this._clearError();
163163
this._checkRegionRequired(country);
164164

165+
$(regionList).find('option:selected').removeAttr('selected');
166+
regionInput.val('');
167+
165168
// Populate state/province dropdown list if available or use input box
166169
if (this.options.regionJson[country]) {
167170
this._removeSelectOptions(regionList);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="StoreFrontClickEditDefaultShippingAddressActionGroup">
12+
<annotations>
13+
<description>Click on the edit default shipping address link.</description>
14+
</annotations>
15+
16+
<click stepKey="ClickEditDefaultShippingAddress" selector="{{StorefrontCustomerAddressesSection.editDefaultShippingAddress}}"/>
17+
<waitForPageLoad stepKey="waitForStorefrontSignInPageLoad"/>
18+
</actionGroup>
19+
</actionGroups>

0 commit comments

Comments
 (0)