<?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="AssertSearchTermNotInGridActionGroup">
        <annotations>
            <description>Goes to the Catalog Search Term grid page. Searches for the provided Search Term. Validates that it is NOT present in the grid.</description>
        </annotations>
        <arguments>
            <argument name="searchQuery" type="string"/>
        </arguments>

        <amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openCatalogSearchIndexPage"/>
        <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/>
        <click selector="{{AdminCatalogSearchTermIndexSection.resetFilterButton}}" stepKey="clickOnResetButton"/>
        <waitForPageLoad stepKey="waitForPageToLoad"/>
        <fillField selector="{{AdminCatalogSearchTermIndexSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/>
        <click selector="{{AdminCatalogSearchTermIndexSection.searchButton}}" stepKey="clickSearchButton"/>
        <waitForPageLoad stepKey="waitForSearchResultToLoad"/>
        <see selector="{{AdminCatalogSearchTermIndexSection.emptyRecords}}" userInput="We couldn't find any records." stepKey="seeEmptyRecordMessage"/>
    </actionGroup>
</actionGroups>
