Skip to content

Commit 03c4369

Browse files
authored
ENGCOM-7596: MFTF: Refactoring AdminUrlRewritesForProductInAnchorCategoriesTest #28408
2 parents 9386501 + 09d4afa commit 03c4369

File tree

2 files changed

+50
-33
lines changed

2 files changed

+50
-33
lines changed

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

Lines changed: 44 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -39,47 +39,60 @@
3939
<after>
4040
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
4141
<deleteData createDataKey="simpleSubCategory1" stepKey="deletesimpleSubCategory1"/>
42-
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
42+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
4343
</after>
4444
<!-- Steps -->
4545
<!-- 1. Log in to Admin -->
4646
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
4747
<!-- 2. Open Marketing - SEO & Search - URL Rewrites -->
48-
<amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="amOnUrlRewriteIndexPage"/>
49-
<click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters"/>
50-
<fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="$createSimpleProduct.custom_attributes[url_key]$.html" stepKey="inputProductName"/>
51-
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters"/>
52-
<waitForPageLoad stepKey="waitForPageToLoad"/>
53-
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeValue1"/>
54-
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $simpleSubCategory1.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeValue2"/>
55-
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $simpleSubCategory1.custom_attributes[url_key]$/$simpleSubCategory2.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeValue3"/>
56-
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $simpleSubCategory1.custom_attributes[url_key]$/$simpleSubCategory2.custom_attributes[url_key]$/$simpleSubCategory3.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeValue4"/>
57-
48+
<actionGroup ref="AdminSearchUrlRewriteByRequestPathActionGroup" stepKey="searchingUrlRewrite">
49+
<argument name="requestPath" value="$createSimpleProduct.custom_attributes[url_key]$.html"/>
50+
</actionGroup>
51+
<actionGroup ref="AssertAdminRequestPathInUrlRewriteGrigActionGroup" stepKey="seeValueOne">
52+
<argument name="requestPath" value="$createSimpleProduct.custom_attributes[url_key]$.html"/>
53+
</actionGroup>
54+
<actionGroup ref="AssertAdminRequestPathInUrlRewriteGrigActionGroup" stepKey="seeValueTwo">
55+
<argument name="requestPath" value="$simpleSubCategory1.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html"/>
56+
</actionGroup>
57+
<actionGroup ref="AssertAdminRequestPathInUrlRewriteGrigActionGroup" stepKey="seeValueThree">
58+
<argument name="requestPath" value="$simpleSubCategory1.custom_attributes[url_key]$/$simpleSubCategory2.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html"/>
59+
</actionGroup>
60+
<actionGroup ref="AssertAdminRequestPathInUrlRewriteGrigActionGroup" stepKey="seeValueFour">
61+
<argument name="requestPath" value="$simpleSubCategory1.custom_attributes[url_key]$/$simpleSubCategory2.custom_attributes[url_key]$/$simpleSubCategory3.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html"/>
62+
</actionGroup>
5863
<!-- 3. Edit Category 1 for DEFAULT Store View: -->
5964
<actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="switchStoreView">
6065
<argument name="Store" value="_defaultStore.name"/>
6166
<argument name="CatName" value="$$simpleSubCategory1.name$$"/>
6267
</actionGroup>
63-
<click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSeoSection2"/>
64-
<uncheckOption selector="{{AdminCategorySEOSection.UrlKeyDefaultValueCheckbox}}" stepKey="uncheckRedirect2"/>
65-
<fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="$simpleSubCategory1.custom_attributes[url_key]$-new" stepKey="changeURLKey"/>
66-
<checkOption selector="{{AdminCategorySEOSection.UrlKeyRedirectCheckbox}}" stepKey="checkUrlKeyRedirect"/>
67-
<!-- 4. Save Category 1 -->
68-
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/>
69-
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccessMessageAfterSaved"/>
70-
68+
<!-- 4. Change URL key for category and save changes -->
69+
<actionGroup ref="ChangeSeoUrlKeyForSubCategoryActionGroup" stepKey="changeFirstCategoryUrlKey">
70+
<argument name="value" value="$simpleSubCategory1.custom_attributes[url_key]$new"/>
71+
</actionGroup>
7172
<!-- 5. Open Marketing - SEO & Search - URL Rewrites -->
72-
<amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="amOnUrlRewriteIndexPage2"/>
73-
<click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters1"/>
74-
<fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="$createSimpleProduct.custom_attributes[url_key]$.html" stepKey="inputProductName2"/>
75-
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters1"/>
76-
<waitForPageLoad stepKey="waitForPageToLoad1"/>
77-
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeInListValue1"/>
78-
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $simpleSubCategory1.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeInListValue2"/>
79-
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $simpleSubCategory1.custom_attributes[url_key]$/$simpleSubCategory2.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeInListValue3"/>
80-
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $simpleSubCategory1.custom_attributes[url_key]$/$simpleSubCategory2.custom_attributes[url_key]$/$simpleSubCategory3.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeInListValue4"/>
81-
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $simpleSubCategory1.custom_attributes[url_key]$-new/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeInListValue5"/>
82-
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $simpleSubCategory1.custom_attributes[url_key]$-new/$simpleSubCategory2.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeInListValue6"/>
83-
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $simpleSubCategory1.custom_attributes[url_key]$-new/$simpleSubCategory2.custom_attributes[url_key]$/$simpleSubCategory3.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeInListValue7"/>
73+
<actionGroup ref="AdminSearchUrlRewriteByRequestPathActionGroup" stepKey="searchingUrlRewriteSecondTime">
74+
<argument name="requestPath" value="$createSimpleProduct.custom_attributes[url_key]$.html"/>
75+
</actionGroup>
76+
<actionGroup ref="AssertAdminRequestPathInUrlRewriteGrigActionGroup" stepKey="seeInListValueOne">
77+
<argument name="requestPath" value="$createSimpleProduct.custom_attributes[url_key]$.html"/>
78+
</actionGroup>
79+
<actionGroup ref="AssertAdminRequestPathInUrlRewriteGrigActionGroup" stepKey="seeInListValueTwo">
80+
<argument name="requestPath" value="$simpleSubCategory1.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html"/>
81+
</actionGroup>
82+
<actionGroup ref="AssertAdminRequestPathInUrlRewriteGrigActionGroup" stepKey="seeInListValuethree">
83+
<argument name="requestPath" value="$simpleSubCategory1.custom_attributes[url_key]$/$simpleSubCategory2.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html"/>
84+
</actionGroup>
85+
<actionGroup ref="AssertAdminRequestPathInUrlRewriteGrigActionGroup" stepKey="seeInListValueFour">
86+
<argument name="requestPath" value="$simpleSubCategory1.custom_attributes[url_key]$/$simpleSubCategory2.custom_attributes[url_key]$/$simpleSubCategory3.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html"/>
87+
</actionGroup>
88+
<actionGroup ref="AssertAdminRequestPathInUrlRewriteGrigActionGroup" stepKey="seeInListValueFive">
89+
<argument name="requestPath" value="$simpleSubCategory1.custom_attributes[url_key]$new/$createSimpleProduct.custom_attributes[url_key]$.html"/>
90+
</actionGroup>
91+
<actionGroup ref="AssertAdminRequestPathInUrlRewriteGrigActionGroup" stepKey="seeInListValue1Six">
92+
<argument name="requestPath" value="$simpleSubCategory1.custom_attributes[url_key]$new/$simpleSubCategory2.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html"/>
93+
</actionGroup>
94+
<actionGroup ref="AssertAdminRequestPathInUrlRewriteGrigActionGroup" stepKey="seeInListValueSeven">
95+
<argument name="requestPath" value="$simpleSubCategory1.custom_attributes[url_key]$new/$simpleSubCategory2.custom_attributes[url_key]$/$simpleSubCategory3.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html"/>
96+
</actionGroup>
8497
</test>
8598
</tests>

app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest/AdminUrlRewritesForProductInAnchorCategoriesTestAllStoreViewTest.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@
2828
</before>
2929
<remove keyForRemoval="switchStoreView"/>
3030
<!-- 3. Edit Category 1 for All store view: -->
31-
<actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="goToCategoryPage" after="seeValue4">
31+
<actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="goToCategoryPage" after="seeValueFour">
3232
<argument name="Category" value="$$simpleSubCategory1$$"/>
3333
</actionGroup>
34-
<remove keyForRemoval="uncheckRedirect2"/>
34+
<remove keyForRemoval="changeFirstCategoryUrlKey"/>
35+
<!-- 4. Change URL key for category and save changes -->
36+
<actionGroup ref="ChangeSeoUrlKeyActionGroup" stepKey="changeCategoryUrlKey" after="goToCategoryPage">
37+
<argument name="value" value="$simpleSubCategory1.custom_attributes[url_key]$new"/>
38+
</actionGroup>
3539
</test>
3640
</tests>

0 commit comments

Comments
 (0)