<?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="SetAllPreferencesTypeToShowNo">
        <amOnPage url="{{AdminDotmailerConfigurationPage.url}}" stepKey="navigateToDotmailerConfigurationPage"/>
        <waitForPageLoad stepKey="waitForPageLoad"/>
        <conditionalClick stepKey="expandCustomerPreferencesTab" selector="{{AdminDotmailerConfigurationPreferencesSection.preferencesFieldsetToggle}}" dependentSelector="{{AdminDotmailerConfigurationPreferencesSection.preferencesFieldset}}" visible="false"/>
        <selectOption selector="{{AdminDotmailerConfigurationPreferencesSection.showPreferencesToCustomer}}" userInput="No" stepKey="setShowPreferencesDisabled"/>
        <selectOption selector="{{AdminDotmailerConfigurationPreferencesSection.showAddressBookToCustomer}}" userInput="No" stepKey="setShowBooksDisabled"/>
        <selectOption selector="{{AdminDotmailerConfigurationPreferencesSection.showDatafieldToCustomer}}" userInput="No" stepKey="setShowDataFieldsDisabled"/>
        <click selector="{{AdminMainActionsSection.save}}" stepKey="saveConfig" />
        <waitForPageLoad stepKey="waitForPageLoad2"/>
    </actionGroup>

    <actionGroup name="SetOnePreferenceTypeToShowYes">
        <amOnPage url="{{AdminDotmailerConfigurationPage.url}}" stepKey="navigateToDotmailerConfigurationPage1"/>
        <waitForPageLoad stepKey="waitForPageLoad3"/>
        <conditionalClick stepKey="expandCustomerPreferencesTab1" selector="{{AdminDotmailerConfigurationPreferencesSection.preferencesFieldsetToggle}}" dependentSelector="{{AdminDotmailerConfigurationPreferencesSection.preferencesFieldset}}" visible="false"/>
        <selectOption selector="{{AdminDotmailerConfigurationPreferencesSection.showPreferencesToCustomer}}" userInput="Yes" stepKey="setShowPreferencesEnabled"/>
        <selectOption selector="{{AdminDotmailerConfigurationPreferencesSection.showAddressBookToCustomer}}" userInput="No" stepKey="setShowBooksDisabled1"/>
        <selectOption selector="{{AdminDotmailerConfigurationPreferencesSection.showDatafieldToCustomer}}" userInput="No" stepKey="setShowDataFieldsDisabled1"/>
        <click selector="{{AdminMainActionsSection.save}}" stepKey="saveConfig1" />
        <waitForPageLoad stepKey="waitForPageLoad4"/>
    </actionGroup>
    <actionGroup name="SetCustomerConsentText">
        <amOnPage url="{{AdminDotmailerConfigurationPage.url}}" stepKey="navigateToDotmailerConfigurationPage3"/>
        <waitForPageLoad stepKey="waitForPageLoad5"/>
        <conditionalClick stepKey="expandConsentTab" selector="{{AdminDotmailerConfigurationConsentSection.consentFieldsetToggle}}" dependentSelector="{{AdminDotmailerConfigurationConsentSection.consentFieldset}}" visible="false"/>
        <fillField selector="{{AdminDotmailerConfigurationConsentSection.customerConsentText}}" userInput="Test consent text" stepKey="setConsentText"/>
        <click selector="{{AdminMainActionsSection.save}}" stepKey="saveConfig2" />
        <waitForPageLoad stepKey="waitForPageLoad6"/>
    </actionGroup>
    <actionGroup name="ResetCustomerConsentText">
        <amOnPage url="{{AdminDotmailerConfigurationPage.url}}" stepKey="navigateToDotmailerConfigurationPage3Reset"/>
        <waitForPageLoad stepKey="waitForPageLoad7"/>
        <conditionalClick stepKey="expandConsentTab2" selector="{{AdminDotmailerConfigurationConsentSection.consentFieldsetToggle}}" dependentSelector="{{AdminDotmailerConfigurationConsentSection.consentFieldset}}" visible="false"/>
        <clearField selector="{{AdminDotmailerConfigurationConsentSection.customerConsentText}}" stepKey="setConsentTextReset"/>
        <click selector="{{AdminMainActionsSection.save}}" stepKey="saveConfig3" />
        <waitForPageLoad stepKey="waitForPageLoad8"/>
    </actionGroup>
</actionGroups>
