Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MFTF: Extract Action Groups to separate files - magento/module-customer #25828

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminClearCustomersFiltersActionGroup">
<annotations>
<description>Goes to the Admin Customers grid page. Clicks on 'Clear Filters'.</description>
</annotations>

<amOnPage url="{{AdminCustomerPage.url}}" stepKey="amOnCustomersPage"/>
<waitForPageLoad stepKey="WaitForPageToLoad"/>
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickOnButtonToRemoveFiltersIfPresent"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminCreateCustomerWithWebSiteAndGroupActionGroup">
<annotations>
<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>
</annotations>
<arguments>
<argument name="customerData" defaultValue="Simple_US_Customer"/>
<argument name="website" type="string" defaultValue="{{_defaultWebsite.name}}"/>
<argument name="storeView" type="string" defaultValue="{{_defaultStore.name}}"/>
</arguments>

<amOnPage url="{{AdminCustomerPage.url}}" stepKey="goToCustomersPage"/>
<click stepKey="addNewCustomer" selector="{{AdminCustomerGridMainActionsSection.addNewCustomer}}"/>
<selectOption stepKey="selectWebSite" selector="{{AdminCustomerAccountInformationSection.associateToWebsite}}" userInput="{{website}}"/>
<selectOption selector="{{AdminCustomerAccountInformationSection.group}}" userInput="{{customerData.group}}" stepKey="selectCustomerGroup"/>
<fillField stepKey="FillFirstName" selector="{{AdminCustomerAccountInformationSection.firstName}}" userInput="{{customerData.firstname}}"/>
<fillField stepKey="FillLastName" selector="{{AdminCustomerAccountInformationSection.lastName}}" userInput="{{customerData.lastname}}"/>
<fillField stepKey="FillEmail" selector="{{AdminCustomerAccountInformationSection.email}}" userInput="{{customerData.email}}"/>
<selectOption stepKey="selectStoreView" selector="{{AdminCustomerAccountInformationSection.storeView}}" userInput="{{storeView}}"/>
<waitForElement selector="{{AdminCustomerAccountInformationSection.storeView}}" stepKey="waitForCustomerStoreViewExpand"/>
<click stepKey="save" selector="{{AdminCustomerAccountInformationSection.saveCustomer}}"/>
<waitForPageLoad stepKey="waitForCustomersPage"/>
<see stepKey="seeSuccessMessage" userInput="You saved the customer."/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,4 @@
<click stepKey="saveAddress" selector="{{AdminCustomerAddressesSection.saveAddress}}"/>
<waitForPageLoad stepKey="waitForAddressSave"/>
</actionGroup>

<actionGroup name="AdminCreateCustomerWithWebSiteAndGroup">
<annotations>
<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>
</annotations>
<arguments>
<argument name="customerData" defaultValue="Simple_US_Customer"/>
<argument name="website" type="string" defaultValue="{{_defaultWebsite.name}}"/>
<argument name="storeView" type="string" defaultValue="{{_defaultStore.name}}"/>
</arguments>

<amOnPage url="{{AdminCustomerPage.url}}" stepKey="goToCustomersPage"/>
<click stepKey="addNewCustomer" selector="{{AdminCustomerGridMainActionsSection.addNewCustomer}}"/>
<selectOption stepKey="selectWebSite" selector="{{AdminCustomerAccountInformationSection.associateToWebsite}}" userInput="{{website}}"/>
<selectOption selector="{{AdminCustomerAccountInformationSection.group}}" userInput="{{customerData.group}}" stepKey="selectCustomerGroup"/>
<fillField stepKey="FillFirstName" selector="{{AdminCustomerAccountInformationSection.firstName}}" userInput="{{customerData.firstname}}"/>
<fillField stepKey="FillLastName" selector="{{AdminCustomerAccountInformationSection.lastName}}" userInput="{{customerData.lastname}}"/>
<fillField stepKey="FillEmail" selector="{{AdminCustomerAccountInformationSection.email}}" userInput="{{customerData.email}}"/>
<selectOption stepKey="selectStoreView" selector="{{AdminCustomerAccountInformationSection.storeView}}" userInput="{{storeView}}"/>
<waitForElement selector="{{AdminCustomerAccountInformationSection.storeView}}" stepKey="waitForCustomerStoreViewExpand"/>
<click stepKey="save" selector="{{AdminCustomerAccountInformationSection.saveCustomer}}"/>
<waitForPageLoad stepKey="waitForCustomersPage"/>
<see stepKey="seeSuccessMessage" userInput="You saved the customer."/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminEditCustomerAddressNoZipNoState" extends="AdminEditCustomerAddressesFrom">
<actionGroup name="AdminEditCustomerAddressNoZipNoStateActionGroup" extends="AdminEditCustomerAddressesFromActionGroup">
<annotations>
<description>EXTENDS: AdminEditCustomerAddressesFrom. Removes 'selectState' and 'fillZipCode'. Clicks on 'Set Default' for Billing/Shipping.</description>
</annotations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminEditCustomerAddressSetDefaultShippingAndBilling" extends="AdminEditCustomerAddressesFrom">
<actionGroup name="AdminEditCustomerAddressSetDefaultShippingAndBillingActionGroup" extends="AdminEditCustomerAddressesFromActionGroup">
<annotations>
<description>EXTENDS: AdminEditCustomerAddressesFrom. Removes 'selectState' and 'fillZipCode'.</description>
</annotations>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<!-- Same as "EditCustomerAddressesFromAdminActionGroup" but taking country and state from input "customerAddress" -->
<actionGroup name="AdminEditCustomerAddressesFrom">
<actionGroup name="AdminEditCustomerAddressesFromActionGroup">
<annotations>
<description>Adds the provided Address to a Customer from the Admin Customers creation/edit page.</description>
</annotations>
Expand All @@ -34,38 +34,4 @@
<click selector="{{AdminEditCustomerAddressesSection.save}}" stepKey="saveAddress"/>
<waitForPageLoad stepKey="waitForAddressSaved"/>
</actionGroup>

<actionGroup name="AdminEditCustomerAddressSetDefaultShippingAndBilling" extends="AdminEditCustomerAddressesFrom">
<annotations>
<description>EXTENDS: AdminEditCustomerAddressesFrom. Clicks on 'Set Default' for Billing/Shipping.</description>
</annotations>

<click selector="{{AdminEditCustomerAddressesSection.defaultBillingAddressButton}}" stepKey="setDefaultBilling" before="setDefaultShipping"/>
<click selector="{{AdminEditCustomerAddressesSection.defaultShippingAddressButton}}" stepKey="setDefaultShipping" before="fillPrefixName"/>
</actionGroup>

<actionGroup name="AdminEditCustomerAddressNoZipNoState" extends="AdminEditCustomerAddressesFrom">
<annotations>
<description>EXTENDS: AdminEditCustomerAddressesFrom. Removes 'selectState' and 'fillZipCode'. Clicks on 'Set Default' for Billing/Shipping.</description>
</annotations>

<remove keyForRemoval="selectState"/>
<remove keyForRemoval="fillZipCode"/>
<click selector="{{AdminEditCustomerAddressesSection.defaultBillingAddressButton}}" stepKey="setDefaultBilling" before="setDefaultShipping"/>
<click selector="{{AdminEditCustomerAddressesSection.defaultShippingAddressButton}}" stepKey="setDefaultShipping" before="fillPrefixName"/>
</actionGroup>

<actionGroup name="SelectDropdownCustomerAddressAttributeValueActionGroup">
<annotations>
<description>Selects the provided Option in the provided Customer Address Attribute drop down menu. Clicks on Save.</description>
</annotations>
<arguments>
<argument name="customerAddressAttribute"/>
<argument name="optionValue" type="string"/>
</arguments>

<selectOption selector="{{AdminEditCustomerAddressesSection.dropDownAttribute(customerAddressAttribute.code)}}" userInput="{{optionValue}}" stepKey="selectOptionValue"/>
<click selector="{{AdminEditCustomerAddressesSection.save}}" stepKey="saveAddress"/>
<waitForPageLoad stepKey="waitForAddressSaved"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertSignedUpNewsletterActionGroup">
<annotations>
<description>Validates that the provided Customer details are present and correct on the Storefront Customer Dashboard page.</description>
</annotations>
<arguments>
<argument name="customer" defaultValue="CustomerEntityOne"/>
<argument name="storeName" defaultValue="Main Website" type="string"/>
</arguments>

<see stepKey="successMessage" userInput="Thank you for registering with {{storeName}} Store." selector="{{AdminCustomerMessagesSection.successMessage}}"/>
<see stepKey="seeFirstName" userInput="{{customer.firstname}}" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}"/>
<see stepKey="seeLastName" userInput="{{customer.lastname}}" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}"/>
<see stepKey="seeEmail" userInput="{{customer.email}}" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}"/>
<seeInCurrentUrl url="{{StorefrontCustomerDashboardPage.url}}" stepKey="seeAssertInCurrentUrl"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<arguments>
<argument name="lastName" defaultValue=""/>
</arguments>

<!--Clear filter if exist-->
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomers"/>
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingCustomerFilters"/>
Expand All @@ -29,28 +29,4 @@
<click stepKey="clickOnOk" selector="{{CustomersPageSection.ok}}"/>
<waitForElementVisible stepKey="waitForSuccessfullyDeletedMessage" selector="{{CustomersPageSection.deletedSuccessMessage}}" time="10"/>
</actionGroup>

<actionGroup name="DeleteCustomerByEmailActionGroup">
<annotations>
<description>Goes to the Admin Customers grid page. Deletes a Customer based on the provided Email Address.</description>
</annotations>
<arguments>
<argument name="email" type="string"/>
</arguments>

<amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomers"/>
<waitForPageLoad stepKey="waitForAdminCustomerPageLoad"/>
<click selector="{{AdminCustomerFiltersSection.filtersButton}}" stepKey="clickFilterButton"/>
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="cleanFiltersIfTheySet"/>
<waitForPageLoad stepKey="waitForClearFilters"/>
<fillField selector="{{AdminCustomerFiltersSection.emailInput}}" userInput="{{email}}" stepKey="filterEmail"/>
<click selector="{{AdminCustomerFiltersSection.apply}}" stepKey="applyFilter"/>
<waitForPageLoad stepKey="waitForPageToLoad"/>
<click selector="{{AdminCustomerGridSection.selectFirstRow}}" stepKey="clickOnEditButton1"/>
<click selector="{{CustomersPageSection.actions}}" stepKey="clickActionsDropdown"/>
<click selector="{{CustomersPageSection.delete}}" stepKey="clickDelete"/>
<waitForElementVisible selector="{{CustomersPageSection.ok}}" stepKey="waitForOkToVisible"/>
<click selector="{{CustomersPageSection.ok}}" stepKey="clickOkConfirmationButton"/>
<waitForElementVisible stepKey="waitForSuccessfullyDeletedMessage" selector="{{CustomersPageSection.deletedSuccessMessage}}" time="30"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="DeleteCustomerByEmailActionGroup">
<annotations>
<description>Goes to the Admin Customers grid page. Deletes a Customer based on the provided Email Address.</description>
</annotations>
<arguments>
<argument name="email" type="string"/>
</arguments>

<amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomers"/>
<waitForPageLoad stepKey="waitForAdminCustomerPageLoad"/>
<click selector="{{AdminCustomerFiltersSection.filtersButton}}" stepKey="clickFilterButton"/>
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="cleanFiltersIfTheySet"/>
<waitForPageLoad stepKey="waitForClearFilters"/>
<fillField selector="{{AdminCustomerFiltersSection.emailInput}}" userInput="{{email}}" stepKey="filterEmail"/>
<click selector="{{AdminCustomerFiltersSection.apply}}" stepKey="applyFilter"/>
<waitForPageLoad stepKey="waitForPageToLoad"/>
<click selector="{{AdminCustomerGridSection.selectFirstRow}}" stepKey="clickOnEditButton1"/>
<click selector="{{CustomersPageSection.actions}}" stepKey="clickActionsDropdown"/>
<click selector="{{CustomersPageSection.delete}}" stepKey="clickDelete"/>
<waitForElementVisible selector="{{CustomersPageSection.ok}}" stepKey="waitForOkToVisible"/>
<click selector="{{CustomersPageSection.ok}}" stepKey="clickOkConfirmationButton"/>
<waitForElementVisible stepKey="waitForSuccessfullyDeletedMessage" selector="{{CustomersPageSection.deletedSuccessMessage}}" time="30"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="DeleteCustomerFromAdminActionGroup">
<annotations>
<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>
</annotations>
<arguments>
<argument name="customer" defaultValue="CustomerEntityOne"/>
</arguments>

<amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomers"/>
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickOnButtonToRemoveFiltersIfPresent"/>
<fillField selector="{{AdminDataGridHeaderSection.search}}" userInput="{{customer.email}}" stepKey="fillSearch"/>
<click selector="{{AdminDataGridHeaderSection.submitSearch}}" stepKey="clickSubmit"/>
<waitForAjaxLoad stepKey="waitForLoadAjax"/>
<click selector="{{AdminCustomerGridMainActionsSection.multicheck}}" stepKey="selectAll"/>
<click selector="{{AdminCustomerGridMainActionsSection.actions}}" stepKey="clickActions"/>
<click selector="{{AdminCustomerGridMainActionsSection.delete}}" stepKey="clickDelete"/>
<waitForAjaxLoad stepKey="waitForLoadConfirmation"/>
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/>
<see selector="{{AdminMessagesSection.success}}" userInput="A total of 1 record(s) were deleted" stepKey="seeSuccess"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="EnterCustomerAddressInfoActionGroup">
<annotations>
<description>Fills in the provided Customer details (First/Last Name, Company, Phone # and Address) on the Admin Customer creation/edit page. Clicks on the Save button.</description>
</annotations>
<arguments>
<argument name="Address"/>
</arguments>

<amOnPage url="customer/address/new/" stepKey="goToAddressPage"/>
<waitForPageLoad stepKey="waitForAddressPage"/>
<fillField stepKey="fillFirstName" selector="{{StorefrontCustomerAddressSection.firstName}}" userInput="{{Address.firstname}}"/>
<fillField stepKey="fillLastName" selector="{{StorefrontCustomerAddressSection.lastName}}" userInput="{{Address.lastname}}"/>
<fillField stepKey="fillCompany" selector="{{StorefrontCustomerAddressSection.company}}" userInput="{{Address.company}}"/>
<fillField stepKey="fillPhoneNumber" selector="{{StorefrontCustomerAddressSection.phoneNumber}}" userInput="{{Address.telephone}}"/>
<fillField stepKey="fillStreetAddress1" selector="{{StorefrontCustomerAddressSection.streetAddress1}}" userInput="{{Address.street[0]}}"/>
<fillField stepKey="fillStreetAddress2" selector="{{StorefrontCustomerAddressSection.streetAddress2}}" userInput="{{Address.street[1]}}"/>
<fillField stepKey="fillCityName" selector="{{StorefrontCustomerAddressSection.city}}" userInput="{{Address.city}}"/>
<selectOption stepKey="selectCounty" selector="{{StorefrontCustomerAddressSection.country}}" userInput="{{Address.country_id}}"/>
<selectOption stepKey="selectState" selector="{{StorefrontCustomerAddressSection.stateProvince}}" userInput="{{Address.state}}"/>
<fillField stepKey="fillZip" selector="{{StorefrontCustomerAddressSection.zip}}" userInput="{{Address.postcode}}"/>
<click stepKey="saveAddress" selector="{{StorefrontCustomerAddressSection.saveAddress}}"/>
</actionGroup>
</actionGroups>
Loading