<?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="ProductSetWebsiteActionGroup">
        <annotations>
            <description>Sets the provided Website on the Admin Product creation/edit page.</description>
        </annotations>
        <arguments>
            <argument name="website" type="string"/>
        </arguments>

        <scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToWebsites"/>
        <conditionalClick selector="{{ProductInWebsitesSection.sectionHeader}}" dependentSelector="{{ProductInWebsitesSection.website(website)}}" visible="false" stepKey="clickToOpenProductInWebsite"/>
        <waitForPageLoad stepKey="waitForPageOpened"/>
        <click selector="{{ProductInWebsitesSection.website(website)}}" stepKey="selectWebsite"/>
        <click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct"/>
        <waitForPageLoad time='60' stepKey="waitForProducrSaved"/>
        <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSaveSuccessMessage"/>
        <see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveSuccessMessage"/>
    </actionGroup>
</actionGroups>
