<?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="NewCatalogPriceRuleWithInvalidDataActionGroup">
        <annotations>
            <description>Goes to the Catalog Price Rule grid. Clicks on Add. Fills in the provided Catalog Rule details with invalid data.</description>
        </annotations>
        <arguments>
            <argument name="catalogRule" defaultValue="catalogRuleWithInvalid"/>
        </arguments>

        <!-- Go to the admin Catalog rule grid and add a new one -->
        <amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/>
        <waitForPageLoad stepKey="waitForPriceRulePage"/>

        <click stepKey="addNewRule" selector="{{AdminGridMainControls.add}}"/>
        <fillField stepKey="fillPriority" selector="{{AdminNewCatalogPriceRule.priority}}" userInput="{{catalogRule.priority}}"/>
        <scrollToTopOfPage stepKey="scrollToTop"/>
        <click selector="{{AdminNewCatalogPriceRule.save}}" stepKey="clickSave"/>
        <waitForPageLoad stepKey="waitForApplied"/>
    </actionGroup>
</actionGroups>
