|
| 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="AdminLoginAsCustomerLoggingTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Login As Customer"/> |
| 14 | + <!-- TODO: change "stories" value --> |
| 15 | + <stories value="Place order and reorder"/> |
| 16 | + <title value="Using 'Login As Customer' is logged properly"/> |
| 17 | + <description |
| 18 | + value="Verify that 'Login as customer Log' record information about using 'Login as Customer' functionality properly"/> |
| 19 | + <severity value="MAJOR"/> |
| 20 | + <group value="login_as_customer"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" |
| 24 | + stepKey="enableLoginAsCustomer"/> |
| 25 | + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> |
| 26 | + <createData entity="NewAdminUser" stepKey="createNewAdmin"/> |
| 27 | + <createData entity="Simple_US_Customer" stepKey="createFirstCustomer"/> |
| 28 | + <createData entity="Simple_US_CA_Customer" stepKey="createSecondCustomer"/> |
| 29 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultUser"/> |
| 30 | + </before> |
| 31 | + <after> |
| 32 | + <deleteData createDataKey="createFirstCustomer" stepKey="deleteFirstCustomer"/> |
| 33 | + <deleteData createDataKey="createSecondCustomer" stepKey="deleteSecondCustomer"/> |
| 34 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginToDeleteNewAdmin"/> |
| 35 | + <actionGroup ref="AdminDeleteUserViaCurlActionGroup" stepKey="deleteNewAdmin"> |
| 36 | + <argument name="user" value="NewAdminUser"/> |
| 37 | + </actionGroup> |
| 38 | + <actionGroup ref="logout" stepKey="logoutAfter"/> |
| 39 | + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" |
| 40 | + stepKey="disableLoginAsCustomer"/> |
| 41 | + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> |
| 42 | + </after> |
| 43 | + |
| 44 | + <!-- Login into First Customer account --> |
| 45 | + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup" |
| 46 | + stepKey="loginAsFirstCustomerByDefaultAdmin"> |
| 47 | + <argument name="customerEmail" value="$$createFirstCustomer.email$$"/> |
| 48 | + </actionGroup> |
| 49 | + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutFirstCustomerDefaultAdmin"/> |
| 50 | + |
| 51 | + <!-- Login into Second Customer account --> |
| 52 | + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup" |
| 53 | + stepKey="loginAsSecondCustomerByDefaultAdmin"> |
| 54 | + <argument name="customerEmail" value="$$createSecondCustomer.email$$"/> |
| 55 | + </actionGroup> |
| 56 | + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutSecondCustomerDefaultAdmin"/> |
| 57 | + |
| 58 | + <!-- Log out as Default Admin User --> |
| 59 | + <actionGroup ref="logout" stepKey="logoutAsDefaultAdmin"/> |
| 60 | + |
| 61 | + <!-- Login as New Admin User --> |
| 62 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsNewUser"> |
| 63 | + <argument name="username" value="$$createNewAdmin.username$$"/> |
| 64 | + <argument name="password" value="$$createNewAdmin.password$$"/> |
| 65 | + </actionGroup> |
| 66 | + |
| 67 | + <!-- Login into First Customer account --> |
| 68 | + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup" |
| 69 | + stepKey="loginAsFirstCustomerByNewAdmin"> |
| 70 | + <argument name="customerEmail" value="$$createFirstCustomer.email$$"/> |
| 71 | + </actionGroup> |
| 72 | + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutFirstCustomerNewAdmin"/> |
| 73 | + |
| 74 | + <!-- Login into Second Customer account --> |
| 75 | + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerGirdPageActionGroup" |
| 76 | + stepKey="loginAsSecondCustomerByNewAdmin"> |
| 77 | + <argument name="customerEmail" value="$$createSecondCustomer.email$$"/> |
| 78 | + </actionGroup> |
| 79 | + <actionGroup ref="StorefrontSignOutAndCloseTabActionGroup" stepKey="signOutSecondCustomerNewAdmin"/> |
| 80 | + |
| 81 | + <!-- Navigate to Login As Customer Log page --> |
| 82 | + <actionGroup ref="AdminOpenLoginAsCustomerLogActionGroup" stepKey="gotoLoginAsCustomerLog"/> |
| 83 | + |
| 84 | + <!-- Perform assertions --> |
| 85 | + <actionGroup ref="AdminAssertLoginAsCustomerLogRecordActionGroup" stepKey="verifyDefaultAdminFirstCustomerLogRecord"> |
| 86 | + <argument name="rowNumber" value="4"/> |
| 87 | + <argument name="adminId" value="1"/> |
| 88 | + <argument name="customerId" value="$$createFirstCustomer.id$$"/> |
| 89 | + </actionGroup> |
| 90 | + <actionGroup ref="AdminAssertLoginAsCustomerLogRecordActionGroup" stepKey="verifyDefaultAdminSecondCustomerLogRecord"> |
| 91 | + <argument name="rowNumber" value="3"/> |
| 92 | + <argument name="adminId" value="1"/> |
| 93 | + <argument name="customerId" value="$$createSecondCustomer.id$$"/> |
| 94 | + </actionGroup> |
| 95 | + <actionGroup ref="AdminAssertLoginAsCustomerLogRecordActionGroup" stepKey="verifyNewAdminFirstCustomerLogRecord"> |
| 96 | + <argument name="rowNumber" value="2"/> |
| 97 | + <argument name="adminId" value="$$createNewAdmin.id$$"/> |
| 98 | + <argument name="customerId" value="$$createFirstCustomer.id$$"/> |
| 99 | + </actionGroup> |
| 100 | + <actionGroup ref="AdminAssertLoginAsCustomerLogRecordActionGroup" stepKey="verifyNewAdminSecondCustomerLogRecord"> |
| 101 | + <argument name="rowNumber" value="1"/> |
| 102 | + <argument name="adminId" value="$$createNewAdmin.id$$"/> |
| 103 | + <argument name="customerId" value="$$createSecondCustomer.id$$"/> |
| 104 | + </actionGroup> |
| 105 | + |
| 106 | + <!-- Log out as New Admin User --> |
| 107 | + <actionGroup ref="logout" stepKey="logoutAsNewAdmin"/> |
| 108 | + </test> |
| 109 | +</tests> |
0 commit comments