<?xml version="1.0" encoding="UTF-8"?>
<!--
 /**
  * DISCLAIMER
  *
  * Do not edit or add to this file if you wish to upgrade Smile ElasticSuite to newer
  * versions in the future.
  *
  * @category  Smile
  * @package   Smile\ElasticsuiteThesaurus
  * @author    Dmytro ANDROSHCHUK <dmand@smile.fr>
  * @copyright 2020 Smile
  * @license   Open Software License ("OSL") v. 3.0
  */
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
    <actionGroup name="StorefrontSearchActionGroup">
        <arguments>
            <argument name="searchQuery" type="string"/>
        </arguments>
        <!--Run full reindex and clear caches -->
        <magentoCLI command="indexer:reindex" stepKey="reindex"/>
        <magentoCLI command="cache:flush" stepKey="flushCache"/>

        <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToFrontHomePage"/>
        <waitForPageLoad stepKey="waitForPageToLoad"/>
        <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{searchQuery}}" stepKey="fillSearchBox"/>
        <waitForPageLoad stepKey="waitForSearchTextBox"/>
        <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/>
        <waitForPageLoad stepKey="waitForSearch"/>
    </actionGroup>
</actionGroups>
