<?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="AdminRestoreDefaultYotpoConfigurationActionGroup">
        <arguments>
            <argument name="orderSyncFromDate"/>
            <argument name="orderSyncCustomStatuses" type="string" defaultValue="complete"/>
        </arguments>
        <amOnPage url="admin/admin/system_config/edit/section/yotpo/store/1/" stepKey="navigateToYotpoConfigurationOnDefaultStoreView"/>

        <!-- set Yotpo credentials -->
         <uncheckOption selector="{{AdminLoginToYotpo.OrderSyncFromDateCheckbox}}" stepKey="ClickOnOrderSyncFromDateEnabledCheckBox"/>
        <fillField userInput="{{orderSyncFromDate}}" selector="{{AdminLoginToYotpo.OrdersSyncFromDate}}" stepKey="restoreSyncDate"/>
        <uncheckOption selector="{{AdminLoginToYotpo.OrderSyncCustomStatusesCheckbox}}" stepKey="ClickOnOrderSyncCustomStatusesEnabledCheckbox"/>
        <selectOption userInput="{{orderSyncCustomStatuses}}" selector="{{AdminLoginToYotpo.OrdersSyncStatuses}}" stepKey="restoreSyncCustomStatuses"/>
        <click selector="{{AdminLoginToYotpo.SaveConfiguration}}" stepKey="ClickOnSaveConfig"/>
        <waitForPageLoad stepKey="waitForSaveConfig"/>
        <seeElement selector="{{AdminLoginToYotpo.SavedConfiguration}}" stepKey="checkConfigurationSaved"/>
    </actionGroup>
</actionGroups>
