<?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">
        <annotations>
            <description>Fills in the provided Address details (Country, State and Zip Code) in the 'Estimate Shipping and Tax' section of the Storefront Shopping Cart page.</description>
        </annotations>
        <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>
</actionGroups>
