-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REFACTOR: Extract Action Groups to separate files (according to MFTF …
…best practices)
- Loading branch information
1 parent
c7ca62e
commit 14f95d9
Showing
43 changed files
with
593 additions
and
404 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminClearCustomersFiltersActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
34 changes: 34 additions & 0 deletions
34
...ento/Customer/Test/Mftf/ActionGroup/AdminCreateCustomerWithWebSiteAndGroupActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertSignedUpNewsletterActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
app/code/Magento/Customer/Test/Mftf/ActionGroup/DeleteCustomerByEmailActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
31 changes: 31 additions & 0 deletions
31
app/code/Magento/Customer/Test/Mftf/ActionGroup/DeleteCustomerFromAdminActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
33 changes: 33 additions & 0 deletions
33
app/code/Magento/Customer/Test/Mftf/ActionGroup/EnterCustomerAddressInfoActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.