Skip to content

Commit bed9d09

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-99302' into 2.3-develop-pr24
2 parents aaaa23d + e0d5567 commit bed9d09

File tree

4 files changed

+77
-6
lines changed

4 files changed

+77
-6
lines changed

app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCreateCustomerWithWebsiteAndStoreViewActionGroup.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,13 @@
4646
<actionGroup name="AdminCreateCustomerWithWebSiteAndGroup">
4747
<arguments>
4848
<argument name="customerData" defaultValue="Simple_US_Customer"/>
49-
<argument name="website" type="string" defaultValue="customWebsite"/>
50-
<argument name="storeView" type="string" defaultValue="customStore"/>
49+
<argument name="website" type="string" defaultValue="{{_defaultWebsite.name}}"/>
50+
<argument name="storeView" type="string" defaultValue="{{_defaultStore.name}}"/>
5151
</arguments>
5252
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="goToCustomersPage"/>
5353
<click stepKey="addNewCustomer" selector="{{AdminCustomerGridMainActionsSection.addNewCustomer}}"/>
5454
<selectOption stepKey="selectWebSite" selector="{{AdminCustomerAccountInformationSection.associateToWebsite}}" userInput="{{website}}"/>
55-
<click selector="{{AdminCustomerAccountInformationSection.group}}" stepKey="ClickToExpandGroup"/>
56-
<waitForElement selector="{{AdminProductFormAdvancedPricingSection.productTierPriceGroupOrCatalogOption('Default (General)')}}" stepKey="waitForCustomerGroupExpand"/>
57-
<click selector="{{AdminCustomerAccountInformationSection.groupValue('Default (General)')}}" after="waitForCustomerGroupExpand" stepKey="ClickToSelectGroup"/>
55+
<selectOption selector="{{AdminCustomerAccountInformationSection.group}}" userInput="{{customerData.group}}" stepKey="selectCustomerGroup"/>
5856
<fillField stepKey="FillFirstName" selector="{{AdminCustomerAccountInformationSection.firstName}}" userInput="{{customerData.firstname}}"/>
5957
<fillField stepKey="FillLastName" selector="{{AdminCustomerAccountInformationSection.lastName}}" userInput="{{customerData.lastname}}"/>
6058
<fillField stepKey="FillEmail" selector="{{AdminCustomerAccountInformationSection.email}}" userInput="{{customerData.email}}"/>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<data key="password">pwdTest123!</data>
4545
<data key="store_id">0</data>
4646
<data key="website_id">0</data>
47+
<data key="group">General</data>
4748
<requiredEntity type="address">US_Address_TX</requiredEntity>
4849
</entity>
4950
<entity name="SimpleUsCustomerWithNewCustomerGroup" type="customer">
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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="AdminVerifyCustomerAddressStateContainValuesOnceTest">
12+
<annotations>
13+
<features value="Customer"/>
14+
<stories value="Update Customer Address"/>
15+
<title value="State/Province dropdown contain values once"/>
16+
<description value="When editing a customer in the backend from the Magento Admin Panel the State/Province should only be listed once"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MAGETWO-99461"/>
19+
<useCaseId value="MAGETWO-99302"/>
20+
<group value="customer"/>
21+
</annotations>
22+
<before>
23+
<createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="firstCustomer"/>
24+
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
25+
</before>
26+
<after>
27+
<deleteData createDataKey="firstCustomer" stepKey="deleteFirstCustomer"/>
28+
<actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteSecondCustomer">
29+
<argument name="customerEmail" value="Simple_US_Customer.email"/>
30+
</actionGroup>
31+
<actionGroup ref="AdminClearCustomersFiltersActionGroup" stepKey="clearFilters"/>
32+
<actionGroup ref="logout" stepKey="logout"/>
33+
</after>
34+
35+
<!-- Go to Customers > All Customers.-->
36+
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/>
37+
38+
<!--Select created customer, Click Edit mode-->
39+
<actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="openEditCustomerPageWithAddresses">
40+
<argument name="customer" value="$$firstCustomer$$"/>
41+
</actionGroup>
42+
43+
<!--Select Addresses tab-->
44+
<click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTabOfFirstCustomer"/>
45+
<waitForPageLoad stepKey="waitForAddressesOfFirstCustomer"/>
46+
47+
<!--Click on Edit link for Default Billing Address-->
48+
<click selector="{{AdminCustomerAddressesDefaultBillingSection.editButton}}" stepKey="clickEditDefaultBillingAddress"/>
49+
<waitForPageLoad stepKey="waitForCustomerAddressAddUpdateFormLoad"/>
50+
51+
<!--Check that State/Province drop down contain all values once-->
52+
<seeNumberOfElements userInput="1" selector="{{AdminCustomerAddressesSection.regionId(US_Address_NY.state)}}" stepKey="seeOnlyOneRegionInSelectStateForFirstCustomer"/>
53+
54+
<!--Go to Customers > All customers, Click Add new Customers, fill all necessary fields, Save-->
55+
<actionGroup ref="AdminCreateCustomerWithWebSiteAndGroup" stepKey="createSimpleUSCustomerWithoutAddress"/>
56+
57+
<!--Select new created customer, Click Edit mode-->
58+
<actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="openEditCustomerPageWithoutAddresses">
59+
<argument name="customer" value="Simple_US_Customer"/>
60+
</actionGroup>
61+
62+
<!--Select Addresses tab, Click on create new addresses btn-->
63+
<click selector="{{AdminEditCustomerInformationSection.addresses}}" stepKey="openAddressesTabOfSecondCustomer"/>
64+
<waitForPageLoad stepKey="waitForAddressesOfSecondCustomer"/>
65+
<click selector="{{AdminCustomerAddressesSection.addNewAddress}}" stepKey="clickAddNewAddressButton"/>
66+
<waitForPageLoad stepKey="waitForAddUpdateCustomerAddressForm"/>
67+
68+
<!--Select Country = United States and check that State/Province drop down contain all values once-->
69+
<click selector="{{AdminCustomerAddressesSection.country}}" stepKey="clickCountryToOpenListOfCountries"/>
70+
<click selector="{{AdminCustomerAddressesSection.countryId(US_Address_NY.country_id)}}" stepKey="fillCountry"/>
71+
<seeNumberOfElements userInput="1" selector="{{AdminCustomerAddressesSection.regionId(US_Address_NY.state)}}" stepKey="seeOnlyOneRegionInSelectStateForSecondCustomer"/>
72+
</test>
73+
</tests>

app/code/Magento/Customer/view/adminhtml/ui_component/customer_address_form.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@
215215
<target>${ $.provider }:${ $.parentScope }.country_id</target>
216216
</filterBy>
217217
<customEntry>region</customEntry>
218-
<options class="Magento\Directory\Model\ResourceModel\Region\Collection"/>
219218
</settings>
220219
</select>
221220
</formElements>

0 commit comments

Comments
 (0)