<?xml version="1.0" encoding="UTF-8"?>
    <!--
     /**
      * Copyright 2025 Adobe
      * All Rights Reserved.
      */
    -->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
    <actionGroup name="AdminEnableUPSActionGroup">
        <annotations>
            <description>Enable United Parcel Service XML shipping method in backend</description>
        </annotations>
        <arguments>
            <argument name="shipping" defaultValue="UPSShippingMethod"/>
        </arguments>
        <conditionalClick selector="{{AdminShippingMethodUPSSection.UPSTab}}" dependentSelector="{{AdminShippingMethodUPSSection.handlingFee}}" visible="false" stepKey="openUPSTab"/>
        <uncheckOption selector="{{AdminShippingMethodUPSSection.enableCheckoutCheckbox}}" stepKey="unCheckEnableForCheckout"/>
        <selectOption selector="{{AdminShippingMethodUPSSection.enableCheckoutSelect}}" userInput="{{shipping.enableCheckoutSelect}}" stepKey="selectEnableForCheckoutToYes"/>
        <uncheckOption selector="{{AdminShippingMethodUPSSection.carriersUPSTypeSystem}}" stepKey="unCheckTypeSystem"/>
        <selectOption selector="{{AdminShippingMethodUPSSection.carriersUpsType}}" userInput="UPS_REST" stepKey="selectRestOption"/>
        <uncheckOption selector="{{AdminShippingMethodUPSSection.carriersUpsGatewayRestUrlSystem}}" stepKey="unCheckGatewayRestUrlSystem"/>
        <fillField selector="{{AdminShippingMethodUPSSection.carriersUpsGatewayRestUrl}}" userInput="{{_CREDS.magento/carriers_ups_gateway_rest_url}}" stepKey="enterGateWayRestURl"/>
        <uncheckOption selector="{{AdminShippingMethodUPSSection.carriersUpsTrackingRestUrlSystem}}" stepKey="unCheckTrackingRestUrlSystem"/>
        <fillField selector="{{AdminShippingMethodUPSSection.carriersUpsTrackingRestUrl}}" userInput="{{_CREDS.magento/carriers_ups_tracking_rest_url}}" stepKey="enterTrackingRestURl"/>
        <comment userInput="BIC workaround" stepKey="enterAccessLicenseNumber"/>
        <fillField selector="{{AdminShippingMethodUPSSection.password}}" userInput="{{_CREDS.magento/carriers_ups_rest_password}}" stepKey="enterPassword"/>
        <fillField selector="{{AdminShippingMethodUPSSection.username}}" userInput="{{_CREDS.magento/carriers_ups_rest_username}}" stepKey="enterUsername"/>
        <uncheckOption selector="{{AdminShippingMethodUPSSection.modeCheckbox}}" stepKey="unCheckMode"/>
        <selectOption selector="{{AdminShippingMethodUPSSection.modeSelect}}" userInput="{{shipping.modeSelect}}" stepKey="selectModeToDevelopment"/>
        <fillField selector="{{AdminShippingMethodUPSSection.shipperNumberInput}}" userInput="{{_CREDS.magento/carriers_ups_rest_shipper_number}}" stepKey="enterShipperNumber"/>
        <selectOption selector="{{AdminShippingMethodUPSSection.showMethodIfNotApplicableSelect}}" userInput="{{shipping.showMethodIfNotApplicableSelect}}" stepKey="selectShowMethodIfNotApplicableToYes"/>
        <selectOption selector="{{AdminShippingMethodUPSSection.debugSelect}}" userInput="{{shipping.debugSelect}}" stepKey="selectDebugToYes"/>
        <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/>
        <waitForText selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="assertConfigurationSaved"/>
    </actionGroup>
</actionGroups>
