Skip to content

Commit 2b86774

Browse files
committed
Created action group for cancel created orders
1 parent 9ba1009 commit 2b86774

File tree

2 files changed

+68
-1
lines changed

2 files changed

+68
-1
lines changed

app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,16 @@
2727
</before>
2828

2929
<after>
30+
<!--Cancel orders-->
31+
<actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/>
32+
<actionGroup ref="AdminOrderChangeByCustomerEmailActionGroup" stepKey="cancelOrders">
33+
<argument name="customerEmail" value="$$createSimpleUsCustomer.email$$"/>
34+
</actionGroup>
35+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
36+
3037
<!--Logout from customer account-->
3138
<amOnPage url="{{StorefrontCustomerLogoutPage.url}}" stepKey="logoutCustomerOne"/>
3239
<waitForPageLoad stepKey="waitLogoutCustomerOne"/>
33-
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
3440
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
3541
<deleteData createDataKey="createSimpleUsCustomer" stepKey="deleteCustomer"/>
3642
</after>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminOrderChangeByCustomerEmailActionGroup">
11+
<annotations>
12+
<description>
13+
Goes to the Admin Orders grid page and changes all orders found by Customer Email field.
14+
</description>
15+
</annotations>
16+
<arguments>
17+
<argument name="customerEmail" type="string"/>
18+
<argument name="actionLabel" type="string" defaultValue="Cancel"/>
19+
</arguments>
20+
21+
<!-- Go to orders page, clear filters -->
22+
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrdersPage"/>
23+
<waitForPageLoad stepKey="waitForPageLoad"/>
24+
<conditionalClick
25+
selector="{{AdminDataGridFilterSection.clear}}"
26+
dependentSelector="{{AdminDataGridFilterSection.clear}}"
27+
visible="true"
28+
stepKey="clearFiltersIfPresent"
29+
/>
30+
<waitForLoadingMaskToDisappear stepKey="waitAfterClearFilters"/>
31+
32+
<!-- Show Customer Email column in the grid -->
33+
<click selector="{{AdminDataGridHeaderSection.columnsToggle}}" stepKey="openOrderColumns"/>
34+
<checkOption
35+
selector="{{AdminDataGridHeaderSection.columnCheckbox('Customer Email')}}"
36+
stepKey="showCustomerEmailColumn"
37+
/>
38+
<click selector="{{AdminDataGridHeaderSection.columnsToggle}}" stepKey="closeOrderColumns"/>
39+
<seeElement
40+
selector="{{AdminDataGridTableSection.columnHeader('Customer Email')}}"
41+
stepKey="seeCustomerEmailColumnInGrid"
42+
/>
43+
44+
<!-- Filter orders by Customer Email -->
45+
<click selector="{{AdminDataGridFilterSection.filterExpand}}" stepKey="openOrderFilters"/>
46+
<fillField
47+
selector="{{AdminDataGridFilterSection.inputFieldByNameAttr('customer_email')}}"
48+
userInput="{{customerEmail}}"
49+
stepKey="fillCustomerEmailFilter"
50+
/>
51+
<click selector="{{AdminDataGridFilterSection.apply}}" stepKey="applyOrderFilters"/>
52+
<waitForLoadingMaskToDisappear stepKey="waitAfterApplyFilters"/>
53+
54+
<!-- Change found orders -->
55+
<click selector="{{AdminGridSelectRows.multicheckDropdown}}" stepKey="openMulticheckDropdown"/>
56+
<click selector="{{AdminGridSelectRows.multicheckOption('Select All')}}" stepKey="selectAllOrders"/>
57+
<click selector="{{AdminGridSelectRows.bulkActionDropdown}}" stepKey="clickActionDropdown"/>
58+
<click selector="{{AdminGridSelectRows.bulkActionOption(actionLabel)}}" stepKey="clickActionLabel"/>
59+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
60+
</actionGroup>
61+
</actionGroups>

0 commit comments

Comments
 (0)