<?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="SwitchToPayPalGroupBtnActionGroup">
        <annotations>
            <description>Switch to Paypal group button</description>
        </annotations>
        <arguments>
            <argument name="elementNumber" type="string" defaultValue="0"/>
            <argument name="frameName" type="string" defaultValue="myFrame"/>
        </arguments>
        <!--set ID for iframe of PayPal group button-->
        <executeJS function="document.getElementsByClassName('component-frame')[{{elementNumber}}].setAttribute('name', '{{frameName}}');" stepKey="setIDForIframe"/>
        <!--switch to iframe of PayPal group button-->
        <switchToIFrame userInput="{{frameName}}" stepKey="switchToIframe"/>
        <waitForElementClickable selector="{{CheckoutPaymentSection.PayPalBtn}}" stepKey="waitForPayPalBtn"/>
        <click selector="{{CheckoutPaymentSection.PayPalBtn}}" stepKey="clickPayPalBtn"/>
        <switchToIFrame stepKey="switchBackToMainFrame"/>
    </actionGroup>
</actionGroups>
