|
| 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="LockAdminUserWhenCreatingNewIntegrationTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Security"/> |
| 14 | + <stories value="Runs Lock admin user when creating new integration test."/> |
| 15 | + <title value="Lock admin user when creating new integration"/> |
| 16 | + <description value="Runs Lock admin user when creating new integration test."/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <group value="security"/> |
| 19 | + <group value="mtf_migrated"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Log in to Admin Panel --> |
| 23 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 24 | + </before> |
| 25 | + <after> |
| 26 | + <!-- Unlock Admin user --> |
| 27 | + <magentoCLI command="admin:user:unlock {{_ENV.MAGENTO_ADMIN_USERNAME}}" stepKey="unlockAdminUser"/> |
| 28 | + </after> |
| 29 | + |
| 30 | + <!-- Open Admin New Integration Page --> |
| 31 | + <amOnPage url="{{AdminNewIntegrationPage.url}}" stepKey="amOnNewAdminIntegrationPage"/> |
| 32 | + <waitForPageLoad stepKey="waitForNewAdminIntegrationPageLoad"/> |
| 33 | + |
| 34 | + <!-- Perform add new admin user 6 specified number of times. |
| 35 | + "The password entered for the current user is invalid. Verify the password and try again." appears after each attempt.--> |
| 36 | + <actionGroup ref="AdminNewIntegrationRequiredFieldsActionGroup" stepKey="failedSaveIntegrationFirstAttempt"> |
| 37 | + <argument name="integrationName" value="{{AdminNewIntegrationData.integrationName}}" /> |
| 38 | + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> |
| 39 | + <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> |
| 40 | + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> |
| 41 | + </actionGroup> |
| 42 | + |
| 43 | + <actionGroup ref="AdminNewIntegrationRequiredFieldsActionGroup" stepKey="failedSaveIntegrationSecondAttempt"> |
| 44 | + <argument name="integrationName" value="{{AdminNewIntegrationData.integrationName}}" /> |
| 45 | + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> |
| 46 | + <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> |
| 47 | + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> |
| 48 | + </actionGroup> |
| 49 | + |
| 50 | + <actionGroup ref="AdminNewIntegrationRequiredFieldsActionGroup" stepKey="failedSaveIntegrationThirdAttempt"> |
| 51 | + <argument name="integrationName" value="{{AdminNewIntegrationData.integrationName}}" /> |
| 52 | + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> |
| 53 | + <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> |
| 54 | + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> |
| 55 | + </actionGroup> |
| 56 | + |
| 57 | + <actionGroup ref="AdminNewIntegrationRequiredFieldsActionGroup" stepKey="failedSaveIntegrationFourthAttempt"> |
| 58 | + <argument name="integrationName" value="{{AdminNewIntegrationData.integrationName}}" /> |
| 59 | + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> |
| 60 | + <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> |
| 61 | + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> |
| 62 | + </actionGroup> |
| 63 | + |
| 64 | + <actionGroup ref="AdminNewIntegrationRequiredFieldsActionGroup" stepKey="failedSaveIntegrationFifthAttempt"> |
| 65 | + <argument name="integrationName" value="{{AdminNewIntegrationData.integrationName}}" /> |
| 66 | + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> |
| 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 | + </actionGroup> |
| 70 | + |
| 71 | + <!-- Last invalid current password save integration attempt and check logout error --> |
| 72 | + <actionGroup ref="AdminNewIntegrationRequiredFieldsActionGroup" stepKey="failedSaveIntegrationLastAttempt"> |
| 73 | + <argument name="integrationName" value="{{AdminNewIntegrationData.integrationName}}" /> |
| 74 | + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> |
| 75 | + <argument name="messageSelector" value="{{AdminLoginFormSection.error}}" /> |
| 76 | + <argument name="message" value="Your account is temporarily disabled. Please try again later." /> |
| 77 | + </actionGroup> |
| 78 | + |
| 79 | + <!-- Try to login as admin and check error --> |
| 80 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsLockedAdmin"/> |
| 81 | + <waitForPageLoad stepKey="waitForError"/> |
| 82 | + <see selector="{{AdminLoginFormSection.error}}" userInput="The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later" |
| 83 | + stepKey="seeLoginUserError"/> |
| 84 | + </test> |
| 85 | +</tests> |
0 commit comments