Skip to content

Commit dec5266

Browse files
authored
Merge pull request #2452 from magento-tango/MAGETWO-71537-2
[tango] MAGETWO-71537: Cache invalidation after saving catalog - RIATCS-340
2 parents 23df0f3 + 3cb293e commit dec5266

File tree

7 files changed

+205
-0
lines changed

7 files changed

+205
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="CheckItemInLayeredNavigationActionGroup">
11+
<arguments>
12+
<argument name="itemType"/>
13+
<argument name="itemName"/>
14+
</arguments>
15+
<conditionalClick selector="{{StorefrontCategorySidebarSection.filterOptionsTitle('itemType')}}" dependentSelector="{{StorefrontCategorySidebarSection.filterOptions}}" visible="false" stepKey="expandFilterOptions"/>
16+
</actionGroup>
17+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
9+
<actionGroup name="OpenProductFromCategoryPageActionGroup">
10+
<arguments>
11+
<argument name="category"/>
12+
<argument name="product"/>
13+
</arguments>
14+
<!-- Go to storefront category page -->
15+
<amOnPage url="{{StorefrontCategoryPage.url(category.custom_attributes[url_path])}}" stepKey="navigateToCategoryPage"/>
16+
<!-- Go to storefront product page -->
17+
<click selector="{{StorefrontCategoryMainSection.specifiedProductItemInfo(product.name)}}" stepKey="openProductPage"/>
18+
<waitForAjaxLoad stepKey="waitForImageLoader"/>
19+
</actionGroup>
20+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
10+
<section name="AdminCategoryWarningMessagesPopupSection">
11+
<element name="warningMessage" type="text" selector=".modal-inner-wrap .modal-content .message.message-notice"/>
12+
<element name="cancelButton" type="button" selector=".modal-inner-wrap .action-secondary"/>
13+
<element name="okButton" type="button" selector=".modal-inner-wrap .action-primary" timeout="30"/>
14+
</section>
15+
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/StorefrontCategoryMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<section name="StorefrontCategoryMainSection">
1212
<element name="CategoryTitle" type="text" selector="#page-title-heading span"/>
1313
<element name="ProductItemInfo" type="button" selector=".product-item-info"/>
14+
<element name="specifiedProductItemInfo" type="button" selector="//a[@class='product-item-link'][contains(text(), '{{var1}}')]" parameterized="true"/>
1415
<element name="AddToCartBtn" type="button" selector="button.action.tocart.primary"/>
1516
<element name="SuccessMsg" type="button" selector="div.message-success"/>
1617
<element name="productCount" type="text" selector="#toolbar-amount"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
10+
<section name="StorefrontCategorySidebarSection">
11+
<element name="filterOptionsTitle" type="text" selector="//div[@class='filter-options-title' and contains(text(), '{{var1}}')]" parameterized="true"/>
12+
<element name="filterOptions" type="text" selector=".filter-options-content .items"/>
13+
<element name="filterOption" type="text" selector=".filter-options-content .item"/>
14+
<element name="optionQty" type="text" selector=".filter-options-content .item .count"/>
15+
</section>
16+
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
10+
<section name="StorefrontNavigationSection">
11+
<element name="topCategory" type="button" selector="//a[contains(@class,'level-top')]/span[contains(text(),'{{var1}}')]" parameterized="true"/>
12+
<element name="subCategory" type="button" selector="//ul[contains(@class,'submenu')]//span[contains(text(),'{{var1}}')]" parameterized="true"/>
13+
<element name="breadcrumbs" type="textarea" selector=".items"/>
14+
</section>
15+
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
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" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
10+
<test name="AdminMoveAnchoredCategoryTest">
11+
<annotations>
12+
<features value="Category Moving"/>
13+
<title value="Move Anchored Category with Products"/>
14+
<description value="You should be able to move a category via categories tree and made changes should be applied on frontend without forced cache cleaning"/>
15+
<severity value="CRITICAL"/>
16+
<testCaseId value="MAGETWO-76273"/>
17+
<group value="category"/>
18+
</annotations>
19+
<before>
20+
<createData entity="SimpleSubCategory" stepKey="simpleSubCategoryOne"/>
21+
<createData entity="SimpleSubCategory" stepKey="simpleSubCategoryTwo"/>
22+
<createData entity="SubCategoryWithParent" stepKey="simpleSubCategoryWithParent">
23+
<requiredEntity createDataKey="simpleSubCategoryOne"/>
24+
</createData>
25+
<createData entity="_defaultProduct" stepKey="productOne">
26+
<requiredEntity createDataKey="simpleSubCategoryWithParent"/>
27+
</createData>
28+
<createData entity="_defaultProduct" stepKey="productTwo">
29+
<requiredEntity createDataKey="simpleSubCategoryOne"/>
30+
</createData>
31+
</before>
32+
<after>
33+
<actionGroup ref="logout" stepKey="logoutAdminUserAfterTest"/>
34+
<deleteData createDataKey="productOne" stepKey="deleteProductOne"/>
35+
<deleteData createDataKey="productTwo" stepKey="deleteProductTwo"/>
36+
<deleteData createDataKey="simpleSubCategoryWithParent" stepKey="deleteSubcategoryWithParent"/>
37+
<deleteData createDataKey="simpleSubCategoryTwo" stepKey="deleteSubcategoryTwo"/>
38+
</after>
39+
<!--Move category one to category two-->
40+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
41+
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToAdminCategoryPage"/>
42+
<waitForPageLoad stepKey="waitForAdminCategoryPageLoad1"/>
43+
<actionGroup ref="MoveCategoryActionGroup" stepKey="moveSimpleSubCategoryOneToSimpleSubCategoryTwo">
44+
<argument name="childCategory" value="$$simpleSubCategoryOne.name$$"/>
45+
<argument name="parentCategory" value="$$simpleSubCategoryTwo.name$$"/>
46+
</actionGroup>
47+
<!--Verify that navigation menu categories level is correct-->
48+
<amOnPage url="/" stepKey="amOnStorefrontPage1"/>
49+
<waitForPageLoad stepKey="waitForPageToLoadAfterHomePageOpened1"/>
50+
<seeElement selector="{{StorefrontNavigationSection.topCategory($$simpleSubCategoryTwo.name$$)}}" stepKey="verifyThatTopCategoryIsSubCategoryTwo"/>
51+
<moveMouseOver selector="{{StorefrontNavigationSection.topCategory($$simpleSubCategoryTwo.name$$)}}" stepKey="mouseOverSubCategoryTwo"/>
52+
<waitForAjaxLoad stepKey="waitForAjaxOnMouseOverSubCategoryTwo"/>
53+
<seeElement selector="{{StorefrontNavigationSection.subCategory($$simpleSubCategoryOne.name$$)}}" stepKey="verifyThatFirstLevelIsSubCategoryOne"/>
54+
<moveMouseOver selector="{{StorefrontNavigationSection.subCategory($$simpleSubCategoryOne.name$$)}}" stepKey="mouseOverSubCategoryOne"/>
55+
<waitForAjaxLoad stepKey="waitForAjaxOnMouseOverSubCategoryOne"/>
56+
<seeElement selector="{{StorefrontNavigationSection.subCategory($$simpleSubCategoryWithParent.name$$)}}" stepKey="verifyThatSecondLevelIsSubCategoryWithParent1"/>
57+
<!--Open category one via navigation menu. Verify that subcategory is shown in layered navigation-->
58+
<click selector="{{StorefrontNavigationSection.subCategory($$simpleSubCategoryOne.name$$)}}" stepKey="openSimpleSubCategoryOneByNavigationMenu1"/>
59+
<actionGroup ref="CheckItemInLayeredNavigationActionGroup" stepKey="verifySimpleSubCategoryWithParentInLayeredNavigation1">
60+
<argument name="itemType" value="Category"/>
61+
<argument name="itemName" value="$$simpleSubCategoryWithParent.name$$"/>
62+
</actionGroup>
63+
<!--Open category one by direct URL. Verify simple product is visible on it. Open this product and perform assertions-->
64+
<actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openFirstProductFromSubCategoryOneCategoryPage1">
65+
<argument name="category" value="$$simpleSubCategoryOne$$"/>
66+
<argument name="product" value="$$productOne$$"/>
67+
</actionGroup>
68+
<see selector="{{StorefrontNavigationSection.breadcrumbs}}" userInput="Home" stepKey="seeHomePageInBreadcrumbs1"/>
69+
<see selector="{{StorefrontNavigationSection.breadcrumbs}}" userInput="$$simpleSubCategoryTwo.name$$" stepKey="seeSubCategoryTwoInBreadcrumbsOnSubCategoryOne"/>
70+
<see selector="{{StorefrontNavigationSection.breadcrumbs}}" userInput="$$simpleSubCategoryOne.name$$" stepKey="seeSubCategoryOneInBreadcrumbsOnSubCategoryOne1"/>
71+
<see selector="{{StorefrontNavigationSection.breadcrumbs}}" userInput="$$productOne.name$$" stepKey="seeProductInBreadcrumbsOnSubCategoryOne1"/>
72+
<!--Open category two by direct URL. Verify simple product is visible on it. Open this product and perform assertions-->
73+
<actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openFirstProductFromSubCategoryWithParentCategoryPage">
74+
<argument name="category" value="$$simpleSubCategoryWithParent$$"/>
75+
<argument name="product" value="$$productOne$$"/>
76+
</actionGroup>
77+
<see selector="{{StorefrontNavigationSection.breadcrumbs}}" userInput="Home" stepKey="seeHomePageInBreadcrumbsOnSubCategoryWithParent"/>
78+
<see selector="{{StorefrontNavigationSection.breadcrumbs}}" userInput="$$simpleSubCategoryTwo.name$$" stepKey="seeSubCategoryTwoInBreadcrumbsOnSubCategoryWithParent"/>
79+
<see selector="{{StorefrontNavigationSection.breadcrumbs}}" userInput="$$simpleSubCategoryOne.name$$" stepKey="seeSubCategoryOneInBreadcrumbsOnSubCategoryWithParent"/>
80+
<see selector="{{StorefrontNavigationSection.breadcrumbs}}" userInput="$$simpleSubCategoryOne.name$$" stepKey="seeSubCategoryWithParentInBreadcrumbsOnSubCategoryWithParent"/>
81+
<see selector="{{StorefrontNavigationSection.breadcrumbs}}" userInput="$$productOne.name$$" stepKey="seeProductInBreadcrumbsOnSubCategoryWithParent"/>
82+
<!--Move category one to the same level as category two-->
83+
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToAdminCategoryPage2"/>
84+
<waitForPageLoad stepKey="waitForAdminCategoryPageLoad2"/>
85+
<actionGroup ref="MoveCategoryActionGroup" stepKey="moveSimpleSubCategoryOneToDefaultCategory">
86+
<argument name="childCategory" value="$$simpleSubCategoryOne.name$$"/>
87+
<argument name="parentCategory" value="Default Category"/>
88+
</actionGroup>
89+
<!--Verify that navigation menu categories level is correct-->
90+
<amOnPage url="/" stepKey="amOnStorefrontPage2"/>
91+
<waitForPageLoad stepKey="waitForPageToLoadAfterHomePageOpened2"/>
92+
<seeElement selector="{{StorefrontNavigationSection.topCategory($$simpleSubCategoryOne.name$$)}}" stepKey="verifyThatSubCategoryOneIsTopCategory"/>
93+
<seeElement selector="{{StorefrontNavigationSection.topCategory($$simpleSubCategoryTwo.name$$)}}" stepKey="verifyThatSubCategoryTwoIsTopCategory"/>
94+
<moveMouseOver selector="{{StorefrontNavigationSection.topCategory($$simpleSubCategoryOne.name$$)}}" stepKey="mouseOverTopSubCategoryOne"/>
95+
<waitForAjaxLoad stepKey="waitForAjaxOnMouseOverTopSubCategoryOne"/>
96+
<seeElement selector="{{StorefrontNavigationSection.subCategory($$simpleSubCategoryWithParent.name$$)}}" stepKey="verifyThatSecondLevelIsSubCategoryWithParent2"/>
97+
<!--Open category one via navigation menu. Verify that subcategory is shown in layered navigation-->
98+
<click selector="{{StorefrontNavigationSection.topCategory($$simpleSubCategoryOne.name$$)}}" stepKey="openSimpleSubCategoryOneByNavigationMenu2"/>
99+
<actionGroup ref="CheckItemInLayeredNavigationActionGroup" stepKey="verifySimpleSubCategoryWithParentInLayeredNavigation2">
100+
<argument name="itemType" value="Category"/>
101+
<argument name="itemName" value="$$simpleSubCategoryWithParent.name$$"/>
102+
</actionGroup>
103+
<!--Open category one by direct URL. Verify simple product is visible on it. Open this product and perform assertions-->
104+
<actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openFirstProductFromSubCategoryOneCategoryPage2">
105+
<argument name="category" value="$$simpleSubCategoryOne$$"/>
106+
<argument name="product" value="$$productOne$$"/>
107+
</actionGroup>
108+
<see selector="{{StorefrontNavigationSection.breadcrumbs}}" userInput="Home" stepKey="seeHomePageInBreadcrumbs2"/>
109+
<see selector="{{StorefrontNavigationSection.breadcrumbs}}" userInput="$$simpleSubCategoryOne.name$$" stepKey="seeSubCategoryOneInBreadcrumbsOnSubCategoryOne2"/>
110+
<see selector="{{StorefrontNavigationSection.breadcrumbs}}" userInput="$$productOne.name$$" stepKey="seeProductInBreadcrumbsOnSubCategoryOne2"/>
111+
<!--Open category subcategory by direct URL. Verify simple product is visible on it. Open this product and perform assertions-->
112+
<actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openFirstProductFromSubCategoryOneCategoryPage3">
113+
<argument name="category" value="$$simpleSubCategoryWithParent$$"/>
114+
<argument name="product" value="$$productOne$$"/>
115+
</actionGroup>
116+
<see selector="{{StorefrontNavigationSection.breadcrumbs}}" userInput="Home" stepKey="seeHomePageInBreadcrumbs3"/>
117+
<see selector="{{StorefrontNavigationSection.breadcrumbs}}" userInput="$$simpleSubCategoryOne.name$$" stepKey="seeSubCategoryOneInBreadcrumbsOnSubCategoryOne3"/>
118+
<see selector="{{StorefrontNavigationSection.breadcrumbs}}" userInput="$$simpleSubCategoryOne.name$$" stepKey="seeSubCategoryWithParentInBreadcrumbsOnSubCategoryWithParent3"/>
119+
<see selector="{{StorefrontNavigationSection.breadcrumbs}}" userInput="$$productOne.name$$" stepKey="seeProductInBreadcrumbsOnSubCategoryOne3"/>
120+
</test>
121+
</tests>

0 commit comments

Comments
 (0)