Skip to content

Commit 85ed368

Browse files
committed
MC-4535: Convert DeleteCustomerBackendEntityTest to MFTF
1 parent 47d89b7 commit 85ed368

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,22 @@
2121
<click stepKey="accept" selector="{{AdminCustomerGridMainActionsSection.ok}}"/>
2222
<see stepKey="seeSuccessMessage" userInput="were deleted."/>
2323
</actionGroup>
24+
<actionGroup name="DeleteCustomerByEmailActionGroup">
25+
<arguments>
26+
<argument name="email" type="string"/>
27+
</arguments>
28+
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomers"/>
29+
<waitForPageLoad stepKey="waitForAdminCustomerPageLoad"/>
30+
<click selector="{{AdminCustomerFiltersSection.filtersButton}}" stepKey="clickFilterButton"/>
31+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="cleanFiltersIfTheySet"/>
32+
<waitForPageLoad stepKey="waitForClearFilters"/>
33+
<fillField selector="{{AdminCustomerFiltersSection.emailInput}}" userInput="{{email}}" stepKey="filterEmail"/>
34+
<click selector="{{AdminCustomerFiltersSection.apply}}" stepKey="applyFilter"/>
35+
<waitForPageLoad stepKey="waitForPageToLoad"/>
36+
<click selector="{{AdminCustomerGridSection.selectFirstRow}}" stepKey="clickOnEditButton1"/>
37+
<click selector="{{CustomersPageSection.actions}}" stepKey="clickActionsDropdown"/>
38+
<click selector="{{CustomersPageSection.delete}}" stepKey="clickDelete"/>
39+
<click selector="{{CustomersPageSection.ok}}" stepKey="clickOkConfirmationButton"/>
40+
<waitForElementVisible stepKey="waitForSuccessfullyDeletedMessage" selector="{{CustomersPageSection.deletedSuccessMessage}}" time="10"/>
41+
</actionGroup>
2442
</actionGroups>

app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
<section name="AdminCustomerGridSection">
1212
<element name="customerGrid" type="text" selector="table[data-role='grid']"/>
1313
<element name="firstRowEditLink" type="text" selector="tr[data-repeat-index='0'] .action-menu-item" timeout="30"/>
14+
<element name="selectFirstRow" type="checkbox" selector="//td[@class='data-grid-checkbox-cell']"/>
1415
</section>
1516
</sections>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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="AdminDeleteCustomerTest">
12+
<annotations>
13+
<stories value="Delete customer"/>
14+
<title value="DeleteCustomerBackendEntityTestVariation1"/>
15+
<description value="Login as admin and delete the customer"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MC-14587"/>
18+
<group value="mtf_migrated"/>
19+
</annotations>
20+
21+
<before>
22+
<!-- Create Customer -->
23+
<createData entity="CustomerEntityOne" stepKey="createCustomer"/>
24+
<!-- Login as admin -->
25+
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
26+
</before>
27+
<after>
28+
<actionGroup ref="logout" stepKey="logout"/>
29+
</after>
30+
31+
<!-- Delete created customer -->
32+
<actionGroup ref="DeleteCustomerByEmailActionGroup" stepKey="deleteCustomer">
33+
<argument name="email" value="$$createCustomer.email$$"/>
34+
</actionGroup>
35+
<seeElement selector="{{CustomersPageSection.deletedSuccessMessage}}" stepKey="seeSuccessMessage"/>
36+
<waitForPageLoad stepKey="waitForCustomerGridPageToLoad"/>
37+
38+
<!--Assert Customer is not in Grid -->
39+
<click selector="{{AdminCustomerFiltersSection.filtersButton}}" stepKey="clickFilterButton"/>
40+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="cleanFiltersIfTheySet"/>
41+
<waitForPageLoad stepKey="waitForClearFilters1"/>
42+
<fillField selector="{{AdminCustomerFiltersSection.emailInput}}" userInput="$$createCustomer.email$$" stepKey="filterEmail"/>
43+
<click selector="{{AdminCustomerFiltersSection.apply}}" stepKey="applyFilter"/>
44+
<waitForPageLoad stepKey="waitForPageToLoad"/>
45+
<see selector="{{AdminCustomerGridSection.customerGrid}}" userInput="We couldn't find any records." stepKey="seeEmptyRecordMessage"/>
46+
</test>
47+
</tests>

0 commit comments

Comments
 (0)