<?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="AssertSearchTermOnFrontendActionGroup">
        <annotations>
            <description>Fills the Storefront Search field with the provided Search Query. Clicks on Search. Validates that the URL is correct.</description>
        </annotations>
        <arguments>
            <argument name="searchQuery" type="string"/>
            <argument name="redirectUrl" type="string"/>
        </arguments>

        <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/>
        <waitForPageLoad stepKey="waitForFillField"/>
        <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/>
        <waitForPageLoad stepKey="waitForSearch"/>
        <seeInCurrentUrl url="{{redirectUrl}}" stepKey="checkUrl"/>
    </actionGroup>
</actionGroups>
