<?xml version="1.0" encoding="UTF-8"?>
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
    <actionGroup name="AdminResetReCaptchaConfigurationActionGroup">
        <annotations>
            <description>Reset reCaptcha configuration.</description>
        </annotations>
        <arguments>
            <argument name="websiteKey" defaultValue="{{_CREDS.reCaptcha/website_key}}" type="string"/>
            <argument name="secretKey" defaultValue="{{_CREDS.reCaptcha/secret_key}}" type="string"/>
        </arguments>

        <!-- Save website and secret key -->
        <conditionalClick selector="{{AdminConfigurationReCaptchaSection.defaultLayoutsTab}}" dependentSelector="{{AdminConfigurationReCaptchaSection.checkIfTabExpand}}" visible="true" stepKey="clickTabReCaptchaV3"/>
        <fillField selector="{{AdminConfigurationReCaptchaSection.websiteKey}}" userInput="{{websiteKey}}" stepKey="fillReCaptchaWebsiteKey"/>
        <fillField selector="{{AdminConfigurationReCaptchaSection.secretKey}}" userInput="{{secretKey}}" stepKey="fillReCaptchaSecretKey"/>

        <!-- Show ReCaptcha for checkout Page -->
        <conditionalClick selector="{{AdminConfigurationReCaptchaSection.defaultLayoutsTabStoreFront}}" dependentSelector="{{AdminConfigurationReCaptchaSection.checkIfTabExpandStoreFront}}" visible="true" stepKey="clickTabStoreFront"/>
        <checkOption selector="{{AdminConfigurationReCaptchaSection.enableCheckoutUseSystemValue}}" stepKey="checkCheckoutUseSystemValue"/>

        <!-- Save Configuration -->
        <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/>

        <!-- Clean Cache After Save Config -->
        <magentoCLI command="cache:clean config full_page" stepKey="cleanCache"/>
    </actionGroup>
</actionGroups>
