<?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="AssertStorefrontUrlRewriteRedirect">
        <arguments>
            <argument name="category" type="string"/>
            <argument name="newRequestPath" type="string"/>
        </arguments>
        <amOnPage url="{{newRequestPath}}" stepKey="openCategoryInStorefront"/>
        <waitForPageLoad stepKey="waitForCategoryPageToLoad"/>
        <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(category)}}" stepKey="seeCategoryOnStoreNavigationBar"/>
        <seeElement selector="{{StorefrontCategoryMainSection.CategoryTitle(category)}}" stepKey="seeCategoryInTitle"/>
    </actionGroup>
    <actionGroup name="AssertStorefrontProductRedirect">
        <arguments>
            <argument name="productName" type="string"/>
            <argument name="productSku" type="string"/>
            <argument name="productRequestPath" type="string"/>
        </arguments>
        <amOnPage url="{{productRequestPath}}" stepKey="openCategoryInStorefront"/>
        <waitForPageLoad stepKey="waitForCategoryPageToLoad"/>
        <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{productName}}" stepKey="seeProductNameInStoreFrontPage"/>
        <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{productSku}}" stepKey="seeProductSkuInStoreFrontPage"/>
    </actionGroup>
</actionGroups>
