Skip to content

Commit b22d5d1

Browse files
committed
MC-17007: "Set Active" action on customers grid does not work properly
- Added automated test script.
1 parent dffe94d commit b22d5d1

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,15 @@
2020
<click selector="{{AdminCustomerFiltersSection.apply}}" stepKey="applyFilter"/>
2121
<waitForPageLoad stepKey="waitForPageToLoad"/>
2222
</actionGroup>
23+
<actionGroup name="adminSetCustomerActiveViaGrid">
24+
<arguments>
25+
<argument name="customerEmail" type="string" defaultValue="{{Simple_US_CA_Customer.email}}"/>
26+
</arguments>
27+
<click selector="{{AdminCustomerGridMainActionsSection.customerCheckbox(customerEmail)}}" stepKey="chooseCustomer" />
28+
<click selector="{{AdminCustomerGridMainActionsSection.actions}}" stepKey="openActions"/>
29+
<waitForElementVisible selector="{{AdminCustomerGridMainActionsSection.setActive}}" stepKey="waitForDropDownOpen"/>
30+
<click selector="{{AdminCustomerGridMainActionsSection.setActive}}" stepKey="setActive"/>
31+
<waitForPageLoad stepKey="waitForLoad"/>
32+
<see userInput="A total of 1 record(s) were updated." stepKey="seeSuccessMessage"/>
33+
</actionGroup>
2334
</actionGroups>

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,12 @@
2525
<waitForPageLoad stepKey="wait"/>
2626
<scrollToTopOfPage stepKey="scrollToTop"/>
2727
</actionGroup>
28+
<actionGroup name="adminSetCustomerInactive">
29+
<click selector="{{AdminCustomerAccountInformationSection.accountInformationTab}}" stepKey="goToAccountInformation"/>
30+
<waitForElementVisible selector="{{AdminCustomerAccountInformationSection.statusInactive}}" stepKey="waitForElement"/>
31+
<click selector="{{AdminCustomerAccountInformationSection.statusInactive}}" stepKey="clickInactive"/>
32+
<click selector="{{AdminCustomerMainActionsSection.saveAndContinue}}" stepKey="saveAndContinue"/>
33+
<waitForPageLoad stepKey="waitForSaving"/>
34+
<see userInput="You saved the customer." stepKey="seeSuccessMessage"/>
35+
</actionGroup>
2836
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
<element name="actions" type="text" selector=".action-select"/>
1616
<element name="customerCheckbox" type="button" selector="//*[contains(text(),'{{arg}}')]/parent::td/preceding-sibling::td/label[@class='data-grid-checkbox-cell-inner']//input" parameterized="true"/>
1717
<element name="ok" type="button" selector="//button[@data-role='action']//span[text()='OK']"/>
18+
<element name="setActive" type="button" selector="//*[contains(@class, 'admin__data-grid-header')]//span[contains(@class,'action-menu-item') and text()='Set Active']" timeout="30"/>
1819
</section>
1920
</sections>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@
1717
<element name="customerEditLinkByEmail" type="text" selector="//tr[@class='data-row' and //div[text()='{{customerEmail}}']]//a[@class='action-menu-item']" parameterized="true" timeout="30"/>
1818
<element name="customerGroupByEmail" type="text" selector="//tr[@class='data-row' and //div[text()='{{customerEmail}}']]//div[text()='{{customerGroup}}']" parameterized="true"/>
1919
</section>
20+
<section name="AdminCustomerGridInformationSection">
21+
<element name="status" type="text" selector="//tr[@class='data-row' and //div[text()='{{customerEmail}}']]//div[contains(text(), '{{status}}')]" parameterized="true" timeout="30"/>
22+
</section>
2023
</sections>

0 commit comments

Comments
 (0)