|
| 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="AdminMassOrdersOnHoldAllPaginatorTwoPerPageTest"> |
| 12 | + <annotations> |
| 13 | + <stories value="Mass Update Orders"/> |
| 14 | + <title value="Mass Update On Hold All Existing Orders When Pagination Is Set Two Orders Per Page"/> |
| 15 | + <description value="Set on Hold status on all existing orders through Mass Action when Pagination is set 2 per page"/> |
| 16 | + <severity value="AVERAGE"/> |
| 17 | + <testCaseId value="AC-3159"/> |
| 18 | + <group value="sales"/> |
| 19 | + </annotations> |
| 20 | + |
| 21 | + <before> |
| 22 | + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> |
| 23 | + <!-- Create Data --> |
| 24 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 25 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 26 | + <createData entity="defaultSimpleProduct" stepKey="createProduct"> |
| 27 | + <requiredEntity createDataKey="createCategory"/> |
| 28 | + </createData> |
| 29 | + </before> |
| 30 | + <after> |
| 31 | + <!-- Delete data --> |
| 32 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 33 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 34 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 35 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 36 | + </after> |
| 37 | + |
| 38 | + <!-- Create first order --> |
| 39 | + <actionGroup ref="CreateOrderActionGroup" stepKey="createFirstOrder"> |
| 40 | + <argument name="product" value="$$createProduct$$"/> |
| 41 | + <argument name="customer" value="$$createCustomer$$"/> |
| 42 | + </actionGroup> |
| 43 | + <grabTextFrom selector="|Order # (\d+)|" stepKey="orderNumber1"/> |
| 44 | + <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="orderId1"/> |
| 45 | + <assertNotEmpty stepKey="assertOrderIdIsNotEmpty"> |
| 46 | + <actualResult type="const">$orderNumber1</actualResult> |
| 47 | + </assertNotEmpty> |
| 48 | + |
| 49 | + <!-- Create second order --> |
| 50 | + <actionGroup ref="CreateOrderActionGroup" stepKey="createSecondOrder"> |
| 51 | + <argument name="product" value="$$createProduct$$"/> |
| 52 | + <argument name="customer" value="$$createCustomer$$"/> |
| 53 | + </actionGroup> |
| 54 | + <grabTextFrom selector="|Order # (\d+)|" stepKey="orderNumber2"/> |
| 55 | + <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="orderId2"/> |
| 56 | + <assertNotEmpty stepKey="assertSecondOrderIdIsNotEmpty"> |
| 57 | + <actualResult type="const">$orderNumber2</actualResult> |
| 58 | + </assertNotEmpty> |
| 59 | + |
| 60 | + <!-- Create third order --> |
| 61 | + <actionGroup ref="CreateOrderActionGroup" stepKey="createThirdOrder"> |
| 62 | + <argument name="product" value="$$createProduct$$"/> |
| 63 | + <argument name="customer" value="$$createCustomer$$"/> |
| 64 | + </actionGroup> |
| 65 | + <grabTextFrom selector="|Order # (\d+)|" stepKey="orderNumber3"/> |
| 66 | + <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="orderId3"/> |
| 67 | + <assertNotEmpty stepKey="assertThirdOrderIdIsNotEmpty"> |
| 68 | + <actualResult type="const">$orderNumber3</actualResult> |
| 69 | + </assertNotEmpty> |
| 70 | + |
| 71 | + <!-- Navigate to Sales > Orders --> |
| 72 | + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="goToAdminOrdersPage"/> |
| 73 | + <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetGrid"/> |
| 74 | + |
| 75 | + <!-- Set Per Page 2 to show two orders only on the grid --> |
| 76 | + <actionGroup ref="AdminDataGridSelectCustomPerPageActionGroup" stepKey="selectTwoOrdersPerPage"> |
| 77 | + <argument name="perPage" value="Const.two"/> |
| 78 | + </actionGroup> |
| 79 | + |
| 80 | + <!-- Select all orders --> |
| 81 | + <actionGroup ref="AdminGridSelectAllActionGroup" stepKey="selectAllOrders"/> |
| 82 | + |
| 83 | + <!-- Put On Hold all order Mass Action --> |
| 84 | + <actionGroup ref="SelectActionForOrdersActionGroup" stepKey="OnHoldOrders"> |
| 85 | + <argument name="action" value="Hold"/> |
| 86 | + </actionGroup> |
| 87 | + |
| 88 | + <!-- Set Per Page 20 orders in grid as it was initially --> |
| 89 | + <actionGroup ref="AdminDataGridSelectPerPageActionGroup" stepKey="selectBack20OrdersPerPage"> |
| 90 | + <argument name="perPage" value="20"/> |
| 91 | + </actionGroup> |
| 92 | + |
| 93 | + <!--Assert first order in orders grid --> |
| 94 | + <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeFirstOrder"> |
| 95 | + <argument name="orderId" value="{$orderNumber1}"/> |
| 96 | + <argument name="orderStatus" value="On Hold"/> |
| 97 | + </actionGroup> |
| 98 | + <see userInput="{$orderNumber1}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertFirstOrderID"/> |
| 99 | + <see userInput="On Hold" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertFirstOrderStatus"/> |
| 100 | + |
| 101 | + <!--Assert second order in orders grid --> |
| 102 | + <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeSecondOrder"> |
| 103 | + <argument name="orderId" value="{$orderNumber2}"/> |
| 104 | + <argument name="orderStatus" value="On Hold"/> |
| 105 | + </actionGroup> |
| 106 | + <see userInput="{$orderNumber2}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertSecondOrderID"/> |
| 107 | + <see userInput="On Hold" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertSecondStatus"/> |
| 108 | + |
| 109 | + <!--Assert third order in orders grid --> |
| 110 | + <actionGroup ref="AdminOrderFilterByOrderIdAndStatusActionGroup" stepKey="seeThirdOrder"> |
| 111 | + <argument name="orderId" value="{$orderNumber3}"/> |
| 112 | + <argument name="orderStatus" value="On Hold"/> |
| 113 | + </actionGroup> |
| 114 | + <see userInput="{$orderNumber3}" selector="{{AdminOrdersGridSection.gridCell('1','ID')}}" stepKey="assertThirdOrderID"/> |
| 115 | + <see userInput="On Hold" selector="{{AdminOrdersGridSection.gridCell('1','Status')}}" stepKey="assertThirdStatus"/> |
| 116 | + </test> |
| 117 | +</tests> |
0 commit comments