<?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="AssertStorefrontCheckoutCartItemsActionGroup">
        <annotations>
            <description>Validates that the provided Product details (Name, SKU, Price, Subtotal and Quantity) are present and correct on the Storefront Shopping Cart page.</description>
        </annotations>
        <arguments>
            <argument name="productName" type="string"/>
            <argument name="productPrice" type="string"/>
            <argument name="subtotal" type="string"/>
            <argument name="qty" type="string"/>
        </arguments>

        <waitForElementVisible selector="{{CheckoutCartProductSection.productName}}" time="60" stepKey="waitForProductNameVisible"/>
        <see selector="{{CheckoutCartProductSection.productName}}" userInput="{{productName}}"  stepKey="seeProductNameInCheckoutSummary"/>
        <see selector="{{CheckoutCartProductSection.ProductPriceByName(productName)}}" userInput="{{productPrice}}" stepKey="seeProductPriceInCart"/>
        <see selector="{{CheckoutCartProductSection.productSubtotalByName(productName)}}" userInput="{{subtotal}}" stepKey="seeSubtotalPrice"/>
        <seeInField selector="{{CheckoutCartProductSection.ProductQuantityByName(productName)}}" userInput="{{qty}}" stepKey="seeProductQuantity"/>
    </actionGroup>
</actionGroups>
