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

    <section name="AdminPromoCartRuleSection">
        <element name="Reset" type="button" selector="#reset" timeout="30"/>
        <element name="Back" type="button" selector="#back" timeout="30"/>
        <element name="RuleName" type="input" selector="input[name='name']"/>
        <element name="Description" type="textarea" selector="textarea[name='description']"/>
        <element name="IsActiveSwitch" type="checkbox" selector="//div[@data-index='is_active']//label[@class='admin__actions-switch-label']"/>
        <element name="SelectWebsites" type="select" selector="//select[@name='website_ids']"/>
        <element name="SelectCustomerGroup" type="select" selector="//select[@name='customer_group_ids']"/>
        <element name="SelectCouponCode" type="select" selector="//select[@name='coupon_type']"/>
        <element name="CouponsCode" type="input" selector="//input[@name='coupon_code']"/>
        <element name="StatusValue" type="input" parameterized="true" selector="//div[@data-index='is_active']//div[@class='admin__actions-switch']/input[@type='checkbox'][@value='{{ruleStatus}}']"/>
        <element name="RuleInformationTab" type="button" selector="//div[@data-index='rule_information']/div[@class='fieldset-wrapper-title']"/>
        <element name="ActionTab" type="button" selector="//div[@data-index='actions']/div[@class='fieldset-wrapper-title']"/>
        <element name="SelectAction" type="select" selector="//select[@name='simple_action']"/>
        <element name="DiscountAmount" type="input" selector="//input[@name='discount_amount']"/>
        <element name="NumberOfGiftItems" type="input" selector="//input[@name='discount_amount']"/>
        <element name="Type" type="select" selector="//select[@name='extension_attributes[ampromo_rule][type]']"/>
        <element name="PromoItems" type="input" selector="//input[@name='extension_attributes[ampromo_rule][sku]']"/>
        <element name="MaxQtyDiscountIsAppliedTo" type="input" selector="//input[@name='discount_qty']"/>
        <element name="MaxAmountOfDiscount" type="input" selector="//input[@name='extension_attributes[amrules][max_discount]']"/>
        <element name="DiscountQtyStep" type="input" selector="//input[@name='discount_step']"/>
        <element name="NumberOfYProducts" type="input" selector="//input[@name='extension_attributes[amrules][nqty]']"/>
        <element name="AfterN" type="input" selector="//input[@name='extension_attributes[amrules][eachm]']"/>
        <element name="SetItemsBySKU" type="input" selector="//input[@name='extension_attributes[amrules][promo_skus]']"/>
        <element name="SetItemsByCategoryIDs" type="input" selector="//input[@name='extension_attributes[amrules][promo_cats]']"/>
        <element name="ApplyToShippingAmount" type="checkbox" selector="//div[@data-index='apply_to_shipping']//label[@class='admin__actions-switch-label']"/>
        <element name="DiscardSubsequentRules" type="checkbox" selector="//div[@data-index='stop_rules_processing']//label[@class='admin__actions-switch-label']"/>
        <element name="ApplyTaxOnOriginalPrice" type="checkbox" selector="//div[@data-index='ampromorule[apply_tax]']//label[@class='admin__actions-switch-label']"/>
        <element name="ApplyShippingOnPromoFree" type="checkbox" selector="//div[@data-index='ampromorule[apply_shipping]']//label[@class='admin__actions-switch-label']"/>
        <element name="ActivateRule" type="checkbox" selector="//div[@data-index='is_active']//label[@class='admin__actions-switch-label']"/>
        <element name="DiscountTab" type="button" selector="//div[@data-index='ampromorule_items_price']/div[@class='fieldset-wrapper-title']"/>
        <element name="PromoItemsDiscountField" type="input" selector="//input[@name='extension_attributes[ampromo_rule][items_discount]']"/>
        <element name="MinimalPrice" type="input" selector="//input[@name='extension_attributes[ampromo_rule][minimal_items_price]']"/>
        <element name="OrdersSubselectionConditionOperator" type="button"
                 selector="//div[@data-index='conditions']//select[@id='conditions__1--1__attribute']/../../a"/>
        <element name="OrdersSubselectionCondition" type="select"
                 selector="//div[@data-index='conditions']//select[@id='conditions__1--1__attribute']"/>
        <element name="OrdersSubselectionConditionOperatorIs" type="block"
                 selector="//input/following-sibling::span//select[contains(@name, 'operator')]/parent::span/parent::span/a"/>
        <element name="OrdersSubselectionConditionSelectOperator" type="block"
                 selector="//input/following-sibling::span//select[contains(@name, 'operator')]"/>
        <element name="OrdersSubselectionConditionValueNoActive" type="block"
                 selector="//input/following-sibling::span//a[contains(string(), '...')]"/>
        <element name="OrdersSubselectionConditionInput" type="block"
                 selector="//input/following-sibling::span//input[contains(@name,'value')]"/>
        <element name="SubConditionSelectOption" type="select"
                 selector="//div[@data-index='conditions']//select[@id='conditions__1--1__new_child']"/>
        <element name="OpenChooserButton" type="button" selector="//label[@class='addafter']/a"/>
        <element name="CustomOptionsGrid" type="block" selector="//div[contains(@id, 'customoptions_grid_chooser')]"/>
        <element name="CustomOptionIdBySku" type="block" parameterized="true"
                 selector="//tbody/tr/td[contains(string(), '{{sku}}')]//../td[contains(@class, 'col-option_id col-number')]"/>
    </section>
</sections>
