|
| 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="StorefrontLockCustomerOnLoginPageTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Customer"/> |
| 14 | + <title value="Lock customer on Storefront with after many attempts to log in with incorrect credentials"/> |
| 15 | + <description value="Lock customer on Storefront with after many attempts to log in with incorrect credentials"/> |
| 16 | + <group value="Customer"/> |
| 17 | + <group value="security"/> |
| 18 | + <group value="mtf_migrated"/> |
| 19 | + </annotations> |
| 20 | + <before> |
| 21 | + <magentoCLI command="config:set {{StorefrontCustomerCaptchaDisableConfigData.path}} {{StorefrontCustomerCaptchaDisableConfigData.value}}" stepKey="disableCaptcha"/> |
| 22 | + <magentoCLI command="config:set {{StorefrontCustomerLockoutFailures5ConfigData.path}} {{StorefrontCustomerLockoutFailures5ConfigData.value}}" stepKey="setInvalidAttemptsCountConfigTo5"/> |
| 23 | + <createData stepKey="customer" entity="Simple_US_Customer"/> |
| 24 | + </before> |
| 25 | + <after> |
| 26 | + <magentoCLI command="config:set {{StorefrontCustomerCaptchaEnableConfigData.path}} {{StorefrontCustomerCaptchaEnableConfigData.value}}" stepKey="enableCaptcha"/> |
| 27 | + <magentoCLI command="config:set {{StorefrontCustomerLockoutFailuresDefaultConfigData.path}} {{StorefrontCustomerLockoutFailuresDefaultConfigData.value}}" stepKey="revertInvalidAttemptsCountConfig"/> |
| 28 | + <deleteData stepKey="deleteCustomer" createDataKey="customer" /> |
| 29 | + </after> |
| 30 | + |
| 31 | + <actionGroup ref="StorefrontOpenCustomerLoginPageActionGroup" stepKey="goToSignInPage" /> |
| 32 | + |
| 33 | + <!-- Perform 5 attempts to log in with invalid credentials --> |
| 34 | + <actionGroup ref="StorefrontFillCustomerLoginFormWithWrongPasswordActionGroup" stepKey="fillLoginFormFirstAttempt"> |
| 35 | + <argument name="customer" value="$$customer$$"/> |
| 36 | + </actionGroup> |
| 37 | + <actionGroup ref="StorefrontClickSignOnCustomerLoginFormActionGroup" stepKey="clickSignInAccountButtonFirstAttempt"/> |
| 38 | + <actionGroup ref="AssertMessageCustomerLoginActionGroup" stepKey="seeErrorMessageAfterFirstAttempt"> |
| 39 | + <argument name="messageType" value="error"/> |
| 40 | + <argument name="message" value="The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later"/> |
| 41 | + </actionGroup> |
| 42 | + |
| 43 | + <actionGroup ref="StorefrontFillCustomerLoginFormWithWrongPasswordActionGroup" stepKey="fillLoginFormSecondAttempt"> |
| 44 | + <argument name="customer" value="$$customer$$"/> |
| 45 | + </actionGroup> |
| 46 | + <actionGroup ref="StorefrontClickSignOnCustomerLoginFormActionGroup" stepKey="clickSignInAccountButtonSecondAttempt"/> |
| 47 | + <actionGroup ref="AssertMessageCustomerLoginActionGroup" stepKey="seeErrorMessageAfterSecondAttempt"> |
| 48 | + <argument name="messageType" value="error"/> |
| 49 | + <argument name="message" value="The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later"/> |
| 50 | + </actionGroup> |
| 51 | + |
| 52 | + <actionGroup ref="StorefrontFillCustomerLoginFormWithWrongPasswordActionGroup" stepKey="fillLoginFormThirdAttempt"> |
| 53 | + <argument name="customer" value="$$customer$$"/> |
| 54 | + </actionGroup> |
| 55 | + <actionGroup ref="StorefrontClickSignOnCustomerLoginFormActionGroup" stepKey="clickSignInAccountButtonThirdAttempt"/> |
| 56 | + <actionGroup ref="AssertMessageCustomerLoginActionGroup" stepKey="seeErrorMessageAfterThirdAttempt"> |
| 57 | + <argument name="messageType" value="error"/> |
| 58 | + <argument name="message" value="The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later"/> |
| 59 | + </actionGroup> |
| 60 | + |
| 61 | + <actionGroup ref="StorefrontFillCustomerLoginFormWithWrongPasswordActionGroup" stepKey="fillLoginFormFourthAttempt"> |
| 62 | + <argument name="customer" value="$$customer$$"/> |
| 63 | + </actionGroup> |
| 64 | + <actionGroup ref="StorefrontClickSignOnCustomerLoginFormActionGroup" stepKey="clickSignInAccountButtonFourthAttempt"/> |
| 65 | + <actionGroup ref="AssertMessageCustomerLoginActionGroup" stepKey="seeErrorMessageAfterFourthAttempt"> |
| 66 | + <argument name="messageType" value="error"/> |
| 67 | + <argument name="message" value="The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later"/> |
| 68 | + </actionGroup> |
| 69 | + |
| 70 | + <actionGroup ref="StorefrontFillCustomerLoginFormWithWrongPasswordActionGroup" stepKey="fillLoginFormFifthAttempt"> |
| 71 | + <argument name="customer" value="$$customer$$"/> |
| 72 | + </actionGroup> |
| 73 | + <actionGroup ref="StorefrontClickSignOnCustomerLoginFormActionGroup" stepKey="clickSignInAccountButtonFifthAttempt"/> |
| 74 | + <actionGroup ref="AssertMessageCustomerLoginActionGroup" stepKey="seeErrorMessageAfterFifthAttempt"> |
| 75 | + <argument name="messageType" value="error"/> |
| 76 | + <argument name="message" value="The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later"/> |
| 77 | + </actionGroup> |
| 78 | + |
| 79 | + <!-- Make sure that the customer is locked --> |
| 80 | + <actionGroup ref="StorefrontFillCustomerLoginFormActionGroup" stepKey="fillLoginFormWithCorrectCredentials"> |
| 81 | + <argument name="customer" value="$$customer$$"/> |
| 82 | + </actionGroup> |
| 83 | + <actionGroup ref="StorefrontClickSignOnCustomerLoginFormActionGroup" stepKey="clickSignInAccountButtonWithCorrectCredentials"/> |
| 84 | + <actionGroup ref="AssertMessageCustomerLoginActionGroup" stepKey="seeLockoutErrorMessage"> |
| 85 | + <argument name="messageType" value="error"/> |
| 86 | + <argument name="message" value="The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later."/> |
| 87 | + </actionGroup> |
| 88 | + </test> |
| 89 | +</tests> |
0 commit comments