|
| 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="AdminLockAdminUserWhenCreatingNewRoleTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Security"/> |
| 14 | + <stories value="Runs Lock admin user when creating new admin role test."/> |
| 15 | + <title value="Lock admin user when creating new admin role"/> |
| 16 | + <description value="Runs Lock admin user when creating new admin role test."/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="MC-14384" /> |
| 19 | + <group value="security"/> |
| 20 | + <group value="mtf_migrated"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!-- Log in to Admin Panel --> |
| 24 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 25 | + </before> |
| 26 | + <after> |
| 27 | + <!-- Unlock Admin user --> |
| 28 | + <magentoCLI command="admin:user:unlock {{_ENV.MAGENTO_ADMIN_USERNAME}}" stepKey="unlockAdminUser"/> |
| 29 | + </after> |
| 30 | + <!-- Perform add new role 6 specified number of times. --> |
| 31 | + <actionGroup ref="AdminOpenCreateRolePageActionGroup" stepKey="openCreateRolePage"/> |
| 32 | + |
| 33 | + <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillFieldFirstAttempt"> |
| 34 | + <argument name="role" value="roleAdministrator" /> |
| 35 | + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> |
| 36 | + </actionGroup> |
| 37 | + <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveRoleFirstAttempt"/> |
| 38 | + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="checkFirstSaveRoleError"> |
| 39 | + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> |
| 40 | + <argument name="messageType" value="error" /> |
| 41 | + </actionGroup> |
| 42 | + |
| 43 | + <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillFieldSecondAttempt"> |
| 44 | + <argument name="role" value="roleAdministrator" /> |
| 45 | + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> |
| 46 | + </actionGroup> |
| 47 | + <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveRoleSecondAttempt"/> |
| 48 | + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="checkSecondSaveRoleError"> |
| 49 | + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> |
| 50 | + <argument name="messageType" value="error" /> |
| 51 | + </actionGroup> |
| 52 | + |
| 53 | + <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillFieldThirdAttempt"> |
| 54 | + <argument name="role" value="roleAdministrator" /> |
| 55 | + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> |
| 56 | + </actionGroup> |
| 57 | + <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveRoleThirdAttempt"/> |
| 58 | + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="checkThirdSaveRoleError"> |
| 59 | + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> |
| 60 | + <argument name="messageType" value="error" /> |
| 61 | + </actionGroup> |
| 62 | + |
| 63 | + <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillFieldFourthAttempt"> |
| 64 | + <argument name="role" value="roleAdministrator" /> |
| 65 | + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> |
| 66 | + </actionGroup> |
| 67 | + <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveRoleFourthAttempt"/> |
| 68 | + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="checkFourthSaveRoleError"> |
| 69 | + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> |
| 70 | + <argument name="messageType" value="error" /> |
| 71 | + </actionGroup> |
| 72 | + |
| 73 | + <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillFieldFifthAttempt"> |
| 74 | + <argument name="role" value="roleAdministrator" /> |
| 75 | + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> |
| 76 | + </actionGroup> |
| 77 | + <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveRoleFifthAttempt"/> |
| 78 | + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="checkFifthSaveRoleError"> |
| 79 | + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> |
| 80 | + <argument name="messageType" value="error" /> |
| 81 | + </actionGroup> |
| 82 | + |
| 83 | + <actionGroup ref="AdminFillUserRoleFormActionGroup" stepKey="fillFieldSixthAttempt"> |
| 84 | + <argument name="role" value="roleAdministrator" /> |
| 85 | + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> |
| 86 | + </actionGroup> |
| 87 | + <actionGroup ref="AdminClickSaveButtonOnUserRoleFormActionGroup" stepKey="saveRoleSixthAttempt"/> |
| 88 | + <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="checkFifthError"> |
| 89 | + <argument name="message" value="Your account is temporarily disabled. Please try again later."/> |
| 90 | + </actionGroup> |
| 91 | + |
| 92 | + <!-- Try to login as admin and check error message --> |
| 93 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsLockedAdmin"/> |
| 94 | + <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="checkLoginMessage"/> |
| 95 | + </test> |
| 96 | +</tests> |
0 commit comments