<?xml version="1.0" encoding="UTF-8" ?>
<!--
 /**
  * @copyright  Vertex. All rights reserved.  https://www.vertexinc.com/
  * @author     Mediotype                     https://www.mediotype.com/
  */
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
    <actionGroup name="AssertCustomerNotInGridActionGroup">
        <arguments>
            <argument name="customer" type="entity"/>
        </arguments>

        <!-- Navigate to customer page -->
        <amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomers"/>
        <waitForPageLoad stepKey="waitForAdminCustomerPageLoad"/>

        <!-- Filter customer by email and validate no results -->
        <click selector="{{AdminCustomerFiltersSection.filtersButton}}" stepKey="clickFilterButton"/>
        <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="cleanFiltersIfTheySet"/>
        <waitForPageLoad stepKey="waitForClearFilters"/>
        <fillField selector="{{AdminCustomerFiltersSection.emailInput}}" userInput="{{customer.email}}" stepKey="filterEmail"/>
        <click selector="{{AdminCustomerFiltersSection.apply}}" stepKey="applyFilter"/>
        <waitForPageLoad stepKey="waitForPageToLoad"/>
        <see selector="{{AdminCustomerGridSection.customerGrid}}" userInput="We couldn't find any records." stepKey="seeEmptyRecordMessage"/>
    </actionGroup>
</actionGroups>
