|
| 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="LockAdminUserWhenEditingUserTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Security"/> |
| 14 | + <stories value="Runs Lock admin user when creating new user test."/> |
| 15 | + <title value="Lock admin user when creating new user"/> |
| 16 | + <description value="Runs Lock admin user when creating new user test."/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <group value="security"/> |
| 19 | + <group value="mtf_migrated"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <createData entity="Admin3" stepKey="user"/> |
| 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 | + <!-- TODO Need to create delete operation for data entity="Admin3" |
| 30 | + <deleteData createDataKey="user" stepKey="removeAdminUser"/>--> |
| 31 | + </after> |
| 32 | + |
| 33 | + <actionGroup ref="AdminEditUserActionGroup" stepKey="editUserFirstAttempt"> |
| 34 | + <argument name="adminUser" value="$$user.username$$"/> |
| 35 | + <argument name="adminFirstname" value="NEW$$user.firstname$$"/> |
| 36 | + <argument name="adminLastname" value="NEW$$user.lastname$$"/> |
| 37 | + <argument name="adminEmail" value="new$$user.email$$"/> |
| 38 | + <argument name="adminPassword" value="NEW$$user.password$$"/> |
| 39 | + <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> |
| 40 | + <argument name="adminUserRole" value="1"/> |
| 41 | + <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> |
| 42 | + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> |
| 43 | + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID"/> |
| 44 | + </actionGroup> |
| 45 | + |
| 46 | + <actionGroup ref="AdminEditUserActionGroup" stepKey="editUserSecondAttempt"> |
| 47 | + <argument name="adminUser" value="$$user.username$$"/> |
| 48 | + <argument name="adminFirstname" value="NEW$$user.firstname$$"/> |
| 49 | + <argument name="adminLastname" value="NEW$$user.lastname$$"/> |
| 50 | + <argument name="adminEmail" value="new$$user.email$$"/> |
| 51 | + <argument name="adminPassword" value="NEW$$user.password$$"/> |
| 52 | + <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> |
| 53 | + <argument name="adminUserRole" value="1"/> |
| 54 | + <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> |
| 55 | + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> |
| 56 | + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID"/> |
| 57 | + </actionGroup> |
| 58 | + |
| 59 | + <actionGroup ref="AdminEditUserActionGroup" stepKey="editUserThirdAttempt"> |
| 60 | + <argument name="adminUser" value="$$user.username$$"/> |
| 61 | + <argument name="adminFirstname" value="NEW$$user.firstname$$"/> |
| 62 | + <argument name="adminLastname" value="NEW$$user.lastname$$"/> |
| 63 | + <argument name="adminEmail" value="new$$user.email$$"/> |
| 64 | + <argument name="adminPassword" value="NEW$$user.password$$"/> |
| 65 | + <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> |
| 66 | + <argument name="adminUserRole" value="1"/> |
| 67 | + <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> |
| 68 | + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> |
| 69 | + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID"/> |
| 70 | + </actionGroup> |
| 71 | + |
| 72 | + <actionGroup ref="AdminEditUserActionGroup" stepKey="editUserFourthAttempt"> |
| 73 | + <argument name="adminUser" value="$$user.username$$"/> |
| 74 | + <argument name="adminFirstname" value="NEW$$user.firstname$$"/> |
| 75 | + <argument name="adminLastname" value="NEW$$user.lastname$$"/> |
| 76 | + <argument name="adminEmail" value="new$$user.email$$"/> |
| 77 | + <argument name="adminPassword" value="NEW$$user.password$$"/> |
| 78 | + <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> |
| 79 | + <argument name="adminUserRole" value="1"/> |
| 80 | + <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> |
| 81 | + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> |
| 82 | + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID"/> |
| 83 | + </actionGroup> |
| 84 | + |
| 85 | + <actionGroup ref="AdminEditUserActionGroup" stepKey="editUserFifthAttempt"> |
| 86 | + <argument name="adminUser" value="$$user.username$$"/> |
| 87 | + <argument name="adminFirstname" value="NEW$$user.firstname$$"/> |
| 88 | + <argument name="adminLastname" value="NEW$$user.lastname$$"/> |
| 89 | + <argument name="adminEmail" value="new$$user.email$$"/> |
| 90 | + <argument name="adminPassword" value="NEW$$user.password$$"/> |
| 91 | + <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> |
| 92 | + <argument name="adminUserRole" value="1"/> |
| 93 | + <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> |
| 94 | + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> |
| 95 | + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID"/> |
| 96 | + </actionGroup> |
| 97 | + |
| 98 | + <actionGroup ref="AdminEditUserActionGroup" stepKey="openEditLastPage"> |
| 99 | + <argument name="adminUser" value="$$user.username$$"/> |
| 100 | + <argument name="adminFirstname" value="NEW$$user.firstname$$"/> |
| 101 | + <argument name="adminLastname" value="NEW$$user.lastname$$"/> |
| 102 | + <argument name="adminEmail" value="new$$user.email$$"/> |
| 103 | + <argument name="adminPassword" value="NEW$$user.password$$"/> |
| 104 | + <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> |
| 105 | + <argument name="adminUserRole" value="1"/> |
| 106 | + <argument name="messageSelector" value="{{AdminLoginFormSection.error}}" /> |
| 107 | + <argument name="message" value="Your account is temporarily disabled. Please try again later." /> |
| 108 | + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID"/> |
| 109 | + </actionGroup> |
| 110 | + |
| 111 | + <!-- Try to login as admin and check error --> |
| 112 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsLockedAdmin"/> |
| 113 | + <waitForPageLoad stepKey="waitForError"/> |
| 114 | + <see selector="{{AdminLoginFormSection.error}}" userInput="The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later" |
| 115 | + stepKey="seeLoginUserError"/> |
| 116 | + </test> |
| 117 | +</tests> |
0 commit comments