<?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="SaveStoreConfigurationAndValidateFieldErrorActionGroup">
        <annotations>
            <description>Clicks on Save. Validates that the fields are required.</description>
        </annotations>
        <arguments>
            <argument name="inputFieldError" type="string"/>
            <argument name="errorMessageSelector" type="string"/>
            <argument name="errorMessage" type="string"/>
        </arguments>

        <comment userInput="saveStoreConfigurationAndValidateFieldError" stepKey="comment"/>
        <waitForElementVisible selector="{{StoreConfigSection.Save}}" stepKey="waitForSaveButton"/>
        <click selector="{{StoreConfigSection.Save}}" stepKey="clickSaveButton"/>
        <waitForElement selector="{{inputFieldError}}" stepKey="waitForErrorField"/>
        <waitForElementVisible selector="{{errorMessageSelector}}" stepKey="waitForErrorMessage"/>
        <see selector="{{errorMessageSelector}}" userInput="{{errorMessage}}" stepKey="seeErrorMessage"/>
    </actionGroup>
</actionGroups>
