Skip to content

Commit 46e9eb8

Browse files
ENGCOM-6426: MFTF: Extract Action Groups to separate files - magento/module-customer #25828
2 parents 448bfd5 + df30bd2 commit 46e9eb8

File tree

43 files changed

+773
-402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+773
-402
lines changed
Lines changed: 20 additions & 0 deletions
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="AdminClearCustomersFiltersActionGroup">
12+
<annotations>
13+
<description>Goes to the Admin Customers grid page. Clicks on 'Clear Filters'.</description>
14+
</annotations>
15+
16+
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="amOnCustomersPage"/>
17+
<waitForPageLoad stepKey="WaitForPageToLoad"/>
18+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickOnButtonToRemoveFiltersIfPresent"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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="AdminCreateCustomerWithWebSiteAndGroupActionGroup">
12+
<annotations>
13+
<description>Goes to the Customer grid page. Click on 'Add New Customer'. Fills provided Customer Data. Fill provided Customer Address data. Assigns Product to Website and Store View. Clicks on Save.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="customerData" defaultValue="Simple_US_Customer"/>
17+
<argument name="website" type="string" defaultValue="{{_defaultWebsite.name}}"/>
18+
<argument name="storeView" type="string" defaultValue="{{_defaultStore.name}}"/>
19+
</arguments>
20+
21+
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="goToCustomersPage"/>
22+
<click stepKey="addNewCustomer" selector="{{AdminCustomerGridMainActionsSection.addNewCustomer}}"/>
23+
<selectOption stepKey="selectWebSite" selector="{{AdminCustomerAccountInformationSection.associateToWebsite}}" userInput="{{website}}"/>
24+
<selectOption selector="{{AdminCustomerAccountInformationSection.group}}" userInput="{{customerData.group}}" stepKey="selectCustomerGroup"/>
25+
<fillField stepKey="FillFirstName" selector="{{AdminCustomerAccountInformationSection.firstName}}" userInput="{{customerData.firstname}}"/>
26+
<fillField stepKey="FillLastName" selector="{{AdminCustomerAccountInformationSection.lastName}}" userInput="{{customerData.lastname}}"/>
27+
<fillField stepKey="FillEmail" selector="{{AdminCustomerAccountInformationSection.email}}" userInput="{{customerData.email}}"/>
28+
<selectOption stepKey="selectStoreView" selector="{{AdminCustomerAccountInformationSection.storeView}}" userInput="{{storeView}}"/>
29+
<waitForElement selector="{{AdminCustomerAccountInformationSection.storeView}}" stepKey="waitForCustomerStoreViewExpand"/>
30+
<click stepKey="save" selector="{{AdminCustomerAccountInformationSection.saveCustomer}}"/>
31+
<waitForPageLoad stepKey="waitForCustomersPage"/>
32+
<see stepKey="seeSuccessMessage" userInput="You saved the customer."/>
33+
</actionGroup>
34+
</actionGroups>

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -47,28 +47,4 @@
4747
<click stepKey="saveAddress" selector="{{AdminCustomerAddressesSection.saveAddress}}"/>
4848
<waitForPageLoad stepKey="waitForAddressSave"/>
4949
</actionGroup>
50-
51-
<actionGroup name="AdminCreateCustomerWithWebSiteAndGroup">
52-
<annotations>
53-
<description>Goes to the Customer grid page. Click on 'Add New Customer'. Fills provided Customer Data. Fill provided Customer Address data. Assigns Product to Website and Store View. Clicks on Save.</description>
54-
</annotations>
55-
<arguments>
56-
<argument name="customerData" defaultValue="Simple_US_Customer"/>
57-
<argument name="website" type="string" defaultValue="{{_defaultWebsite.name}}"/>
58-
<argument name="storeView" type="string" defaultValue="{{_defaultStore.name}}"/>
59-
</arguments>
60-
61-
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="goToCustomersPage"/>
62-
<click stepKey="addNewCustomer" selector="{{AdminCustomerGridMainActionsSection.addNewCustomer}}"/>
63-
<selectOption stepKey="selectWebSite" selector="{{AdminCustomerAccountInformationSection.associateToWebsite}}" userInput="{{website}}"/>
64-
<selectOption selector="{{AdminCustomerAccountInformationSection.group}}" userInput="{{customerData.group}}" stepKey="selectCustomerGroup"/>
65-
<fillField stepKey="FillFirstName" selector="{{AdminCustomerAccountInformationSection.firstName}}" userInput="{{customerData.firstname}}"/>
66-
<fillField stepKey="FillLastName" selector="{{AdminCustomerAccountInformationSection.lastName}}" userInput="{{customerData.lastname}}"/>
67-
<fillField stepKey="FillEmail" selector="{{AdminCustomerAccountInformationSection.email}}" userInput="{{customerData.email}}"/>
68-
<selectOption stepKey="selectStoreView" selector="{{AdminCustomerAccountInformationSection.storeView}}" userInput="{{storeView}}"/>
69-
<waitForElement selector="{{AdminCustomerAccountInformationSection.storeView}}" stepKey="waitForCustomerStoreViewExpand"/>
70-
<click stepKey="save" selector="{{AdminCustomerAccountInformationSection.saveCustomer}}"/>
71-
<waitForPageLoad stepKey="waitForCustomersPage"/>
72-
<see stepKey="seeSuccessMessage" userInput="You saved the customer."/>
73-
</actionGroup>
7450
</actionGroups>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11-
<actionGroup name="AdminEditCustomerAddressNoZipNoState" extends="AdminEditCustomerAddressesFrom">
11+
<actionGroup name="AdminEditCustomerAddressNoZipNoStateActionGroup" extends="AdminEditCustomerAddressesFromActionGroup">
1212
<annotations>
1313
<description>EXTENDS: AdminEditCustomerAddressesFrom. Removes 'selectState' and 'fillZipCode'. Clicks on 'Set Default' for Billing/Shipping.</description>
1414
</annotations>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11-
<actionGroup name="AdminEditCustomerAddressSetDefaultShippingAndBilling" extends="AdminEditCustomerAddressesFrom">
11+
<actionGroup name="AdminEditCustomerAddressSetDefaultShippingAndBillingActionGroup" extends="AdminEditCustomerAddressesFromActionGroup">
1212
<annotations>
1313
<description>EXTENDS: AdminEditCustomerAddressesFrom. Removes 'selectState' and 'fillZipCode'.</description>
1414
</annotations>

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

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<!-- Same as "EditCustomerAddressesFromAdminActionGroup" but taking country and state from input "customerAddress" -->
12-
<actionGroup name="AdminEditCustomerAddressesFrom">
12+
<actionGroup name="AdminEditCustomerAddressesFromActionGroup">
1313
<annotations>
1414
<description>Adds the provided Address to a Customer from the Admin Customers creation/edit page.</description>
1515
</annotations>
@@ -34,38 +34,4 @@
3434
<click selector="{{AdminEditCustomerAddressesSection.save}}" stepKey="saveAddress"/>
3535
<waitForPageLoad stepKey="waitForAddressSaved"/>
3636
</actionGroup>
37-
38-
<actionGroup name="AdminEditCustomerAddressSetDefaultShippingAndBilling" extends="AdminEditCustomerAddressesFrom">
39-
<annotations>
40-
<description>EXTENDS: AdminEditCustomerAddressesFrom. Clicks on 'Set Default' for Billing/Shipping.</description>
41-
</annotations>
42-
43-
<click selector="{{AdminEditCustomerAddressesSection.defaultBillingAddressButton}}" stepKey="setDefaultBilling" before="setDefaultShipping"/>
44-
<click selector="{{AdminEditCustomerAddressesSection.defaultShippingAddressButton}}" stepKey="setDefaultShipping" before="fillPrefixName"/>
45-
</actionGroup>
46-
47-
<actionGroup name="AdminEditCustomerAddressNoZipNoState" extends="AdminEditCustomerAddressesFrom">
48-
<annotations>
49-
<description>EXTENDS: AdminEditCustomerAddressesFrom. Removes 'selectState' and 'fillZipCode'. Clicks on 'Set Default' for Billing/Shipping.</description>
50-
</annotations>
51-
52-
<remove keyForRemoval="selectState"/>
53-
<remove keyForRemoval="fillZipCode"/>
54-
<click selector="{{AdminEditCustomerAddressesSection.defaultBillingAddressButton}}" stepKey="setDefaultBilling" before="setDefaultShipping"/>
55-
<click selector="{{AdminEditCustomerAddressesSection.defaultShippingAddressButton}}" stepKey="setDefaultShipping" before="fillPrefixName"/>
56-
</actionGroup>
57-
58-
<actionGroup name="SelectDropdownCustomerAddressAttributeValueActionGroup">
59-
<annotations>
60-
<description>Selects the provided Option in the provided Customer Address Attribute drop down menu. Clicks on Save.</description>
61-
</annotations>
62-
<arguments>
63-
<argument name="customerAddressAttribute"/>
64-
<argument name="optionValue" type="string"/>
65-
</arguments>
66-
67-
<selectOption selector="{{AdminEditCustomerAddressesSection.dropDownAttribute(customerAddressAttribute.code)}}" userInput="{{optionValue}}" stepKey="selectOptionValue"/>
68-
<click selector="{{AdminEditCustomerAddressesSection.save}}" stepKey="saveAddress"/>
69-
<waitForPageLoad stepKey="waitForAddressSaved"/>
70-
</actionGroup>
7137
</actionGroups>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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="AssertSignedUpNewsletterActionGroup">
12+
<annotations>
13+
<description>Validates that the provided Customer details are present and correct on the Storefront Customer Dashboard page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="customer" defaultValue="CustomerEntityOne"/>
17+
<argument name="storeName" defaultValue="Main Website" type="string"/>
18+
</arguments>
19+
20+
<see stepKey="successMessage" userInput="Thank you for registering with {{storeName}} Store." selector="{{AdminCustomerMessagesSection.successMessage}}"/>
21+
<see stepKey="seeFirstName" userInput="{{customer.firstname}}" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}"/>
22+
<see stepKey="seeLastName" userInput="{{customer.lastname}}" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}"/>
23+
<see stepKey="seeEmail" userInput="{{customer.email}}" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}"/>
24+
<seeInCurrentUrl url="{{StorefrontCustomerDashboardPage.url}}" stepKey="seeAssertInCurrentUrl"/>
25+
</actionGroup>
26+
</actionGroups>

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

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,29 +30,4 @@
3030
<waitForElementVisible stepKey="waitForSuccessfullyDeletedMessage" selector="{{CustomersPageSection.deletedSuccessMessage}}" time="10"/>
3131
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappear"/>
3232
</actionGroup>
33-
34-
<actionGroup name="DeleteCustomerByEmailActionGroup">
35-
<annotations>
36-
<description>Goes to the Admin Customers grid page. Deletes a Customer based on the provided Email Address.</description>
37-
</annotations>
38-
<arguments>
39-
<argument name="email" type="string"/>
40-
</arguments>
41-
42-
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomers"/>
43-
<waitForPageLoad stepKey="waitForAdminCustomerPageLoad"/>
44-
<click selector="{{AdminCustomerFiltersSection.filtersButton}}" stepKey="clickFilterButton"/>
45-
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="cleanFiltersIfTheySet"/>
46-
<waitForPageLoad stepKey="waitForClearFilters"/>
47-
<fillField selector="{{AdminCustomerFiltersSection.emailInput}}" userInput="{{email}}" stepKey="filterEmail"/>
48-
<click selector="{{AdminCustomerFiltersSection.apply}}" stepKey="applyFilter"/>
49-
<waitForPageLoad stepKey="waitForPageToLoad"/>
50-
<click selector="{{AdminCustomerGridSection.selectFirstRow}}" stepKey="clickOnEditButton1"/>
51-
<click selector="{{CustomersPageSection.actions}}" stepKey="clickActionsDropdown"/>
52-
<click selector="{{CustomersPageSection.delete}}" stepKey="clickDelete"/>
53-
<waitForElementVisible selector="{{CustomersPageSection.ok}}" stepKey="waitForOkToVisible"/>
54-
<click selector="{{CustomersPageSection.ok}}" stepKey="clickOkConfirmationButton"/>
55-
<waitForElementVisible stepKey="waitForSuccessfullyDeletedMessage" selector="{{CustomersPageSection.deletedSuccessMessage}}" time="10"/>
56-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappear"/>
57-
</actionGroup>
5833
</actionGroups>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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="DeleteCustomerByEmailActionGroup">
12+
<annotations>
13+
<description>Goes to the Admin Customers grid page. Deletes a Customer based on the provided Email Address.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="email" type="string"/>
17+
</arguments>
18+
19+
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomers"/>
20+
<waitForPageLoad stepKey="waitForAdminCustomerPageLoad"/>
21+
<click selector="{{AdminCustomerFiltersSection.filtersButton}}" stepKey="clickFilterButton"/>
22+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="cleanFiltersIfTheySet"/>
23+
<waitForPageLoad stepKey="waitForClearFilters"/>
24+
<fillField selector="{{AdminCustomerFiltersSection.emailInput}}" userInput="{{email}}" stepKey="filterEmail"/>
25+
<click selector="{{AdminCustomerFiltersSection.apply}}" stepKey="applyFilter"/>
26+
<waitForPageLoad stepKey="waitForPageToLoad"/>
27+
<click selector="{{AdminCustomerGridSection.selectFirstRow}}" stepKey="clickOnEditButton1"/>
28+
<click selector="{{CustomersPageSection.actions}}" stepKey="clickActionsDropdown"/>
29+
<click selector="{{CustomersPageSection.delete}}" stepKey="clickDelete"/>
30+
<waitForElementVisible selector="{{CustomersPageSection.ok}}" stepKey="waitForOkToVisible"/>
31+
<click selector="{{CustomersPageSection.ok}}" stepKey="clickOkConfirmationButton"/>
32+
<waitForElementVisible stepKey="waitForSuccessfullyDeletedMessage" selector="{{CustomersPageSection.deletedSuccessMessage}}" time="30"/>
33+
</actionGroup>
34+
</actionGroups>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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="DeleteCustomerFromAdminActionGroup">
12+
<annotations>
13+
<description>Goes to the Admin Customers grid page. Deletes the provided Customer from the grid. Validates that the Success message is present and correct.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="customer" defaultValue="CustomerEntityOne"/>
17+
</arguments>
18+
19+
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomers"/>
20+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickOnButtonToRemoveFiltersIfPresent"/>
21+
<fillField selector="{{AdminDataGridHeaderSection.search}}" userInput="{{customer.email}}" stepKey="fillSearch"/>
22+
<click selector="{{AdminDataGridHeaderSection.submitSearch}}" stepKey="clickSubmit"/>
23+
<waitForAjaxLoad stepKey="waitForLoadAjax"/>
24+
<click selector="{{AdminCustomerGridMainActionsSection.multicheck}}" stepKey="selectAll"/>
25+
<click selector="{{AdminCustomerGridMainActionsSection.actions}}" stepKey="clickActions"/>
26+
<click selector="{{AdminCustomerGridMainActionsSection.delete}}" stepKey="clickDelete"/>
27+
<waitForAjaxLoad stepKey="waitForLoadConfirmation"/>
28+
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/>
29+
<see selector="{{AdminMessagesSection.success}}" userInput="A total of 1 record(s) were deleted" stepKey="seeSuccess"/>
30+
</actionGroup>
31+
</actionGroups>

0 commit comments

Comments
 (0)