Skip to content

Commit 32804ed

Browse files
author
Mohan Ahuja
committed
ACP2E-711: "Invalid Form Key. Please refresh the page." error occurs when changing the product limit in categories
- Created MFTF Test
1 parent 96e094f commit 32804ed

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="CatalogRememberPaginationTest">
12+
<annotations>
13+
<features value="PageCache"/>
14+
<stories value="FormKey"/>
15+
<title value="Form Key value should be updated from UI if pagination remember is enabled"/>
16+
<description value="Form Key value should be updated from UI in cookies, if catalog remember pagination is enabled and the form key is set"/>
17+
<testCaseId value="AC-"/>
18+
<useCaseId value="ACP2E-711"/>
19+
<severity value="MAJOR"/>
20+
<group value="pageCache"/>
21+
</annotations>
22+
<before>
23+
<!-- Create Data -->
24+
<createData entity="_defaultCategory" stepKey="createCategory"/>
25+
<createData entity="_defaultProduct" stepKey="createProduct">
26+
<requiredEntity createDataKey="createCategory"/>
27+
</createData>
28+
29+
<createData entity="RememberPaginationCatalogStorefrontConfig" stepKey="setRememberPaginationCatalogStorefrontConfig"/>
30+
31+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
32+
<argument name="tags" value="full_page config"/>
33+
</actionGroup>
34+
</before>
35+
<after>
36+
<!-- Delete and revert data -->
37+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
38+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
39+
<createData entity="DefaultCatalogStorefrontConfiguration" stepKey="setDefaultCatalogStorefrontConfiguration"/>
40+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
41+
<argument name="tags" value="full_page config"/>
42+
</actionGroup>
43+
</after>
44+
<actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage">
45+
<argument name="categoryName" value="$$createCategory.name$$"/>
46+
</actionGroup>
47+
<grabValueFrom selector="{{StorefrontProductActionSection.inputFormKey}}" stepKey="grabCachedValue"/>
48+
<resetCookie userInput="PHPSESSID" stepKey="resetSessionCookie"/>
49+
<resetCookie userInput="form_key" stepKey="resetFormKeyCookie"/>
50+
<actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="reopenCategoryPage">
51+
<argument name="categoryName" value="$$createCategory.name$$"/>
52+
</actionGroup>
53+
<grabValueFrom selector="{{StorefrontProductActionSection.inputFormKey}}" stepKey="grabCachedValue2"/>
54+
<assertEquals stepKey="matchFromKey">
55+
<expectedResult type="variable">grabCachedValue</expectedResult>
56+
<actualResult type="variable">grabCachedValue2</actualResult>
57+
</assertEquals>
58+
</test>
59+
</tests>

0 commit comments

Comments
 (0)