<?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="FillShippingZipForm">
        <arguments>
            <argument name="address"/>
        </arguments>
        <conditionalClick stepKey="openShippingDetails" selector="{{CheckoutCartSummarySection.shippingHeading}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false"/>
        <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/>
        <waitForElementVisible selector="{{CheckoutCartSummarySection.country}}" time="30" stepKey="waitForCountryFieldAppears"/>
        <selectOption stepKey="selectCountry" selector="{{CheckoutCartSummarySection.country}}" userInput="{{address.country}}"/>
        <selectOption stepKey="selectStateProvince" selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{address.state}}"/>
        <fillField stepKey="fillPostCode" selector="{{CheckoutCartSummarySection.postcode}}" userInput="{{address.postcode}}"/>
        <waitForPageLoad stepKey="waitForFormUpdate"/>
    </actionGroup>
    <actionGroup name="FillShippingZipFormWithRegionProvince" extends="FillShippingZipForm">
        <remove keyForRemoval="selectStateProvince" />
        <fillField stepKey="fillStateProvince" selector="{{CheckoutCartSummarySection.stateProvinceFreeform}}" userInput="{{address.state}}" before="fillPostCode"/>
    </actionGroup>
</actionGroups>
