<?xml version="1.0" encoding="UTF-8"?>
<!--
 /**
  * Copyright 2024 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="StorefrontSelectShippingMethodBasedOnAddressActionGroup">
        <annotations>
            <description>Select first available shipping method for each address to handle dynamic carrier API responses.</description>
        </annotations>
        <!-- Select first available shipping method for Germany/Berlin address -->
        <waitForElementClickable selector="{{ShippingMethodSection.firstShippingMethodForCity('Berlin')}}" stepKey="waitForBerlinShippingMethod"/>
        <click selector="{{ShippingMethodSection.firstShippingMethodForCity('Berlin')}}" stepKey="clickToSelectBerlinMethod"/>
        <!-- Select first available shipping method for London address -->
        <click selector="{{ShippingMethodSection.firstShippingMethodForCity('London')}}" stepKey="clickToSelectLondonMethod"/>
        <!-- Select first available shipping method for New York address -->
        <click selector="{{ShippingMethodSection.firstShippingMethodForCity('New York')}}" stepKey="clickToSelectNewYorkMethod"/>
        <!-- Select first available shipping method for Culver City address -->
        <click selector="{{ShippingMethodSection.firstShippingMethodForCity('Culver City')}}" stepKey="clickToSelectCulverCityMethod"/>
    </actionGroup>
</actionGroups>
