|
| 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="AdminLoginAsCustomerReorderTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Login As Customer"/> |
| 14 | + <stories value="Place order and reorder"/> |
| 15 | + <title value="Admin user login as customer and reorder existing order"/> |
| 16 | + <description |
| 17 | + value="Verify that admin user can reorder using 'Login as customer' functionality"/> |
| 18 | + <severity value="MAJOR"/> |
| 19 | + <group value="login_as_customer"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" |
| 23 | + stepKey="enableLoginAsCustomer"/> |
| 24 | + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> |
| 25 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 26 | + <createData entity="SimpleProduct" stepKey="createProduct"> |
| 27 | + <requiredEntity createDataKey="createCategory"/> |
| 28 | + </createData> |
| 29 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 30 | + <actionGroup ref="LoginAsAdmin" stepKey="login"/> |
| 31 | + </before> |
| 32 | + <after> |
| 33 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 34 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 35 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 36 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 37 | + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" |
| 38 | + stepKey="disableLoginAsCustomer"/> |
| 39 | + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> |
| 40 | + </after> |
| 41 | + |
| 42 | + <!-- Login to storefront as Customer --> |
| 43 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin"> |
| 44 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 45 | + </actionGroup> |
| 46 | + |
| 47 | + <!-- Place Order as Customer --> |
| 48 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> |
| 49 | + <argument name="productUrl" value="$$createProduct.sku$$"/> |
| 50 | + </actionGroup> |
| 51 | + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> |
| 52 | + <argument name="product" value="$$createProduct$$"/> |
| 53 | + <argument name="productCount" value="1"/> |
| 54 | + </actionGroup> |
| 55 | + <actionGroup ref="StorefrontOpenCartPageActionGroup" stepKey="openCart"/> |
| 56 | + <actionGroup ref="PlaceOrderWithLoggedUserActionGroup" stepKey="placeOrder"/> |
| 57 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderId"/> |
| 58 | + |
| 59 | + <!-- Log out from storefront as Customer --> |
| 60 | + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogOut"/> |
| 61 | + |
| 62 | + <!-- Login As Customer from Customer grid page --> |
| 63 | + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup" |
| 64 | + stepKey="loginAsCustomer"> |
| 65 | + <argument name="customerEmail" value="$$createCustomer.email$$"/> |
| 66 | + </actionGroup> |
| 67 | + |
| 68 | + <!-- Make reorder --> |
| 69 | + <actionGroup ref="StorefrontCustomerReorderActionGroup" stepKey="makeReorder"> |
| 70 | + <argument name="orderNumber" value="{$grabOrderId}"/> |
| 71 | + </actionGroup> |
| 72 | + <actionGroup ref="PlaceOrderWithLoggedUserActionGroup" stepKey="placeReorder"/> |
| 73 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabReorderId"/> |
| 74 | + |
| 75 | + <!-- Assert Storefront Order page contains message about Order created by a Store Administrator --> |
| 76 | + <actionGroup ref="StorefrontAssertContainsMessageOrderCreatedByAdminActionGroup" stepKey="verifyStorefrontMessageOrderCreatedByAdmin"> |
| 77 | + <argument name="orderId" value="{grabReorderId}"/> |
| 78 | + </actionGroup> |
| 79 | + |
| 80 | + <!-- Assert Admin Order page contains message about Order created by a Store Administrator --> |
| 81 | + <actionGroup ref="AdminAssertContainsMessageOrderCreatedByAdminActionGroup" stepKey="verifyAdminMessageOrderCreatedByAdmin"> |
| 82 | + <argument name="orderId" value="{grabReorderId}"/> |
| 83 | + </actionGroup> |
| 84 | + |
| 85 | + </test> |
| 86 | +</tests> |
0 commit comments