|
| 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="AdminLoginAsCustomerDirectlyToCustomWebsiteTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Login As Customer"/> |
| 14 | + <stories value="Login As Customer into additional website"/> |
| 15 | + <title value="Admin user directly login into customer account on custom website"/> |
| 16 | + <description |
| 17 | + value="Verify admin user can directly login into customer account on custom website using 'Login as customer' functionality"/> |
| 18 | + <severity value="BLOCKER"/> |
| 19 | + <group value="login_as_customer"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" |
| 23 | + stepKey="enableLoginAsCustomer"/> |
| 24 | + <magentoCLI command="config:set {{LoginAsCustomerStoreViewLogin.path}} 0" |
| 25 | + stepKey="enableLoginAsCustomerAutoDetection"/> |
| 26 | + <magentoCLI |
| 27 | + command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" |
| 28 | + stepKey="enableAddStoreCodeToUrls"/> |
| 29 | + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> |
| 30 | + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> |
| 31 | + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createCustomWebsite"> |
| 32 | + <argument name="newWebsiteName" value="{{customWebsite.name}}"/> |
| 33 | + <argument name="websiteCode" value="{{customWebsite.code}}"/> |
| 34 | + </actionGroup> |
| 35 | + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStore"> |
| 36 | + <argument name="website" value="{{customWebsite.name}}"/> |
| 37 | + <argument name="store" value="{{customStoreGroup.name}}"/> |
| 38 | + <argument name="rootCategory" value="Default Category"/> |
| 39 | + </actionGroup> |
| 40 | + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"> |
| 41 | + <argument name="StoreGroup" value="customStoreGroup"/> |
| 42 | + <argument name="customStore" value="customStoreEN"/> |
| 43 | + </actionGroup> |
| 44 | + <actionGroup ref="AdminCreateCustomerWithWebSiteAndGroupActionGroup" stepKey="createCustomer"> |
| 45 | + <argument name="customerData" value="Simple_US_Customer"/> |
| 46 | + <argument name="website" value="{{customWebsite.name}}"/> |
| 47 | + <argument name="storeView" value="{{customStoreEN.name}}"/> |
| 48 | + </actionGroup> |
| 49 | + </before> |
| 50 | + <after> |
| 51 | + <actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer"> |
| 52 | + <argument name="customerEmail" value="Simple_US_Customer.email"/> |
| 53 | + </actionGroup> |
| 54 | + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> |
| 55 | + <argument name="websiteName" value="{{customWebsite.name}}"/> |
| 56 | + </actionGroup> |
| 57 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 58 | + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" |
| 59 | + stepKey="disableLoginAsCustomer"/> |
| 60 | + <magentoCLI |
| 61 | + command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" |
| 62 | + stepKey="disableAddStoreCodeToUrls"/> |
| 63 | + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> |
| 64 | + </after> |
| 65 | + |
| 66 | + <!-- Login As Customer from Customer page --> |
| 67 | + <actionGroup ref="OpenEditCustomerFromAdminActionGroup" stepKey="OpenEditCustomerFrom"> |
| 68 | + <argument name="customer" value="Simple_US_Customer"/> |
| 69 | + </actionGroup> |
| 70 | + <grabFromCurrentUrl regex="~id/(\d+)/~" stepKey="customerId" /> |
| 71 | + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" |
| 72 | + stepKey="loginAsCustomerFromCustomerPage"> |
| 73 | + <argument name="customerId" value="${customerId}"/> |
| 74 | + </actionGroup> |
| 75 | + |
| 76 | + <!-- Assert Customer logged on Custom Website --> |
| 77 | + <actionGroup ref="StorefrontClickOnHeaderLogoActionGroup" stepKey="clickOnStorefrontHeaderLogo"/> |
| 78 | + <actionGroup ref="AssertStorefrontStoreCodeInUrlActionGroup" stepKey="seeStoreCodeInUrl"> |
| 79 | + <argument name="storeCode" value="{{customStoreEN.code}}"/> |
| 80 | + </actionGroup> |
| 81 | + |
| 82 | + <!-- Log out Customer and close tab --> |
| 83 | + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutAndCloseTab"/> |
| 84 | + </test> |
| 85 | +</tests> |
0 commit comments