Skip to content

Commit 66f5ece

Browse files
committed
ACP2E-1609: Region Field is not getting blank after selecting any region for a country
1 parent c19b035 commit 66f5ece

5 files changed

+92
-56
lines changed
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="AdminRemoveRegionFromCustomerAddressInformationActionGroup" >
12+
<annotations>
13+
<description>Remove region from customer address information.</description>
14+
</annotations>
15+
<selectOption selector="{{AdminCustomerAddressesSection.state}}" userInput="Please select a region, state or province." stepKey="removeState"/>
16+
<click selector="{{AdminCustomerAddressesSection.saveAddress}}" stepKey="clickSaveCustomerAfterRemovingRegion"/>
17+
<waitForPageLoad stepKey="waitForPageToBeSaved"/>
18+
</actionGroup>
19+
</actionGroups>
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="AdminSaveCustomerAddressInformationActionGroup" extends="AdminFillAndSaveCustomerAddressInformationActionGroup">
12+
<annotations>
13+
<description>EXTENDS: AdminFillAndSaveCustomerAddressInformationActionGroup. Fill and save customer address information.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="address" type="entity"/>
17+
</arguments>
18+
<remove keyForRemoval="fillRegion"/>
19+
<selectOption selector="{{AdminCustomerAddressesSection.state}}" userInput="{{address.state}}" stepKey="fillRegion" after="clickRegionToOpenListOfRegions"/>
20+
</actionGroup>
21+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="StorefrontRemoveRegionFromCustomerAddressFormActionGroup" >
12+
<annotations>
13+
<description>Remove region from customer address form.</description>
14+
</annotations>
15+
<selectOption selector="{{StorefrontCustomerAddressFormSection.state}}" userInput="Please select a region, state or province." stepKey="removeStateForStorefront"/>
16+
</actionGroup>
17+
</actionGroups>
18+

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -493,11 +493,4 @@
493493
<data key="postcode">5555</data>
494494
<data key="telephone">555-55-555-55</data>
495495
</entity>
496-
<entity name="Finland_Address" type="address">
497-
<data key="state">Ahvenanmaa</data>
498-
<data key="country_id">FI</data>
499-
<data key="country">Finland</data>
500-
<data key="default_shipping">true</data>
501-
<data key="default_billing">true</data>
502-
</entity>
503496
</entities>

app/code/Magento/Customer/Test/Mftf/Test/VerifyCustomerAddressRegionFieldTest.xml

Lines changed: 34 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -11,87 +11,72 @@
1111
<test name="VerifyCustomerAddressRegionFieldTest">
1212
<annotations>
1313
<features value="Customer"/>
14-
<stories value="Region field is getting blank after selecting any region for a country"/>
15-
<title value="Region field is not getting blank after selecting any region for a country"/>
16-
<description value="After saving customer address details in the admin without state/region, it will disappered from the address section."/>
14+
<stories value="The State-Region field should stay blank after it's cleared from the customer address and saved"/>
15+
<title value="The State-Region field should stay blank after it's cleared from the customer address and saved"/>
16+
<description value="When removing the state from the customer address details in the admin, the field must stay blank after save."/>
1717
<severity value="AVERAGE"/>
1818
<testCaseId value="AC-8302"/>
1919
<useCaseId value="ACP2E-1609"/>
2020
<group value="customer"/>
2121
</annotations>
2222

2323
<before>
24-
<createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="firstCustomer"/>
24+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
2525
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
2626
</before>
2727

2828
<after>
29-
<deleteData createDataKey="firstCustomer" stepKey="deleteFirstCustomer"/>
29+
<deleteData createDataKey="createCustomer" stepKey="deleteCreateCustomer"/>
3030
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3131
</after>
3232

33-
<!--Open customer grid page,select created customer and click edit mode-->
33+
<!--Open customer grid page and Navigate to customer edit page addresses tab for created customer-->
3434
<actionGroup ref="AdminOpenCustomersGridActionGroup" stepKey="openCustomersGridPage"/>
35-
<actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="openEditCustomerPageWithAddresses">
36-
<argument name="customer" value="$$firstCustomer$$"/>
35+
<actionGroup ref="AdminNavigateCustomerEditPageAddressesTabActionGroup" stepKey="openEditCustomerPageWithAddresses">
36+
<argument name="customerId" value="$createCustomer.id$"/>
3737
</actionGroup>
3838

39-
<!--Select Addresses tab click on Edit link for Default Billing Address -->
40-
<click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTabOfFirstCustomer"/>
41-
<waitForPageLoad stepKey="waitForAddressesOfFirstCustomer"/>
42-
<click selector="{{AdminCustomerAddressesDefaultBillingSection.editButton}}" stepKey="clickEditDefaultBillingAddress"/>
43-
<waitForPageLoad stepKey="waitForCustomerAddressAddUpdateFormLoad"/>
44-
45-
<!-- Select Country = Finland And Region =Ahvenanmaa , Click on Save Button-->
46-
<click selector="{{AdminCustomerAddressesSection.country}}" stepKey="clickCountryToOpenListOfCountries"/>
47-
<click selector="{{AdminCustomerAddressesSection.countryId(Finland_Address.country_id)}}" stepKey="fillCountry"/>
48-
<click selector="{{AdminCustomerAddressesSection.state}}" stepKey="clickRegionToOpenListOfRegions"/>
49-
<click selector="{{AdminCustomerAddressesSection.regionId(Finland_Address.state)}}" stepKey="fillRegion"/>
50-
<click selector="{{AdminCustomerAddressesSection.saveAddress}}" stepKey="clickSaveCustomer"/>
51-
<waitForPageLoad stepKey="waitForPageToBeSave"/>
39+
<!--Click on edit default billing address and update the address-->
40+
<actionGroup ref="AdminClickEditLinkForDefaultBillingAddressActionGroup" stepKey="clickEditDefaultBillingAddress"/>
41+
<actionGroup ref="AdminSaveCustomerAddressInformationActionGroup" stepKey="fillAndSaveCustomerAddressInformation">
42+
<argument name="address" value="updateCustomerFranceAddress"/>
43+
</actionGroup>
5244

5345
<!--Verify state name in address details section-->
54-
<see selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" userInput="{{Finland_Address.state}}" stepKey="SeeStateInAddress"/>
46+
<see selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" userInput="{{updateCustomerFranceAddress.state}}" stepKey="seeStateInAddress"/>
5547

56-
<!-- Click on edit link for default billing address , deselect region and click on save button-->
57-
<click selector="{{AdminCustomerAddressesDefaultBillingSection.editButton}}" stepKey="clickEditDefaultBillingAddressAgain"/>
58-
<waitForPageLoad stepKey="waitForCustomerAddressAddUpdateFormLoad2"/>
59-
<selectOption selector="{{AdminCustomerAddressesSection.state}}" userInput="Please select a region, state or province." stepKey="selectState"/>
60-
<click selector="{{AdminCustomerAddressesSection.saveAddress}}" stepKey="clickSaveCustomerAfterDeselectRegion"/>
61-
<waitForPageLoad stepKey="waitForPageToBeSaved"/>
48+
<!--Click on edit link for default billing address , remove the region-->
49+
<actionGroup ref="AdminClickEditLinkForDefaultBillingAddressActionGroup" stepKey="clickEditDefaultBillingAddressAgain"/>
50+
<actionGroup ref="AdminRemoveRegionFromCustomerAddressInformationActionGroup" stepKey="removeState"/>
6251

6352
<!--Verify state name not visible under address details section-->
64-
<dontSee userInput="{{Finland_Address.state}}" selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="dontSeeStateInAddress"/>
65-
66-
<!--Logout from admin-->
67-
<actionGroup ref="AdminClearCustomersFiltersActionGroup" stepKey="clearFilters"/>
68-
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
53+
<dontSee userInput="{{updateCustomerFranceAddress.state}}" selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="dontSeeStateInAddress"/>
6954

70-
<!--Log in to Storefront as First Customer -->
71-
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginFirstCustomer">
72-
<argument name="Customer" value="$$firstCustomer$$"/>
55+
<!--Log in to Storefront-->
56+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginCreateCustomer">
57+
<argument name="Customer" value="$createCustomer$"/>
7358
</actionGroup>
7459

75-
<!--Go to customer address book and click edit default billing address for storefront -->
60+
<!--Go to customer address book and click edit default shipping address for storefront-->
7661
<actionGroup ref="StorefrontGoToCustomerAddressesPageActionGroup" stepKey="goToCustomerAddressBook"/>
77-
<click stepKey="ClickEditDefaultBillingAddressForStorefront" selector="{{StorefrontCustomerAddressesSection.editDefaultBillingAddress}}"/>
78-
<waitForPageLoad stepKey="waitForStorefrontSignInPageLoad"/>
62+
<actionGroup ref="StoreFrontClickEditDefaultShippingAddressActionGroup" stepKey="clickEditDefaultShippingAddressForStorefront"/>
7963

80-
<!-- Select Region =Ahvenanmaa and click on save button-->
81-
<selectOption selector="{{StorefrontCustomerAddressFormSection.state}}" userInput="{{Finland_Address.state}}" stepKey="selectStateForStorefront"/>
64+
<!--Update the address-->
65+
<actionGroup ref="FillNewCustomerAddressRequiredFieldsActionGroup" stepKey="fillAddressForm">
66+
<argument name="address" value="updateCustomerFranceAddress"/>
67+
</actionGroup>
8268
<actionGroup ref="AdminSaveCustomerAddressActionGroup" stepKey="saveAddress"/>
8369

8470
<!--Verify state name in address details section-->
85-
<see selector="{{StorefrontCustomerAddressesSection.defaultShippingAddress}}" userInput="{{Finland_Address.state}}" stepKey="seeAssertCustomerDefaultShippingAddressState"/>
71+
<see selector="{{StorefrontCustomerAddressesSection.defaultShippingAddress}}" userInput="{{updateCustomerFranceAddress.state}}" stepKey="seeAssertCustomerDefaultShippingAddressState"/>
8672

87-
<!-- Click on edit link for default billing address , deselect region and click on save button-->
88-
<click stepKey="ClickEditDefaultBillingAddressForStorefrontAgain" selector="{{StorefrontCustomerAddressesSection.editDefaultBillingAddress}}"/>
89-
<waitForPageLoad stepKey="waitForStorefrontSignInPageLoad2"/>
90-
<selectOption selector="{{StorefrontCustomerAddressFormSection.state}}" userInput="Please select a region, state or province." stepKey="deselectStateForStorefront"/>
91-
<actionGroup ref="AdminSaveCustomerAddressActionGroup" stepKey="saveAddressAfterDeselectRegion"/>
73+
<!--Click on edit link for default shipping address , remove the region and click on save button-->
74+
<actionGroup ref="StoreFrontClickEditDefaultShippingAddressActionGroup" stepKey="clickEditDefaultShippingAddressForStorefrontAgain"/>
75+
<actionGroup ref="StorefrontRemoveRegionFromCustomerAddressFormActionGroup" stepKey="fillAddressFormWithoutRegion"/>
76+
<actionGroup ref="AdminSaveCustomerAddressActionGroup" stepKey="saveAddressAfterRemovingRegion"/>
77+
<waitForPageLoad stepKey="waitForPageToBeSavedAddressAfterRemovingRegion"/>
9278

9379
<!--Verify state name not visible under address details section-->
94-
<dontSee userInput="{{Finland_Address.state}}" selector="{{StorefrontCustomerAddressesSection.defaultShippingAddress}}" stepKey="dontSeeAssertCustomerDefaultShippingAddressState"/>
95-
80+
<dontSee userInput="{{updateCustomerFranceAddress.state}}" selector="{{StorefrontCustomerAddressesSection.defaultShippingAddress}}" stepKey="dontSeeAssertCustomerDefaultShippingAddressState"/>
9681
</test>
9782
</tests>

0 commit comments

Comments
 (0)