|
| 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="AdminChangUserAccessToLoginAsCustomerLogTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Login As Customer"/> |
| 14 | + <stories value="Permissions and ACl"/> |
| 15 | + <title value="Change admin user's access to 'Login as Customer Log'"/> |
| 16 | + <description |
| 17 | + value="Verify admin user's access to 'Login as Customer Log' can be changed"/> |
| 18 | + <severity value="CRITICAL"/> |
| 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 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUserBefore"/> |
| 26 | + |
| 27 | + <!--Create New Role--> |
| 28 | + <actionGroup ref="AdminOpenCreateRolePageActionGroup" stepKey="goToNewRolePage"/> |
| 29 | + <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillNewRoleForm"> |
| 30 | + <argument name="role" value="customRoleAllResources"/> |
| 31 | + </actionGroup> |
| 32 | + <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveNewRole"/> |
| 33 | + |
| 34 | + <!--Create New User--> |
| 35 | + <actionGroup ref="AdminCreateUserWithApiRoleActionGroup" stepKey="adminCreateUser"> |
| 36 | + <argument name="user" value="NewAdminUser"/> |
| 37 | + <argument name="role" value="customRoleAllResources"/> |
| 38 | + </actionGroup> |
| 39 | + </before> |
| 40 | + <after> |
| 41 | + <!--Delete new User--> |
| 42 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutNewUserAfter"/> |
| 43 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUserAfter"/> |
| 44 | + <actionGroup ref="AdminDeleteCustomUserActionGroup" stepKey="deleteNewUser"> |
| 45 | + <argument name="user" value="NewAdminUser"/> |
| 46 | + </actionGroup> |
| 47 | + |
| 48 | + <!--Delete new Role--> |
| 49 | + <actionGroup ref="AdminDeleteUserRoleActionGroup" stepKey="deleteCustomRoleAllResources"> |
| 50 | + <argument name="roleName" value="{{customRoleAllResources.rolename}}"/> |
| 51 | + </actionGroup> |
| 52 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/> |
| 53 | + |
| 54 | + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" |
| 55 | + stepKey="disableLoginAsCustomer"/> |
| 56 | + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> |
| 57 | + </after> |
| 58 | + |
| 59 | + <!-- Login as new User --> |
| 60 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logOutFromAdminPanel"/> |
| 61 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsNewUser"> |
| 62 | + <argument name="adminUser" value="NewAdminUser"/> |
| 63 | + </actionGroup> |
| 64 | + |
| 65 | + <!-- Verify new User has access to 'Login as Customer Log' --> |
| 66 | + <actionGroup ref="AdminOpenLoginAsCustomerLogFromMenuActionGroup" stepKey="openLoginAsCustomerLog"/> |
| 67 | + |
| 68 | + <!-- Revoke 'Login as Customer Log' access for new User --> |
| 69 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutNewUser"/> |
| 70 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsDefaultAdminUser"/> |
| 71 | + |
| 72 | + <actionGroup ref="AdminEditUserRoleActionGroup" stepKey="openEditUserRole"> |
| 73 | + <argument name="roleName" value="{{customRoleAllResources.rolename}}"/> |
| 74 | + </actionGroup> |
| 75 | + <actionGroup ref="AdminRevokeRoleResourceActionGroup" stepKey="revokeLoginAsCustomerAccess"> |
| 76 | + <argument name="resourceName" value="Login As Customer Log"/> |
| 77 | + </actionGroup> |
| 78 | + <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveEditedRole"/> |
| 79 | + |
| 80 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutDefaultAdminUserAfterRevoke"/> |
| 81 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsNewUserAfterRevoke"> |
| 82 | + <argument name="adminUser" value="NewAdminUser"/> |
| 83 | + </actionGroup> |
| 84 | + |
| 85 | + <!-- Verify new User no longer has access to 'Login as Customer Log' menu item --> |
| 86 | + <actionGroup ref="AdminLoginAsCustomerLogAbsentInMenuActionGroup" stepKey="verifyLoginAsCustomerLogAbsentInMenu"/> |
| 87 | + |
| 88 | + <!-- Verify new User no longer has access to 'Login as Customer Log' --> |
| 89 | + <actionGroup ref="AdminLoginAsCustomerLogPageNotAvailableActionGroup" stepKey="verifyLoginAsCustomerLogPageNotAvailable"/> |
| 90 | + </test> |
| 91 | +</tests> |
0 commit comments