Skip to content

Commit 6513b14

Browse files
authored
ENGCOM-9251: [MFTF] AdminAddNewDefaultBillingShippingCustomerAddressTest refactoring #33999
2 parents 781e2f1 + 37f3e52 commit 6513b14

11 files changed

+257
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="AdminAssertCustomerDefaultBillingAddressAgainstEntityActionGroup">
12+
<annotations>
13+
<description>Asserts that Customer's Default Billing Address matches the specified Address entity</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="address" type="entity"/>
17+
</arguments>
18+
19+
<see userInput="{{address.firstname}}" selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="firstName"/>
20+
<see userInput="{{address.lastname}}" selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="lastName"/>
21+
<see userInput="{{address.street[0]}}" selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="street1"/>
22+
<see userInput="{{address.state}}" selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="state"/>
23+
<see userInput="{{address.postcode}}" selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="postcode"/>
24+
<see userInput="{{address.country}}" selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="country"/>
25+
<see userInput="{{address.telephone}}" selector="{{AdminCustomerAddressesDefaultBillingSection.addressDetails}}" stepKey="telephone"/>
26+
</actionGroup>
27+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="AdminAssertCustomerDefaultShippingAddressAgainstEntityActionGroup">
12+
<annotations>
13+
<description>Asserts that Customer's Default Shipping Address matches the specified Address entity</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="address" type="entity"/>
17+
</arguments>
18+
19+
<see userInput="{{address.firstname}}" selector="{{AdminCustomerAddressesDefaultShippingSection.addressDetails}}" stepKey="firstName"/>
20+
<see userInput="{{address.lastname}}" selector="{{AdminCustomerAddressesDefaultShippingSection.addressDetails}}" stepKey="lastName"/>
21+
<see userInput="{{address.street[0]}}" selector="{{AdminCustomerAddressesDefaultShippingSection.addressDetails}}" stepKey="street1"/>
22+
<see userInput="{{address.state}}" selector="{{AdminCustomerAddressesDefaultShippingSection.addressDetails}}" stepKey="state"/>
23+
<see userInput="{{address.postcode}}" selector="{{AdminCustomerAddressesDefaultShippingSection.addressDetails}}" stepKey="postcode"/>
24+
<see userInput="{{address.country}}" selector="{{AdminCustomerAddressesDefaultShippingSection.addressDetails}}" stepKey="country"/>
25+
<see userInput="{{address.telephone}}" selector="{{AdminCustomerAddressesDefaultShippingSection.addressDetails}}" stepKey="telephone"/>
26+
</actionGroup>
27+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="AdminAssertDefaultBillingAddressToggleIsOnOnAddUpdateAddressPageActionGroup">
12+
<annotations>
13+
<description>Asserts that the "Default Billing Address" toggle is On on the Add/Update Address Sliding Tab of Customer Edit Page </description>
14+
</annotations>
15+
16+
<assertElementContainsAttribute stepKey="assertDefaultBillingIsEnabledOnAddUpdateAddressTab">
17+
<expectedResult selector="{{AdminCustomerAddressesSection.defaultBillingAddressCheckBox}}" attribute="value" type="string">1</expectedResult>
18+
</assertElementContainsAttribute>
19+
</actionGroup>
20+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="AdminAssertDefaultShippingAddressToggleIsOnOnAddUpdateAddressPageActionGroup">
12+
<annotations>
13+
<description>Asserts that the "Default Shipping Address" toggle is On on the Add/Update Address Sliding Tab of Customer Edit Page </description>
14+
</annotations>
15+
16+
<assertElementContainsAttribute stepKey="assertDefaultShippingIsEnabledOnAddUpdateAddressTab">
17+
<expectedResult selector="{{AdminCustomerAddressesSection.defaultShippingAddressCheckBox}}" attribute="value" type="string">1</expectedResult>
18+
</assertElementContainsAttribute>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!--
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
9+
<actionGroup name="AdminClickAddNewAddressButtonOnCustomerAddressesTabActionGroup">
10+
<annotations>
11+
<description>Clicks the "Add New Address" button on the Customer->Addresses Tab.</description>
12+
</annotations>
13+
14+
<click selector="{{AdminCustomerAddressesSection.addNewAddress}}" stepKey="clickAddNewAddressButton"/>
15+
<waitForPageLoad stepKey="waitForAddUpdateCustomerAddressForm"/>
16+
</actionGroup>
17+
</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="AdminClickDefaultBillingAddressToggleOnAddUpdateAddressPageActionGroup">
12+
<annotations>
13+
<description>Clicks the "Default Billing Address" toggle on the Add/Update Address Sliding Tab of Customer Edit Page </description>
14+
</annotations>
15+
16+
<click selector="{{AdminCustomerAddressesSection.defaultBillingAddress}}" stepKey="clickDefaultBillingAddressToggle"/>
17+
</actionGroup>
18+
</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="AdminClickDefaultShippingAddressToggleOnAddUpdateAddressPageActionGroup">
12+
<annotations>
13+
<description>Clicks the "Default Shipping Address" toggle on the Add/Update Address Sliding Tab of Customer Edit Page </description>
14+
</annotations>
15+
16+
<click selector="{{AdminCustomerAddressesSection.defaultShippingAddress}}" stepKey="clickDefaultShippingAddressToggle"/>
17+
</actionGroup>
18+
</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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminClickEditLinkForDefaultBillingAddressActionGroup">
11+
<annotations>
12+
<description>Clicks the Edit link for Default Billing Address.</description>
13+
</annotations>
14+
15+
<click selector="{{AdminCustomerAddressesDefaultBillingSection.editButton}}" stepKey="clickEditDefaultBillingAddress"/>
16+
<waitForPageLoad stepKey="waitForFormToLoad"/>
17+
</actionGroup>
18+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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="AdminFillAndSaveCustomerAddressInformationActionGroup">
12+
<annotations>
13+
<description>Fills and Saves Customer Address information.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="address" type="entity"/>
17+
</arguments>
18+
19+
<fillField userInput="{{address.firstname}}" selector="{{AdminCustomerAddressesSection.firstNameForAddress}}" stepKey="fillFirstName"/>
20+
<fillField userInput="{{address.lastname}}" selector="{{AdminCustomerAddressesSection.lastNameForAddress}}" stepKey="fillLastName"/>
21+
<fillField userInput="{{address.company}}" selector="{{AdminCustomerAddressesSection.company}}" stepKey="fillCompany"/>
22+
<fillField userInput="{{address.street[0]}}" selector="{{AdminCustomerAddressesSection.streetAddress}}" stepKey="fillStreet"/>
23+
<fillField userInput="{{address.city}}" selector="{{AdminCustomerAddressesSection.city}}" stepKey="fillCity"/>
24+
<click selector="{{AdminCustomerAddressesSection.country}}" stepKey="clickCountryToOpenListOfCountries"/>
25+
<click selector="{{AdminCustomerAddressesSection.countryId(address.country_id)}}" stepKey="fillCountry"/>
26+
<fillField userInput="{{address.postcode}}" selector="{{AdminCustomerAddressesSection.zip}}" stepKey="fillPostcode"/>
27+
<fillField userInput="{{address.telephone}}" selector="{{AdminCustomerAddressesSection.phoneNumber}}" stepKey="fillTelephone"/>
28+
<click selector="{{AdminCustomerAddressesSection.region}}" stepKey="clickRegionToOpenListOfRegions"/>
29+
<click selector="{{AdminCustomerAddressesSection.regionId(address.state)}}" stepKey="fillRegion"/>
30+
<click selector="{{AdminCustomerAddressesSection.saveAddress}}" stepKey="clickSaveCustomerAddressOnAddUpdateAddressForm"/>
31+
<waitForPageLoad stepKey="waitForNewAddressIsCreated"/>
32+
</actionGroup>
33+
</actionGroups>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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="AdminAddNewDefaultBillingAndShippingCustomerAddressTest">
12+
<annotations>
13+
<stories value="Add new default billing/shipping customer address"/>
14+
<title value="Add new default billing/shipping customer address"/>
15+
<description value="Add new default billing/shipping customer address on customer addresses tab"/>
16+
<severity value="BLOCKER"/>
17+
<testCaseId value="MAGETWO-94814"/>
18+
<group value="customer"/>
19+
</annotations>
20+
<before>
21+
<createData entity="Simple_US_Customer_Multiple_Addresses_No_Default_Address" stepKey="customer"/>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
23+
</before>
24+
<after>
25+
<deleteData createDataKey="customer" stepKey="deleteCustomer"/>
26+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
27+
</after>
28+
29+
<actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="goToCustomerEditPage">
30+
<argument name="customerId" value="$customer.id$"/>
31+
</actionGroup>
32+
<actionGroup ref="AdminOpenAddressesTabFromCustomerEditPageActionGroup" stepKey="openAddressesTab"/>
33+
34+
<actionGroup ref="AdminAssertCustomerNoDefaultBillingAddress" stepKey="seeDefaultBillingAddressSectionBeforeChangingDefaultAddress"/>
35+
<actionGroup ref="AdminAssertCustomerNoDefaultShippingAddress" stepKey="seeDefaultShippingAddressSectionBeforeChangingDefaultAddress"/>
36+
37+
<actionGroup ref="AdminClickAddNewAddressButtonOnCustomerAddressesTabActionGroup" stepKey="clickAddNewAddressButton"/>
38+
<actionGroup ref="AdminClickDefaultBillingAddressToggleOnAddUpdateAddressPageActionGroup" stepKey="enableDefaultBillingAddress"/>
39+
<actionGroup ref="AdminClickDefaultShippingAddressToggleOnAddUpdateAddressPageActionGroup" stepKey="enableDefaultShippingAddress"/>
40+
<actionGroup ref="AdminFillAndSaveCustomerAddressInformationActionGroup" stepKey="fillAndSaveCustomerAddressInformationActionGroup">
41+
<argument name="address" value="US_Address_TX"/>
42+
</actionGroup>
43+
44+
<actionGroup ref="AdminAssertCustomerDefaultBillingAddressAgainstEntityActionGroup" stepKey="assertDefaultBillingAddressIsChanged">
45+
<argument name="address" value="US_Address_TX"/>
46+
</actionGroup>
47+
<actionGroup ref="AdminAssertCustomerDefaultShippingAddressAgainstEntityActionGroup" stepKey="assertDefaultShippingAddressIsChanged">
48+
<argument name="address" value="US_Address_TX"/>
49+
</actionGroup>
50+
51+
<actionGroup ref="AdminClickEditLinkForDefaultBillingAddressActionGroup" stepKey="clickEditDefaultBillingAddress"/>
52+
<actionGroup ref="AdminAssertDefaultShippingAddressToggleIsOnOnAddUpdateAddressPageActionGroup" stepKey="assertDefaultBillingIsEnabledCustomerAddressAddUpdateForm"/>
53+
<actionGroup ref="AdminAssertDefaultShippingAddressToggleIsOnOnAddUpdateAddressPageActionGroup" stepKey="assertDefaultShippingIsEnabledCustomerAddressAddUpdateForm"/>
54+
</test>
55+
</tests>

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@
1111
<test name="AdminAddNewDefaultBillingShippingCustomerAddressTest">
1212
<annotations>
1313
<stories value="Add new default billing/shipping customer address"/>
14-
<title value="Add new default billing/shipping customer address"/>
14+
<title value="DEPRECATED. Add new default billing/shipping customer address"/>
1515
<description value="Add new default billing/shipping customer address on customer addresses tab"/>
1616
<severity value="BLOCKER"/>
1717
<testCaseId value="MAGETWO-94814"/>
1818
<group value="customer"/>
19+
<skip>
20+
<issueId value="DEPRECATED">Use AdminAddNewDefaultBillingAndShippingCustomerAddressTest instead</issueId>
21+
</skip>
1922
</annotations>
2023
<before>
2124
<createData entity="Simple_US_Customer_Multiple_Addresses_No_Default_Address" stepKey="customer"/>

0 commit comments

Comments
 (0)