<?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="AssertStorefrontAddToCartFormKeyValueIsNotCachedActionGroup">
        <annotations>
            <description>Assert that product page add to cart form key is different from cached value.</description>
        </annotations>
        <arguments>
            <argument name="cachedValue" type="string"/>
        </arguments>

        <grabValueFrom selector="{{StorefrontProductActionSection.inputFormKey}}" stepKey="grabUpdatedValue"/>
        <assertRegExp stepKey="validateCachedFormKey">
            <expectedResult type="string">/\w{16}/</expectedResult>
            <actualResult type="string">{{cachedValue}}</actualResult>
        </assertRegExp>
        <assertRegExp stepKey="validateUpdatedFormKey">
            <expectedResult type="string">/\w{16}/</expectedResult>
            <actualResult type="variable">grabUpdatedValue</actualResult>
        </assertRegExp>
        <assertNotEquals stepKey="assertFormKeyUpdated">
            <expectedResult type="string">{{cachedValue}}</expectedResult>
            <actualResult type="variable">grabUpdatedValue</actualResult>
        </assertNotEquals>
    </actionGroup>
</actionGroups>
