Skip to content

Commit 4fb74ce

Browse files
committed
AC-2917 conflict resolve
2 parents 0cabe13 + 67f1b8f commit 4fb74ce

File tree

9 files changed

+354
-473
lines changed

9 files changed

+354
-473
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/AdminCategoryBasicFieldSection/AdminCategoryBasicFieldSection.xml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1010
<section name="AdminCategoryBasicFieldSection">
1111
<element name="IncludeInMenu" type="checkbox" selector="input[name='include_in_menu']"/>
1212
<element name="includeInMenuLabel" type="text" selector="input[name='include_in_menu']+label"/>
@@ -27,12 +27,11 @@
2727
<element name="urlExistsErrorMessage" type="text" selector="//div[@class='message message-error error']//h4[contains(text(),'The value specified in the URL Key field would generate a URL that already exists.')]" timeout="30"/>
2828
<element name="presenceProductsInCategory" type="text" selector="//div[@class='admin__data-grid-wrap admin__data-grid-wrap-static']//td[3]" timeout="30"/>
2929
<element name="anchorSwitch" type="input" selector="//input[@name='is_anchor']/../..//div[@class='admin__actions-switch']" timeout="30"/>
30-
<element name="categoryTreeForThree" type="input" selector="//span[contains(text(),'{{var1}}')]/../../..//ul//a//span[contains(text(),'{{var2}}')]/../../..//ul//a/span[contains(text(),'{{var3}}')]" parameterized="true"/>
31-
<element name="categoryTreeForFour" type="input" selector="//span[contains(text(),'{{CatA}}') and contains(text(),'({{qty1}})') ]/../../..//ul//a//span[contains(text(),'{{CatB}}') and contains(text(),'({{qty2}})')]/../../..//ul//a/span[contains(text(),'{{CatC}}') and contains(text(),'({{qty3}})')]/../../../../../..//li[2]//a/span[contains(text(),'{{CatD}}') and contains(text(),'({{qty4}})')]" parameterized="true"/>
32-
<element name="categoryTreeForFive" type="input" selector="//span[contains(text(),'{{CatA}}') and contains(text(),'({{qty1}})') ]/../../..//ul//a//span[contains(text(),'{{CatB}}') and contains(text(),'({{qty2}})')]/../../..//ul//a/span[contains(text(),'{{CatC}}') and contains(text(),'({{qty3}})')]/../../../../../..//li[2]//a/span[contains(text(),'{{CatD}}') and contains(text(),'({{qty4}})')]/.././../..//ul//a/span[contains(text(),'{{CatE}}') and contains(text(),'({{qty5}})')]" parameterized="true"/>
33-
<element name="sourceCategory" type="text" selector="//div[@class='x-tree-node-el folder active-category x-tree-node-leaf x-tree-selected']//a/span[contains(text(),'{{var1}}')]" parameterized="true"/>
34-
<element name="destinationCategory" type="text" selector="//div[@class='x-tree-node-el folder active-category x-tree-node-expanded']//a/span[contains(text(),'Default Category')]"/>
35-
30+
<element name="categoryTreeForThree" type="input" selector="//a[contains(text(),'{{var1}}')]/../ul//a[contains(text(),'{{var2}}')]/../ul//a[contains(text(),'{{var3}}')]" parameterized="true"/>
31+
<element name="categoryTreeForFour" type="input" selector="//a[contains(text(),'{{CatA}}') and contains(text(),'({{qty1}})') ]/../ul//a[contains(text(),'{{CatB}}') and contains(text(),'({{qty2}})')]/../ul//a[contains(text(),'{{CatC}}') and contains(text(),'({{qty3}})')]/../../../../li[2]//a[contains(text(),'{{CatD}}') and contains(text(),'({{qty4}})')]" parameterized="true"/>
32+
<element name="categoryTreeForFive" type="input" selector="//a[contains(text(),'{{CatA}}') and contains(text(),'({{qty1}})') ]/../ul//a[contains(text(),'{{CatB}}') and contains(text(),'({{qty2}})')]/../ul//a[contains(text(),'{{CatC}}') and contains(text(),'({{qty3}})')]/../../../../li[2]//a[contains(text(),'{{CatD}}') and contains(text(),'({{qty4}})')]/../ul//a[contains(text(),'{{CatE}}') and contains(text(),'({{qty5}})')]" parameterized="true"/>
33+
<element name="sourceCategory" type="text" selector="//li[contains(@class, 'jstree-node')]//a[contains(text(),'{{var1}}')]" parameterized="true"/>
34+
<element name="destinationCategory" type="text" selector="//li[contains(@class, 'jstree-node')]//a[contains(text(),'Default Category')]"/>
3635
<element name="grabPopUpText" type="input" selector="//div[@class='modal-inner-wrap']//div[@data-id='information-dialog-category']//div[text()='This operation can take a long time']"/>
3736
<element name="acceptPopUp" type="input" selector="//div[@class='modal-inner-wrap']//button[@class='action-primary']/span[text()='Ok']"/>
3837
</section>

app/code/Magento/Catalog/Test/Mftf/Section/AdminCategoryContentSection.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminCategoryContentSection">
1212
<element name="sectionHeader" type="button" selector="div[data-index='content']" timeout="30"/>
1313
<element name="uploadButton" type="button" selector="//*[@class='file-uploader-area']/label[text()='Upload']"/>
@@ -19,9 +19,9 @@
1919
<element name="AddCMSBlock" type="select" selector="//*[@name='landing_page']"/>
2020
<element name="description" type="input" selector="//*[@name='description']"/>
2121
<element name="content" type="button" selector="div[data-index='content'"/>
22-
<element name="categoryInTree" type="button" selector="//li[contains(@class, 'x-tree-node')]//div[contains(.,'{{categoryName}}') and contains(@class, 'no-active-category')]" parameterized="true" />
22+
<element name="categoryInTree" type="button" selector="//li[contains(@class, 'jstree-node')]//a[contains(.,'{{categoryName}}') and contains(@class, 'jstree-anchor')]" parameterized="true" />
2323
<element name="categoryPageTitle" type="text" selector="h1.page-title" />
24-
<element name="activeCategoryInTree" type="button" selector="//li[contains(@class, 'x-tree-node')]//div[contains(.,'{{categoryName}}') and contains(@class, 'active-category')]" parameterized="true" />
24+
<element name="activeCategoryInTree" type="button" selector="//li[contains(@class, 'jstree-node')]//a[contains(.,'{{categoryName}}') and contains(@class, 'jstree-anchor jstree-clicked')]" parameterized="true" />
2525
<element name="productTableColumnName" type="input" selector="#catalog_category_products_filter_name"/>
2626
<element name="productTableRow" type="button" selector="#catalog_category_products_table tbody tr"/>
2727
<element name="productSearch" type="button" selector="//button[@data-action='grid-filter-apply']" timeout="30"/>

app/code/Magento/Catalog/Test/Mftf/Section/AdminCategorySidebarTreeSection.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,17 @@
1414
<element name="categoryHighlighted" type="text" selector="//div[@id='store.menu']//span[contains(text(),'{{name}}')]/ancestor::li" parameterized="true" timeout="30"/>
1515
<element name="categoryNotHighlighted" type="text" selector="[id=\'store.menu\'] ul li.active" timeout="30"/>
1616
<element name="categoryTreeRoot" type="text" selector="li.x-tree-node:first-of-type > div.x-tree-node-el:first-of-type" timeout="30"/>
17-
<element name="categoryInTree" type="text" selector="//a/span[contains(text(), '{{name}}')]" parameterized="true" timeout="30"/>
18-
<element name="categoryInTreeUnderRoot" type="text" selector="//li/ul/li[@class='x-tree-node']/div/a/span[contains(text(), '{{name}}')]" parameterized="true"/>
19-
<element name="childCategoryUnderParent" type="text" selector="//li/ul/li[@class='x-tree-node']/div/a/span[contains(text(), '{{parentCategoryName}}')]/../../../ul/li[@class='x-tree-node']/div/a/span[contains(text(), '{{childCategoryName}}')]" parameterized="true"/>
17+
<element name="categoryInTree" type="text" selector="//a[contains(text(), '{{name}}')]" parameterized="true" timeout="30"/>
18+
<element name="categoryInFrontendTree" type="text" selector="//a/span[contains(text(), '{{name}}')]" parameterized="true" timeout="30"/>
19+
<element name="categoryInTreeUnderRoot" type="text" selector="//ul/li[contains(@class, 'jstree-node')]/a[contains(text(), '{{name}}')]" parameterized="true"/>
20+
<element name="childCategoryUnderParent" type="text" selector="//ul/li[contains(@class, 'jstree-node')]/a[contains(text(), '{{parentCategoryName}}')]/../ul/li[contains(@class, 'jstree-node')]/a[contains(text(), '{{childCategoryName}}')]" parameterized="true"/>
2021
<element name="lastCreatedCategory" type="block" selector=".x-tree-root-ct li li:last-child" />
2122
<element name="treeContainer" type="block" selector=".tree-holder" />
2223
<element name="expandRootCategory" type="text" selector="img.x-tree-elbow-end-plus"/>
2324
<element name="expandRootCategoryByName" type="button" selector="//a[contains(text(),'{{categoryName}}')]/ancestor::li[contains(@class,'jstree-node')]//i[contains(@class,'jstree-ocl')]" parameterized="true" timeout="30"/>
24-
<element name="categoryByName" type="text" selector="//div[contains(@class, 'categories-side-col')]//a/span[contains(text(), '{{categoryName}}')]" parameterized="true" timeout="30"/>
25+
<element name="categoryByName" type="text" selector="//div[contains(@class, 'categories-side-col')]//a[contains(text(), '{{categoryName}}')]" parameterized="true" timeout="30"/>
2526
<element name="expandCategoryByName" type="text" selector="//a[contains(text(),'{{categoryName}}')]/ancestor::li[contains(@class,'jstree-node')]//i[contains(@class,'jstree-ocl')]" parameterized="true" timeout="30"/>
26-
<element name="subCategoryProductCount" type="text" selector="//div[@class='tree-holder']//span[contains(text(),'SubCat') and contains(text(),'({{productCount}})')]" parameterized="true"/>
27-
<element name="defaultCategoryProductCount" type="text" selector="//div[@class='tree-holder']//span[contains(text(),'Default Category') and contains(text(),'({{productCount}})')]" parameterized="true"/>
27+
<element name="subCategoryProductCount" type="text" selector="//div[@class='tree-holder']//a[contains(text(),'SubCat') and contains(text(),'({{productCount}})')]" parameterized="true"/>
28+
<element name="defaultCategoryProductCount" type="text" selector="//div[@class='tree-holder']//a[contains(text(),'Default Category') and contains(text(),'({{productCount}})')]" parameterized="true"/>
2829
</section>
2930
</sections>

app/code/Magento/Catalog/Test/Mftf/Test/AlterAnchorCategoryTest.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@
3838
<deleteData createDataKey="createSubTestCategory" stepKey="deleteSubCategory"/>
3939
<deleteData createDataKey="createTestCategory" stepKey="deleteMainCategory"/>
4040
</after>
41+
42+
<!-- Reindex invalidated indices after product attribute has been created/deleted -->
43+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexInvalidatedIndices">
44+
<argument name="indices" value=""/>
45+
</actionGroup>
46+
4147
<actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage">
4248
<argument name="categoryName" value="$$createTestCategory.name$$"/>
4349
</actionGroup>

app/code/Magento/Catalog/Test/Mftf/Test/CreateAnchorCategoryTest.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646
<requiredEntity createDataKey="createCategoryA"/>
4747
<field key="name">A</field>
4848
</createData>
49+
50+
<!-- Reindex invalidated indices after product attribute has been created/deleted -->
51+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexInvalidatedIndices1">
52+
<argument name="indices" value=""/>
53+
</actionGroup>
54+
4955
<actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryAPageFirstTime">
5056
<argument name="categoryName" value="$$createCategoryA.name$$"/>
5157
</actionGroup>
@@ -66,6 +72,12 @@
6672
<requiredEntity createDataKey="createCategoryB"/>
6773
<field key="name">B</field>
6874
</createData>
75+
76+
<!-- Reindex invalidated indices after product attribute has been created/deleted -->
77+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexInvalidatedIndices2">
78+
<argument name="indices" value=""/>
79+
</actionGroup>
80+
6981
<actionGroup ref="StorefrontGoToSubCategoryPageActionGroup" stepKey="openCategoryBPage">
7082
<argument name="categoryName" value="$$createCategoryA.name$$"/>
7183
<argument name="subCategoryName" value="$$createCategoryB.name$$"/>
@@ -97,6 +109,12 @@
97109
<field key="name">C</field>
98110
</createData>
99111

112+
<!-- Reindex invalidated indices after product attribute has been created/deleted -->
113+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexInvalidatedIndices3">
114+
<argument name="indices" value=""/>
115+
</actionGroup>
116+
<waitForPageLoad stepKey="waitForPageLoadExpandCategory1"/>
117+
100118
<!-- admin side category tree hierarchy validation for category A, category B and category C-->
101119
<seeElement selector="{{AdminCategoryBasicFieldSection.categoryTreeForThree($createCategoryA.name$,$createCategoryB.name$,$createCategoryC.name$)}}" stepKey="verifyThreeLayerCategoryTree"/>
102120

@@ -143,6 +161,12 @@
143161
<field key="name">D</field>
144162
</createData>
145163

164+
<!-- Reindex invalidated indices after product attribute has been created/deleted -->
165+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexInvalidatedIndices4">
166+
<argument name="indices" value=""/>
167+
</actionGroup>
168+
<waitForPageLoad stepKey="waitForPageLoadExpandCategory2"/>
169+
146170
<!-- admin side category tree hierarchy validation with product qty for category A, category B, category C and category D-->
147171
<reloadPage stepKey="refreshEditCategoryDPage" />
148172
<actionGroup ref="AdminExpandCategoryTreeActionGroup" stepKey="clickExpandAll"/>
@@ -179,6 +203,12 @@
179203
<field key="name">E</field>
180204
</createData>
181205

206+
<!-- Reindex invalidated indices after product attribute has been created/deleted -->
207+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexInvalidatedIndices5">
208+
<argument name="indices" value=""/>
209+
</actionGroup>
210+
<waitForPageLoad stepKey="waitForPageLoadExpandCategory3"/>
211+
182212
<!-- admin side category tree hierarchy validation with product qty for category A, category B, category C, category D and category E-->
183213
<reloadPage stepKey="refreshCategoryEPage" />
184214
<actionGroup ref="AdminExpandCategoryTreeActionGroup" stepKey="expandAllFiveCategoryTree"/>

app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryHighlightedAndProductDisplayedTest.xml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,44 +50,50 @@
5050
<deleteData createDataKey="category4" stepKey="deleteCategory4"/>
5151
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
5252
</after>
53+
54+
<!-- Reindex invalidated indices after product attribute has been created/deleted -->
55+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexInvalidatedIndices">
56+
<argument name="indices" value=""/>
57+
</actionGroup>
58+
5359
<!--Open Storefront home page-->
5460
<comment userInput="Open Storefront home page" stepKey="openStorefrontHomePage"/>
5561
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefrontHomePage"/>
5662
<!--Click on first category-->
5763
<comment userInput="Click on first category" stepKey="openFirstCategoryPage"/>
58-
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$category1.name$$)}}" stepKey="clickCategory1Name"/>
64+
<click selector="{{AdminCategorySidebarTreeSection.categoryInFrontendTree($$category1.name$$)}}" stepKey="clickCategory1Name"/>
5965
<waitForPageLoad stepKey="waitForCategory1Page"/>
6066
<!--Check if current category is highlighted and the others are not-->
6167
<comment userInput="Check if current category is highlighted and the others are not" stepKey="checkCateg1NameIsHighlighted"/>
6268
<grabAttributeFrom selector="{{AdminCategorySidebarTreeSection.categoryHighlighted($$category1.name$$)}}" userInput="class" stepKey="grabCategory1Class"/>
6369
<assertStringContainsString stepKey="assertCategory1IsHighlighted">
64-
<actualResult type="const">$grabCategory1Class</actualResult>
65-
<expectedResult type="string">active</expectedResult>
70+
<actualResult type="const">$grabCategory1Class</actualResult>
71+
<expectedResult type="string">active</expectedResult>
6672
</assertStringContainsString>
6773
<executeJS function="return document.querySelectorAll('{{AdminCategorySidebarTreeSection.categoryNotHighlighted}}').length" stepKey="highlightedAmount"/>
6874
<assertEquals stepKey="assertRestCategories1IsNotHighlighted">
69-
<actualResult type="const">$highlightedAmount</actualResult>
70-
<expectedResult type="int">1</expectedResult>
75+
<actualResult type="const">$highlightedAmount</actualResult>
76+
<expectedResult type="int">1</expectedResult>
7177
</assertEquals>
7278
<!--See products in the category page-->
7379
<comment userInput="See products in the category page" stepKey="seeProductsInCategoryPage"/>
7480
<seeElement selector="{{StorefrontCategoryMainSection.specifiedProductItemInfo($product1.name$)}}" stepKey="seeProduct1InCategoryPage"/>
7581
<seeElement selector="{{StorefrontCategoryMainSection.specifiedProductItemInfo($product2.name$)}}" stepKey="seeProduct2InCategoryPage"/>
7682
<!--Click on second category-->
7783
<comment userInput="Click on second category" stepKey="openSecondCategoryPage"/>
78-
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$category2.name$$)}}" stepKey="clickCategory2Name"/>
84+
<click selector="{{AdminCategorySidebarTreeSection.categoryInFrontendTree($$category2.name$$)}}" stepKey="clickCategory2Name"/>
7985
<waitForPageLoad stepKey="waitForCategory2Page"/>
8086
<!--Check if current category is highlighted and the others are not-->
8187
<comment userInput="Check if current category is highlighted and the others are not" stepKey="checkCateg2NameIsHighlighted"/>
8288
<grabAttributeFrom selector="{{AdminCategorySidebarTreeSection.categoryHighlighted($$category2.name$$)}}" userInput="class" stepKey="grabCategory2Class"/>
8389
<assertStringContainsString stepKey="assertCategory2IsHighlighted">
84-
<actualResult type="const">$grabCategory2Class</actualResult>
85-
<expectedResult type="string">active</expectedResult>
90+
<actualResult type="const">$grabCategory2Class</actualResult>
91+
<expectedResult type="string">active</expectedResult>
8692
</assertStringContainsString>
8793
<executeJS function="return document.querySelectorAll('{{AdminCategorySidebarTreeSection.categoryNotHighlighted}}').length" stepKey="highlightedAmount2"/>
8894
<assertEquals stepKey="assertRestCategories1IsNotHighlighted2">
89-
<actualResult type="const">$highlightedAmount2</actualResult>
90-
<expectedResult type="int">1</expectedResult>
95+
<actualResult type="const">$highlightedAmount2</actualResult>
96+
<expectedResult type="int">1</expectedResult>
9197
</assertEquals>
9298
<!--Assert products in second category page-->
9399
<comment userInput="Assert products in second category page" stepKey="commentAssertProducts"/>

0 commit comments

Comments
 (0)