<?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="StorefrontClearCompareActionGroup">
        <annotations>
            <description>Clear the Compare Products list. Validate that the Compare Products list is empty.</description>
        </annotations>

        <waitForElementVisible selector="{{StorefrontComparisonSidebarSection.ClearAll}}" time="30" stepKey="waitForClearAll"/>
        <click selector="{{StorefrontComparisonSidebarSection.ClearAll}}" stepKey="clickClearAll"/>
        <waitForElementVisible selector="{{ModalConfirmationSection.OkButton}}" time="30" stepKey="waitForClearOk"/>
        <scrollTo selector="{{ModalConfirmationSection.OkButton}}" stepKey="scrollToClearOk"/>
        <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="clickClearOk"/>
        <waitForElementVisible selector="{{StorefrontMessagesSection.message('You cleared the comparison list.')}}" time="30" stepKey="assertMessageCleared"/>
        <waitForElementVisible selector="{{StorefrontComparisonSidebarSection.NoItemsMessage}}" time="30" stepKey="assertNoItems"/>
    </actionGroup>
</actionGroups>
