<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * @author Amasty Team
 * @copyright Copyright (c) 2023 Amasty (https://www.amasty.com)
 * @package Common Tests for Magento 2 (System)
 */-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">

    <actionGroup name="ChooseCurrency">
        <arguments>
            <argument name="currencies"/>
        </arguments>
        <amOnPage url="{{FrontMainPage.url}}" stepKey="navigateFrontMainPage1"/>
        <waitForPageLoad time="100" stepKey="waitForPageLoad1"/>
        <click selector="//div[@id='switcher-currency-trigger']" stepKey="clickCurrencyButton"/>
        <waitForPageLoad time="20" stepKey="waitForPageLoad2"/>
        <click selector="//div[@id='switcher-currency']//ul[@class='dropdown switcher-dropdown']//a[text()='{{currencies.currencyName}}']" stepKey="chooseOpenRuleForEdit"/>
        <waitForPageLoad time="100" stepKey="waitForPageLoad3"/>
    </actionGroup>

    <!-- For Open Home Page and Change Store View -->
    <actionGroup name="StorefrontSwitchStoreViewOnHomePage" extends="StorefrontSwitchStoreViewActionGroup">
        <amOnPage url="{{FrontMainPage.url}}" before="clickStoreViewSwitcher" stepKey="navigateStorefrontHome"/>
    </actionGroup>

    <!-- For Open Home Page and Sign Out from Account -->
    <actionGroup name="StorefrontSignOutOnHomePage" extends="StorefrontSignOutActionGroup">
        <amOnPage url="{{FrontMainPage.url}}" before="clickCustomerButton" stepKey="navigateStorefrontHome"/>
    </actionGroup>

</actionGroups>