|
| 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 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 9 | + <test name="PlaceAnOrderAndCreditMemoItValidateTheOrderStatusIsClosedTest"> |
| 10 | + <annotations> |
| 11 | + <stories value="Place an order and credit memo it, validate the order status is closed"/> |
| 12 | + <title value="Place an order and credit memo it, validate the order status is closed"/> |
| 13 | + <description value="Place an order and credit memo it, validate the order status is closed"/> |
| 14 | + <severity value="MINOR"/> |
| 15 | + <testCaseId value="AC-1577"/> |
| 16 | + </annotations> |
| 17 | + <before> |
| 18 | + <!-- Add downloadable domains --> |
| 19 | + <magentoCLI stepKey="addDownloadableDomain" command="downloadable:domains:add example.com static.magento.com"/> |
| 20 | + |
| 21 | + <!-- Login as an Admin --> |
| 22 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 23 | + |
| 24 | + <!-- Create Customer --> |
| 25 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 26 | + |
| 27 | + <!-- Create Category --> |
| 28 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 29 | + |
| 30 | + <!-- Create Simple Product --> |
| 31 | + <createData entity="_defaultProduct" stepKey="createSimpleProduct"> |
| 32 | + <requiredEntity createDataKey="createCategory"/> |
| 33 | + </createData> |
| 34 | + |
| 35 | + <!-- Create Configurable Product having color attribute --> |
| 36 | + <actionGroup ref="CreateConfigurableProductActionGroupWithDefaultColorAttributeActionGroup" stepKey="createConfigurableProduct"> |
| 37 | + <argument name="product" value="_defaultProduct"/> |
| 38 | + <argument name="category" value="$$createCategory$$"/> |
| 39 | + </actionGroup> |
| 40 | + <!-- Assigning quantities to each SKU's --> |
| 41 | + <actionGroup ref="AdminSetProductQuantityToEachSkusConfigurableProductActionGroup" stepKey="saveConfigurableProduct"/> |
| 42 | + |
| 43 | + <!-- Create Virtual Product --> |
| 44 | + <createData entity="VirtualProduct" stepKey="createVirtualProduct"> |
| 45 | + <requiredEntity createDataKey="createCategory"/> |
| 46 | + </createData> |
| 47 | + |
| 48 | + <!-- Create Downloadable product --> |
| 49 | + <createData entity="ApiDownloadableProduct" stepKey="createDownloadableProduct"/> |
| 50 | + <createData entity="ApiDownloadableLink" stepKey="addFirstDownloadableLink"> |
| 51 | + <requiredEntity createDataKey="createDownloadableProduct"/> |
| 52 | + </createData> |
| 53 | + <createData entity="ApiDownloadableLink" stepKey="addSecondDownloadableLink"> |
| 54 | + <requiredEntity createDataKey="createDownloadableProduct"/> |
| 55 | + </createData> |
| 56 | + </before> |
| 57 | + <after> |
| 58 | + <!-- Remove downloadable domains --> |
| 59 | + <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove example.com static.magento.com"/> |
| 60 | + |
| 61 | + <!-- Delete Customer --> |
| 62 | + <deleteData createDataKey="createCustomer" stepKey="deleteCreateCustomer"/> |
| 63 | + |
| 64 | + <!-- Delete Simple Product --> |
| 65 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 66 | + |
| 67 | + <!-- Delete configurable product --> |
| 68 | + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> |
| 69 | + <argument name="product" value="_defaultProduct"/> |
| 70 | + </actionGroup> |
| 71 | + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="clearProductsGridFilters" after="deleteProduct"/> |
| 72 | + |
| 73 | + <!-- Delete Virtual Product --> |
| 74 | + <deleteData createDataKey="createVirtualProduct" stepKey="deleteVirtualProducts"/> |
| 75 | + |
| 76 | + <!-- Delete created downloadable product --> |
| 77 | + <deleteData createDataKey="createDownloadableProduct" stepKey="deleteDownloadableProduct"/> |
| 78 | + |
| 79 | + <!-- Delete Category --> |
| 80 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 81 | + |
| 82 | + <!-- Logout User and Admin --> |
| 83 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> |
| 84 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 85 | + </after> |
| 86 | + |
| 87 | + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToProductPage"> |
| 88 | + <argument name="productUrlKey" value="$createSimpleProduct.custom_attributes[url_key]$"/> |
| 89 | + </actionGroup> |
| 90 | + |
| 91 | + <!-- Add Simple Product --> |
| 92 | + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="cartAddSimpleProductToCart"> |
| 93 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 94 | + <argument name="productCount" value="1"/> |
| 95 | + </actionGroup> |
| 96 | + |
| 97 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="navigateToCheckout"/> |
| 98 | + <waitForPageLoad stepKey="waitForPaymentSelectionPageLoad"/> |
| 99 | + |
| 100 | + <actionGroup ref="LoginAsCustomerOnCheckoutPageActionGroup" stepKey="storefrontCustomerLogin"> |
| 101 | + <argument name="customer" value="$$createCustomer$$"/> |
| 102 | + </actionGroup> |
| 103 | + |
| 104 | + <actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="gotoPaymentStep"/> |
| 105 | + |
| 106 | + <actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="customerPlaceOrder"> |
| 107 | + <argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/> |
| 108 | + <argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/> |
| 109 | + </actionGroup> |
| 110 | + |
| 111 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="getOrderNumber"/> |
| 112 | + <assertNotEmpty stepKey="assertOrderIdIsNotEmpty" after="getOrderNumber"> |
| 113 | + <actualResult type="const">$getOrderNumber</actualResult> |
| 114 | + </assertNotEmpty> |
| 115 | + |
| 116 | + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="goToOrders"/> |
| 117 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById"> |
| 118 | + <argument name="orderId" value="$getOrderNumber"/> |
| 119 | + </actionGroup> |
| 120 | + <actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceButton"/> |
| 121 | + <actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/> |
| 122 | + |
| 123 | + <click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreditMemoAction"/> |
| 124 | + <click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickSubmitCreditMemo"/> |
| 125 | + <scrollTo selector="//select[@id='history_status']" stepKey="scrollToAnchor"/> |
| 126 | + <seeOptionIsSelected userInput="Closed" selector="//select[@id='history_status']" stepKey="seeOption1"/> |
| 127 | + |
| 128 | + <!-- Add Virtual Product --> |
| 129 | + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToProductPageVirtual"> |
| 130 | + <argument name="productUrlKey" value="$createVirtualProduct.custom_attributes[url_key]$"/> |
| 131 | + </actionGroup> |
| 132 | + |
| 133 | + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="cartAddVirtualProductToCart"> |
| 134 | + <argument name="product" value="$$createVirtualProduct$$"/> |
| 135 | + <argument name="productCount" value="1"/> |
| 136 | + </actionGroup> |
| 137 | + |
| 138 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="navigateToCheckoutVirtual"/> |
| 139 | + <waitForPageLoad stepKey="waitForPaymentSelectionPageLoadVirtual"/> |
| 140 | + |
| 141 | + <!-- Place Order --> |
| 142 | + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/> |
| 143 | + |
| 144 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="getOrderNumberVirtual"/> |
| 145 | + <assertNotEmpty stepKey="assertOrderIdIsNotEmptyVirtual" after="getOrderNumberVirtual"> |
| 146 | + <actualResult type="const">$getOrderNumberVirtual</actualResult> |
| 147 | + </assertNotEmpty> |
| 148 | + |
| 149 | + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="goToOrdersVirtual"/> |
| 150 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridByIdVirtual"> |
| 151 | + <argument name="orderId" value="$getOrderNumberVirtual"/> |
| 152 | + </actionGroup> |
| 153 | + <actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceButtonVirtual"/> |
| 154 | + <actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoiceVirtual"/> |
| 155 | + |
| 156 | + <click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreditMemoActionVirtual"/> |
| 157 | + <click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickSubmitCreditMemoVirtual"/> |
| 158 | + <scrollTo selector="//select[@id='history_status']" stepKey="scrollToAnchorVirtual"/> |
| 159 | + <seeOptionIsSelected userInput="Closed" selector="//select[@id='history_status']" stepKey="seeOption1Virtual"/> |
| 160 | + |
| 161 | + <!-- Add Configurable Product --> |
| 162 | + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToProductPageConfigurable"> |
| 163 | + <argument name="productUrlKey" value="$createSimpleProduct.custom_attributes[url_key]$"/> |
| 164 | + </actionGroup> |
| 165 | + |
| 166 | + <!-- Add configurable product to the cart --> |
| 167 | + <actionGroup ref="StorefrontAddConfigurableProductToTheCartActionGroup" stepKey="addConfigurableProductToCart"> |
| 168 | + <argument name="urlKey" value="{{_defaultProduct.urlKey}}" /> |
| 169 | + <argument name="productAttribute" value="Color"/> |
| 170 | + <argument name="productOption" value="{{colorProductAttribute2.name}}"/> |
| 171 | + <argument name="qty" value="1"/> |
| 172 | + </actionGroup> |
| 173 | + |
| 174 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMiniCart"/> |
| 175 | + <waitForPageLoad stepKey="waitForPaymentSelectionPageLoadConfigurable"/> |
| 176 | + |
| 177 | + <!-- Place Order --> |
| 178 | + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrderConfigurable"/> |
| 179 | + |
| 180 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="getOrderNumberConfigurable"/> |
| 181 | + <assertNotEmpty stepKey="assertOrderIdIsNotEmptyConfigurable" after="getOrderNumberConfigurable"> |
| 182 | + <actualResult type="const">$getOrderNumberConfigurable</actualResult> |
| 183 | + </assertNotEmpty> |
| 184 | + |
| 185 | + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="goToOrdersConfigurable"/> |
| 186 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridByIdConfigurable"> |
| 187 | + <argument name="orderId" value="$getOrderNumberConfigurable"/> |
| 188 | + </actionGroup> |
| 189 | + <actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceButtonConfigurable"/> |
| 190 | + <actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoiceConfigurable"/> |
| 191 | + |
| 192 | + <click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreditMemoActionConfigurable"/> |
| 193 | + <click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickSubmitCreditMemoConfigurable"/> |
| 194 | + <scrollTo selector="//select[@id='history_status']" stepKey="scrollToAnchorConfigurable"/> |
| 195 | + <seeOptionIsSelected userInput="Closed" selector="//select[@id='history_status']" stepKey="seeOption1Configurable"/> |
| 196 | + |
| 197 | + <!-- Add Downloadable Product --> |
| 198 | + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToProductPageDownloadable"> |
| 199 | + <argument name="productUrlKey" value="$createDownloadableProduct.custom_attributes[url_key]$"/> |
| 200 | + </actionGroup> |
| 201 | + |
| 202 | + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="cartAddDownloadableProductToCart"> |
| 203 | + <argument name="product" value="$$createDownloadableProduct$$"/> |
| 204 | + <argument name="productCount" value="1"/> |
| 205 | + </actionGroup> |
| 206 | + |
| 207 | + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="navigateToCheckoutDownloadable"/> |
| 208 | + <waitForPageLoad stepKey="waitForPaymentSelectionPageLoadDownloadable"/> |
| 209 | + |
| 210 | + <!-- Place Order --> |
| 211 | + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrderDownloadable"/> |
| 212 | + |
| 213 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="getOrderNumberDownloadable"/> |
| 214 | + <assertNotEmpty stepKey="assertOrderIdIsNotEmptyDownloadable" after="getOrderNumberDownloadable"> |
| 215 | + <actualResult type="const">$getOrderNumberDownloadable</actualResult> |
| 216 | + </assertNotEmpty> |
| 217 | + |
| 218 | + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="goToOrdersDownloadable"/> |
| 219 | + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridByIdDownloadable"> |
| 220 | + <argument name="orderId" value="$getOrderNumberDownloadable"/> |
| 221 | + </actionGroup> |
| 222 | + <actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceButtonDownloadable"/> |
| 223 | + <actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoiceDownloadable"/> |
| 224 | + |
| 225 | + <click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreditMemoActionDownloadable"/> |
| 226 | + <click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickSubmitCreditMemoDownloadable"/> |
| 227 | + <scrollTo selector="//select[@id='history_status']" stepKey="scrollToAnchorDownloadable"/> |
| 228 | + <seeOptionIsSelected userInput="Closed" selector="//select[@id='history_status']" stepKey="seeOption1Downloadable"/> |
| 229 | + |
| 230 | + </test> |
| 231 | +</tests> |
0 commit comments