<?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="CreatedProductConnectToWebsiteActionGroup">
        <annotations>
            <description>Clicks on 'Edit' for the provided Product. Clicks on the provided Website. Clicks on Save.</description>
        </annotations>
        <arguments>
            <argument name="website"/>
            <argument name="product"/>
        </arguments>

        <click stepKey="openProduct" selector="{{AdminProductGridActionSection.productName(product.sku)}}"/>
        <waitForPageLoad stepKey="waitForProductPage"/>
        <scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="ScrollToWebsites"/>
        <click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="openWebsitesList"/>
        <waitForPageLoad stepKey="waitForWebsitesList"/>
        <click selector="{{ProductInWebsitesSection.website(website.name)}}" stepKey="SelectWebsite"/>
        <click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct"/>
        <waitForPageLoad stepKey="waitForSave"/>
    </actionGroup>
</actionGroups>
