Skip to content

Commit d023e98

Browse files
committed
MC-20073: Fix Skipped MFTF Tests From MC-17140: MC-13493, MC-14062, MC-14063
MC-5352 rewrite
1 parent 6c0b55c commit d023e98

File tree

4 files changed

+97
-6
lines changed

4 files changed

+97
-6
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@
345345
<argument name="value" type="string"/>
346346
</arguments>
347347

348-
<click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSeoSection"/>
348+
<conditionalClick selector="{{AdminCategorySEOSection.SectionHeader}}" dependentSelector="{{AdminCategorySEOSection.sectionBody}}" visible="false" stepKey="openSeoSection"/>
349349
<fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{value}}" stepKey="enterURLKey"/>
350350
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/>
351351
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccessMessage"/>
@@ -359,7 +359,7 @@
359359
<argument name="value" type="string"/>
360360
</arguments>
361361

362-
<click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSeoSection"/>
362+
<conditionalClick selector="{{AdminCategorySEOSection.SectionHeader}}" dependentSelector="{{AdminCategorySEOSection.sectionBody}}" visible="false" stepKey="openSeoSection"/>
363363
<uncheckOption selector="{{AdminCategorySEOSection.UrlKeyDefaultValueCheckbox}}" stepKey="uncheckDefaultValue"/>
364364
<fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{value}}" stepKey="enterURLKey"/>
365365
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/>
@@ -409,7 +409,7 @@
409409

410410
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{categoryName}}" stepKey="enterCategoryName"/>
411411
<scrollTo selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="scrollToSearchEngineOptimization"/>
412-
<click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSEO"/>
412+
<conditionalClick selector="{{AdminCategorySEOSection.SectionHeader}}" dependentSelector="{{AdminCategorySEOSection.sectionBody}}" visible="false" stepKey="openSEO"/>
413413
<waitForPageLoad stepKey="waitForPageToLoad"/>
414414
<fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{categoryUrlKey}}" stepKey="enterURLKey"/>
415415
<scrollToTopOfPage stepKey="scrollToTheTopOfPage"/>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminCategorySEOSection">
12-
<element name="SectionHeader" type="button" selector="div[data-index='search_engine_optimization']" timeout="30"/>
12+
<element name="SectionHeader" type="button" selector="div[data-index='search_engine_optimization'] .fieldset-wrapper-title" timeout="30"/>
13+
<element name="sectionBody" type="text" selector="div[data-index='search_engine_optimization'] .admin__fieldset-wrapper-content"/>
1314
<element name="UrlKeyInput" type="input" selector="input[name='url_key']"/>
1415
<element name="UrlKeyDefaultValueCheckbox" type="button" selector="input[name='use_default[url_key]']"/>
1516
<element name="UrlKeyRedirectCheckbox" type="button" selector="[data-index='url_key_create_redirect'] input[type='checkbox']"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategory2Test">
11+
<annotations>
12+
<features value="UrlRewrite"/>
13+
<stories value="Update url rewrites"/>
14+
<title value="Check url rewrites in catalog categories after changing url key"/>
15+
<description value="Check url rewrites in catalog categories after changing url key for store view and moving category"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MC-5352"/>
18+
<group value="catalog"/>
19+
<group value="url_rewrite"/>
20+
<group value="mtf_migrated"/>
21+
</annotations>
22+
<before>
23+
<!-- Create two sub-categories in default category with simple products -->
24+
<createData entity="_defaultCategory" stepKey="createFirstCategory"/>
25+
<createData entity="_defaultProduct" stepKey="createFirstSimpleProduct">
26+
<requiredEntity createDataKey="createFirstCategory"/>
27+
</createData>
28+
<createData entity="_defaultCategory" stepKey="createSecondCategory"/>
29+
<createData entity="_defaultProduct" stepKey="createSecondSimpleProduct">
30+
<requiredEntity createDataKey="createSecondCategory"/>
31+
</createData>
32+
33+
<!-- Log in to backend -->
34+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
35+
36+
<!--Create additional Store View in Main Website Store -->
37+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView"/>
38+
<magentoCLI command="indexer:reindex" stepKey="reindexAll"/>
39+
</before>
40+
41+
<after>
42+
<deleteData createDataKey="createFirstCategory" stepKey="deleteFirstCategory"/>
43+
<deleteData createDataKey="createSecondCategory" stepKey="deleteSecondCategory"/>
44+
<deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/>
45+
<deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/>
46+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView"/>
47+
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearWebsitesGridFilters"/>
48+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
49+
</after>
50+
51+
<!-- On the categories editing page change store view to created additional view -->
52+
<actionGroup ref="switchCategoryStoreView" stepKey="openFirstCategoryAndSwitchToCustomStoreView">
53+
<argument name="Store" value="customStore.name"/>
54+
<argument name="CatName" value="$createFirstCategory.name$"/>
55+
</actionGroup>
56+
57+
<!-- Change url key for category for first category; save -->
58+
<actionGroup ref="ChangeSeoUrlKeyForSubCategory" stepKey="changeFirstCategoryUrlKey">
59+
<argument name="value" value="{{SimpleRootSubCategory.url_key}}"/>
60+
</actionGroup>
61+
62+
<!-- Change store view to "All store views" for first category -->
63+
<actionGroup ref="switchCategoryToAllStoreView" stepKey="switchToAllStoreViews">
64+
<argument name="CatName" value="$createFirstCategory.name$"/>
65+
</actionGroup>
66+
67+
<!-- Move first category inside second category -->
68+
<actionGroup ref="MoveCategoryActionGroup" stepKey="moveFirstCategoryInsideSecondCategory">
69+
<argument name="childCategory" value="$createFirstCategory.name$"/>
70+
<argument name="parentCategory" value="$createSecondCategory.name$"/>
71+
</actionGroup>
72+
73+
<!-- Open first category storefront page -->
74+
<amOnPage url="$createSecondCategory.custom_attributes[url_key]$/$createFirstCategory.custom_attributes[url_key]$.html" stepKey="openFirstCategoryStorefrontPage"/>
75+
<waitForPageLoad stepKey="waitForFirstCategoryStorefrontPageLoad"/>
76+
<see userInput="$createFirstSimpleProduct.name$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeFirstProductInCategory"/>
77+
78+
<!-- Switch to custom store view-->
79+
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToCustomStoreView">
80+
<argument name="storeView" value="customStore"/>
81+
</actionGroup>
82+
83+
<!-- Assert category url with custom store view -->
84+
<seeInCurrentUrl url="{{SimpleRootSubCategory.url_key}}.html" stepKey="seeUpdatedUrlKey"/>
85+
<see userInput="$createFirstSimpleProduct.name$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeFirstProductInCategoryAgain"/>
86+
</test>
87+
</tests>

app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@
1111
<annotations>
1212
<features value="Url Rewrite"/>
1313
<stories value="Update url rewrites"/>
14-
<title value="Check url rewrites in catalog categories after changing url key"/>
15-
<description value="Check url rewrites in catalog categories after changing url key for store view and moving category"/>
14+
<title value="DEPRECATED. Check url rewrites in catalog categories after changing url key"/>
15+
<description value="DEPRECATED. Check url rewrites in catalog categories after changing url key for store view and moving category"/>
1616
<severity value="CRITICAL"/>
1717
<testCaseId value="MC-5352"/>
1818
<group value="url_rewrite"/>
1919
<group value="mtf_migrated"/>
20+
<skip>
21+
<issueId value="DEPRECATED">Use AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategory2Test instead</issueId>
22+
</skip>
2023
</annotations>
2124
<before>
2225
<!-- Create two sub-categories in default category with simple products -->

0 commit comments

Comments
 (0)