|
| 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="AssignCustomOrderStatusNotVisibleOnStorefrontTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Sales"/> |
| 14 | + <stories value="Assign Custom Order Status"/> |
| 15 | + <title value="Assign custom order status not visible on storefront test"/> |
| 16 | + <description value="Assign custom order status not visible on storefront"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="MC-16053"/> |
| 19 | + <group value="sales"/> |
| 20 | + <group value="mtf_migrated"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!-- Create customer --> |
| 24 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 25 | + |
| 26 | + <!-- Create product --> |
| 27 | + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> |
| 28 | + |
| 29 | + <!-- Login as admin --> |
| 30 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 31 | + </before> |
| 32 | + <after> |
| 33 | + <!-- Disable created order status --> |
| 34 | + <magentoCLI command="config:set {{EnableCheckmoOrderStatusPending.path}} {{EnableCheckmoOrderStatusPending.value}}" stepKey="rollbackNewOrderStatus"/> |
| 35 | + |
| 36 | + <!-- Logout customer --> |
| 37 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> |
| 38 | + |
| 39 | + <!-- Delete product --> |
| 40 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 41 | + |
| 42 | + <!-- Delete customer --> |
| 43 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 44 | + |
| 45 | + <!-- Log out --> |
| 46 | + <actionGroup ref="logout" stepKey="logout"/> |
| 47 | + </after> |
| 48 | + |
| 49 | + <!-- Create order status --> |
| 50 | + <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/> |
| 51 | + <waitForPageLoad stepKey="waitForOrderStatusPageLoad"/> |
| 52 | + <click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/> |
| 53 | + |
| 54 | + <!-- Fill form and validate message --> |
| 55 | + <actionGroup ref="AdminOrderStatusFormFillAndSave" stepKey="fillFormAndClickSave"> |
| 56 | + <argument name="status" value="{{defaultOrderStatus.status}}"/> |
| 57 | + <argument name="label" value="{{defaultOrderStatus.label}}"/> |
| 58 | + </actionGroup> |
| 59 | + <actionGroup ref="AssertOrderStatusFormSaveSuccess" stepKey="seeFormSaveSuccess"/> |
| 60 | + |
| 61 | + <!-- Assign status to state --> |
| 62 | + <click selector="{{AdminOrderStatusGridSection.assignStatusToStateBtn}}" stepKey="clickAssignStatusBtn"/> |
| 63 | + <selectOption selector="{{AdminAssignOrderStatusToStateSection.orderStatus}}" userInput="{{defaultOrderStatus.status}}" stepKey="selectOrderStatus"/> |
| 64 | + <selectOption selector="{{AdminAssignOrderStatusToStateSection.orderState}}" userInput="{{OrderState.new}}" stepKey="selectOrderState"/> |
| 65 | + <checkOption selector="{{AdminAssignOrderStatusToStateSection.orderStatusAsDefault}}" stepKey="orderStatusAsDefault"/> |
| 66 | + <uncheckOption selector="{{AdminAssignOrderStatusToStateSection.visibleOnStorefront}}" stepKey="visibleOnStorefront"/> |
| 67 | + <click selector="{{AdminAssignOrderStatusToStateSection.saveStatusAssignment}}" stepKey="clickSaveStatus"/> |
| 68 | + <see selector="{{AdminMessagesSection.success}}" userInput="You assigned the order status." stepKey="seeSuccess"/> |
| 69 | + |
| 70 | + <!-- Prepare data for constraints --> |
| 71 | + <magentoCLI command="config:set {{EnableCheckmoOrderStatusPending.path}} {{defaultOrderStatus.label}}" stepKey="enableNewOrderStatus"/> |
| 72 | + |
| 73 | + <!-- Assert order status in grid --> |
| 74 | + <actionGroup ref="FilterOrderStatusByLabelAndCodeActionGroup" stepKey="filterOrderStatusGrid"> |
| 75 | + <argument name="statusLabel" value="{{defaultOrderStatus.label}}"/> |
| 76 | + <argument name="statusCode" value="{{defaultOrderStatus.status}}"/> |
| 77 | + </actionGroup> |
| 78 | + <see selector="{{AdminOrderStatusGridSection.gridCell('1', 'State Code and Title')}}" userInput="new[{{defaultOrderStatus.label}}]" stepKey="seeOrderStatusInOrderGrid"/> |
| 79 | + |
| 80 | + <!-- Create order and grab order id --> |
| 81 | + <actionGroup ref="CreateOrderActionGroup" stepKey="createNewOrder"> |
| 82 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 83 | + <argument name="customer" value="$$createCustomer$$"/> |
| 84 | + </actionGroup> |
| 85 | + <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId"/> |
| 86 | + |
| 87 | + <!-- Assert order status is correct --> |
| 88 | + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrdersPage"/> |
| 89 | + <waitForPageLoad stepKey="waitForOrdersPageLoad"/> |
| 90 | + <actionGroup ref="filterOrderGridById" stepKey="filterOrdersGridById"> |
| 91 | + <argument name="orderId" value="$getOrderId"/> |
| 92 | + </actionGroup> |
| 93 | + <click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="clickCreatedOrderInGrid"/> |
| 94 | + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="{{defaultOrderStatus.label}}" stepKey="seeOrderStatus"/> |
| 95 | + |
| 96 | + <!-- Login as customer --> |
| 97 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> |
| 98 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 99 | + </actionGroup> |
| 100 | + <waitForPageLoad stepKey="waitForCustomerLogin"/> |
| 101 | + |
| 102 | + <!-- Open My Orders --> |
| 103 | + <amOnPage url="{{StorefrontCustomerDashboardPage.url}}" stepKey="goToCustomerDashboardPage"/> |
| 104 | + <waitForPageLoad stepKey="waitForCustomerDashboardPageLoad"/> |
| 105 | + <actionGroup ref="StorefrontCustomerGoToSidebarMenu" stepKey="goToMyOrdersPage"> |
| 106 | + <argument name="menu" value="My Orders"/> |
| 107 | + </actionGroup> |
| 108 | + |
| 109 | + <!-- Assert order not visible on My Orders --> |
| 110 | + <see selector="{{StorefrontOrderInformationMainSection.emptyMessage}}" userInput="You have placed no orders." stepKey="seeEmptyMessage"/> |
| 111 | + |
| 112 | + <!-- Cancel order --> |
| 113 | + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToAdminOrdersPage"/> |
| 114 | + <waitForPageLoad stepKey="waitForAdminOrdersPageLoad"/> |
| 115 | + <actionGroup ref="filterOrderGridById" stepKey="filterOrdersGridByOrderId"> |
| 116 | + <argument name="orderId" value="$getOrderId"/> |
| 117 | + </actionGroup> |
| 118 | + <checkOption selector="{{AdminOrdersGridSection.checkOrder}}" stepKey="selectOrder"/> |
| 119 | + <actionGroup ref="SelectActionForOrdersActionGroup" stepKey="selectCancelOrderAction"> |
| 120 | + <argument name="action" value="{{OrderActions.cancel}}"/> |
| 121 | + </actionGroup> |
| 122 | + <see selector="{{AdminMessagesSection.success}}" userInput="We canceled 1 order(s)." stepKey="seeSuccessMessage"/> |
| 123 | + |
| 124 | + <!-- Unassign order status --> |
| 125 | + <amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatus"/> |
| 126 | + <waitForPageLoad stepKey="waitForStatusPageLoad"/> |
| 127 | + <actionGroup ref="FilterOrderStatusByLabelAndCodeActionGroup" stepKey="filterStatusGrid"> |
| 128 | + <argument name="statusLabel" value="{{defaultOrderStatus.label}}"/> |
| 129 | + <argument name="statusCode" value="{{defaultOrderStatus.status}}"/> |
| 130 | + </actionGroup> |
| 131 | + <click selector="{{AdminOrderStatusGridSection.unassign}}" stepKey="unassignOrderStatus"/> |
| 132 | + <see selector="{{AdminMessagesSection.success}}" userInput="You have unassigned the order status." stepKey="seeMessage"/> |
| 133 | + </test> |
| 134 | +</tests> |
0 commit comments