<?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="StorefrontCustomerResetPasswordActionGroup">
        <annotations>
            <description>Goes to the Storefront Customer Sign-In page. Clicks on 'Forgot Password'. Fills Email Address. Clicks on Reset Password.</description>
        </annotations>
        <arguments>
            <argument name="email" type="string"/>
        </arguments>

        <amOnPage stepKey="amOnSignInPage" url="{{StorefrontCustomerSignInPage.url}}"/>
        <click stepKey="clickForgotPasswordLink" selector="{{StorefrontCustomerSignInFormSection.forgotPasswordLink}}"/>
        <see stepKey="seePageTitle" userInput="Forgot Your Password" selector="{{StorefrontForgotPasswordSection.pageTitle}}"/>
        
        <!-- Enter email and submit the forgot password form -->
        <fillField stepKey="fillEmailField" userInput="{{email}}" selector="{{StorefrontForgotPasswordSection.email}}"/>
        <click stepKey="clickResetPassword" selector="{{StorefrontForgotPasswordSection.resetMyPasswordButton}}"/>
        <waitForPageLoad stepKey="waitForPageLoaded"/>
    </actionGroup>
</actionGroups>
