|
| 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="AdminLoginAsCustomerManualChooseFromOrderPageTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Login as Customer"/> |
| 14 | + <stories value="Select Store based on 'Store View To Login In' setting"/> |
| 15 | + <title |
| 16 | + value="Admin user directly login into customer account with store View To Login In = Manual Choose on Order Page"/> |
| 17 | + <description |
| 18 | + value="Verify admin user can directly login into customer account to Custom store view when Store View To Login In = Manual Choose on Order Page"/> |
| 19 | + <severity value="CRITICAL"/> |
| 20 | + <group value="login_as_customer"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <createData entity="Simple_US_Customer_Assistance_Allowed" stepKey="createCustomer"/> |
| 24 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 25 | + <createData entity="SimpleProduct" stepKey="createProduct"> |
| 26 | + <requiredEntity createDataKey="createCategory"/> |
| 27 | + </createData> |
| 28 | + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" |
| 29 | + stepKey="enableLoginAsCustomer"/> |
| 30 | + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 1" |
| 31 | + stepKey="enableLoginAsCustomerManualChoose"/> |
| 32 | + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> |
| 33 | + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> |
| 34 | + <actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createCustomStore"> |
| 35 | + <argument name="website" value="{{_defaultWebsite.name}}"/> |
| 36 | + <argument name="storeGroupName" value="{{customStoreGroup.name}}"/> |
| 37 | + <argument name="storeGroupCode" value="{{customStoreGroup.code}}"/> |
| 38 | + </actionGroup> |
| 39 | + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createFirstCustomStoreView"> |
| 40 | + <argument name="StoreGroup" value="customStoreGroup"/> |
| 41 | + <argument name="customStore" value="customStoreEN"/> |
| 42 | + </actionGroup> |
| 43 | + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createSecondCustomStoreView"> |
| 44 | + <argument name="StoreGroup" value="customStoreGroup"/> |
| 45 | + <argument name="customStore" value="customStoreFR"/> |
| 46 | + </actionGroup> |
| 47 | + </before> |
| 48 | + <after> |
| 49 | + <actionGroup ref="DeleteCustomStoreActionGroup" stepKey="deleteCustomStore"> |
| 50 | + <argument name="storeGroupName" value="customStoreGroup.name"/> |
| 51 | + </actionGroup> |
| 52 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 53 | + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" |
| 54 | + stepKey="disableLoginAsCustomer"/> |
| 55 | + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" |
| 56 | + stepKey="enableLoginAsCustomerAutoDetection"/> |
| 57 | + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> |
| 58 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 59 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 60 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 61 | + </after> |
| 62 | + |
| 63 | + <!-- Login as Customer from Customer page --> |
| 64 | + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageManualChooseActionGroup" |
| 65 | + stepKey="loginAsCustomerFromCustomerPage"> |
| 66 | + <argument name="customerId" value="$$createCustomer.id$$"/> |
| 67 | + <argument name="storeName" value="{{customStoreGroup.name}}"/> |
| 68 | + </actionGroup> |
| 69 | + |
| 70 | + <!-- Place Order as Customer --> |
| 71 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> |
| 72 | + <argument name="productUrl" value="$$createProduct.sku$$"/> |
| 73 | + </actionGroup> |
| 74 | + <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> |
| 75 | + <argument name="product" value="$$createProduct$$"/> |
| 76 | + <argument name="productCount" value="1"/> |
| 77 | + </actionGroup> |
| 78 | + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openCart"/> |
| 79 | + <actionGroup ref="PlaceOrderWithLoggedUserActionGroup" stepKey="placeOrder"/> |
| 80 | + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderId"/> |
| 81 | + |
| 82 | + <!-- Login as Customer from Customer page --> |
| 83 | + <actionGroup ref="AdminLoginAsCustomerLoginFromOrderPageManualChooseActionGroup" |
| 84 | + stepKey="loginAsCustomerFromOrderPage"> |
| 85 | + <argument name="orderId" value="{$grabOrderId}"/> |
| 86 | + <argument name="storeName" value="{{customStoreGroup.name}}"/> |
| 87 | + </actionGroup> |
| 88 | + |
| 89 | + <!-- Assert Customer logged on on custom store view --> |
| 90 | + <actionGroup ref="StorefrontAssertLoginAsCustomerLoggedInActionGroup" stepKey="assertLoggedInFromCustomerGird"> |
| 91 | + <argument name="customerFullName" value="$$createCustomer.firstname$$ $$createCustomer.lastname$$"/> |
| 92 | + <argument name="customerEmail" value="$$createCustomer.email$$"/> |
| 93 | + </actionGroup> |
| 94 | + <actionGroup ref="StorefrontAssertCustomerOnStoreViewActionGroup" stepKey="assertCustomStoreView"> |
| 95 | + <argument name="storeViewName" value="{{customStoreEN.name}}"/> |
| 96 | + </actionGroup> |
| 97 | + |
| 98 | + <!-- Log out Customer and close tab --> |
| 99 | + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutAndCloseTab"/> |
| 100 | + </test> |
| 101 | +</tests> |
0 commit comments