<?xml version="1.0" encoding="UTF-8"?>
<!--
 /**
  * Copyright © Magento, Inc. All rights reserved.
  * See COPYING.txt for license details.
  */
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
    <actionGroup name="AdminResetPasswordUsingOldPasswordActionGroup">
        <annotations>
            <description>Reset password using old password on All Users page.</description>
        </annotations>
        <fillField selector="{{AdminEditUserSection.passwordTextField}}" userInput="123123aaa" stepKey="enterPassword"/>
        <fillField selector="{{AdminEditUserSection.pwConfirmationTextField}}" userInput="123123aaa" stepKey="confirmPassword"/>
        <click selector="{{AdminEditUserSection.saveButton}}" stepKey="clickSaveUser"/>
        <waitForPageLoad stepKey="waitForPageLoad"/>
        <see userInput="This is a required field." stepKey="seeRequiredField"/>
        <fillField selector="{{AdminEditUserSection.currentPasswordField}}" userInput="Invalid12345678" stepKey="enterWrongPassword"/>
        <click selector="{{AdminEditUserSection.saveButton}}" stepKey="clickSaveUser1"/>
        <waitForPageLoad stepKey="waitForPageLoad1"/>
        <scrollToTopOfPage stepKey="scrollToTopOfPage"/>
        <see userInput="The password entered for the current user is invalid. Verify the password and try again." stepKey="seeErrorMessage"/>
        <fillField selector="{{AdminEditUserSection.passwordTextField}}" userInput="123123aaa" stepKey="enterPassword1"/>
        <fillField selector="{{AdminEditUserSection.pwConfirmationTextField}}" userInput="123123aaa" stepKey="confirmPassword1"/>
        <fillField selector="{{AdminEditUserSection.currentPasswordField}}" userInput="{{_CREDS.magento/MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword"/>
        <click selector="{{AdminEditUserSection.saveButton}}" stepKey="clickSaveUser2"/>
        <waitForPageLoad stepKey="waitForPageLoad2"/>
        <see userInput="You saved the user." stepKey="seeSuccessMessage"/>

    </actionGroup>
</actionGroups>

