<?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="StoreFrontMediaGalleryAssertImageInCategoryDescriptionActionGroup">
        <arguments>
            <argument name="categoryEntity" defaultValue="SimpleSubCategory"/>
            <argument name="imageName" type="string"/>
        </arguments>
        <annotations>
            <description>Navigates to the category page on the storefront and asserts that the image is present in description.</description>
        </annotations>

        <amOnPage url="{{StorefrontHomePage.url}}" stepKey="openHomePage"/>
        <waitForPageLoad stepKey="waitForStorefrontPageLoad"/>
        <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryEntity.name)}}" stepKey="toCategory"/>
        <waitForPageLoad stepKey="waitForCategoryPage"/>
        <seeElement selector="{{StorefrontCategoryMainSection.imageSource(imageName)}}" stepKey="seeImage"/>
    </actionGroup>
</actionGroups>
