<?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">
    <!--Verify AssertSearchTermNotOnFrontend-->
    <actionGroup name="AssertSearchTermNotOnFrontendActionGroup">
        <annotations>
            <description>Goes to the Storefront. Fills the Search field with the provided Search Query. Clicks on Search. Validates that there are no results.</description>
        </annotations>
        <arguments>
            <argument name="searchQuery" type="string"/>
            <argument name="url_key" type="string"/>
        </arguments>

        <amOnPage url="{{StorefrontProductPage.url('url_key')}}" stepKey="goToMagentoStorefrontPage"/>
        <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/>
        <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/>
        <waitForPageLoad stepKey="waitForSearchTextBox"/>
        <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/>
        <waitForPageLoad stepKey="waitForSearch"/>
        <see selector="{{StorefrontMessagesSection.noticeMessage}}" userInput="Your search returned no results." stepKey="seeAssertSearchTermNotOnFrontendNoticeMessage"/>
    </actionGroup>
</actionGroups>
