<?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="AdminDisablePayPalPayFlowLinkActionGroup">
        <annotations>
            <description>Goes to the 'Configuration' page for 'Payment Methods'. Disables PayPal payflow link solution. Clicks on Save.</description>
        </annotations>
        <arguments>
            <argument name="countryCode" type="string" defaultValue="us"/>
        </arguments>
        <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/>
        <waitForPageLoad stepKey="waitForPageLoad1"/>
        <scrollTo selector="{{AdminPayPalPayFlowLinkConfigSection.paymentGateway(countryCode)}}" stepKey="scrollToConfigure"/>
        <waitForElementVisible selector="{{AdminPayPalPayFlowLinkConfigSection.configureBtn(countryCode)}}" stepKey="waitForPayPalPayFlowPaymentConfigureBtn"/>
        <conditionalClick selector ="{{AdminPayPalPayFlowLinkConfigSection.configureBtn(countryCode)}}" dependentSelector="{{AdminPayPalPayFlowLinkConfigSection.configureBtn(countryCode)}}" visible="true" stepKey="clickPayPalPayFlowPaymentConfigureBtn"/>
        <waitForElementClickable selector ="{{AdminPayPalPayFlowLinkConfigSection.enableSolution(countryCode)}}" stepKey="waitForSolutionFieldToBeClickable"/>
        <selectOption selector ="{{AdminPayPalPayFlowLinkConfigSection.enableSolution(countryCode)}}" userInput="No" stepKey="disableSolution"/>
        <waitForElementClickable selector ="{{AdminConfigSection.saveButton}}" stepKey="waitForSaveConfigToBeVisible"/>
        <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/>
        <waitForPageLoad stepKey="waitForSaving"/>
    </actionGroup>
</actionGroups>
