Skip to content

Commit 4d82a5b

Browse files
authored
ENGCOM-7620: MFTF: Refactoring AdminGenerateUrlRewritesForProductInCategoriesSwitchOffTest #28401
2 parents 4c62ea2 + 6ac5359 commit 4d82a5b

File tree

1 file changed

+19
-22
lines changed

1 file changed

+19
-22
lines changed

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

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -44,34 +44,31 @@
4444
</after>
4545

4646
<!-- 1. Open Marketing - SEO & Search - URL Rewrites -->
47-
<amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="amOnUrlRewriteIndexPage"/>
48-
<click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters"/>
49-
<fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="$createSimpleProduct.custom_attributes[url_key]$.html" stepKey="inputProductName"/>
50-
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters"/>
51-
<waitForPageLoad stepKey="waitForPageToLoad"/>
52-
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeValue1"/>
53-
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $createCategory.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeValue2"/>
47+
<actionGroup ref="AdminSearchUrlRewriteByRequestPathActionGroup" stepKey="searchingUrlRewrite">
48+
<argument name="requestPath" value="$createSimpleProduct.custom_attributes[url_key]$.html"/>
49+
</actionGroup>
50+
<actionGroup ref="AssertAdminRequestPathInUrlRewriteGrigActionGroup" stepKey="seeProductUrlInGrid">
51+
<argument name="requestPath" value="$createSimpleProduct.custom_attributes[url_key]$.html"/>
52+
</actionGroup>
53+
<actionGroup ref="AssertAdminRequestPathInUrlRewriteGrigActionGroup" stepKey="seeCategoryUrlInGrid">
54+
<argument name="requestPath" value="$createCategory.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html"/>
55+
</actionGroup>
5456

5557
<!-- 2. Set the configuration for Generate "category/product" URL Rewrites to No-->
56-
<amOnPage url="{{CatalogConfigPage.url}}" stepKey="amOnCatalogConfigPage"/>
57-
<conditionalClick selector="{{CatalogSection.seo}}" dependentSelector="{{CatalogSection.CheckIfSeoTabExpand}}" visible="true" stepKey="expandSeoTab" />
58-
<waitForElementVisible selector="{{CatalogSection.GenerateUrlRewrites}}" stepKey="GenerateUrlRewritesSelect"/>
59-
<selectOption userInput="0" selector="{{CatalogSection.GenerateUrlRewrites}}" stepKey="selectUrlGenerationNo" />
60-
<waitForElementVisible selector="{{GenerateUrlRewritesConfirm.title}}" stepKey="waitForConfirmModal"/>
61-
<click selector="{{GenerateUrlRewritesConfirm.ok}}" stepKey="confirmSwitchingGenerationOff"/>
62-
<click selector="{{CatalogSection.save}}" stepKey="saveConfig" />
63-
<waitForPageLoad stepKey="waitForSavingSystemConfiguration"/>
58+
<magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 0" stepKey="disableGenerateUrlRewrite"/>
6459

6560
<!-- 3. Flush cache-->
6661
<magentoCLI command="cache:flush" stepKey="cleanCache"/>
6762

6863
<!-- 4. Open Marketing - SEO & Search - URL Rewrites -->
69-
<amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="amOnUrlRewriteIndexPage2"/>
70-
<click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters1"/>
71-
<fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="$createSimpleProduct.custom_attributes[url_key]$.html" stepKey="inputProductName2"/>
72-
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters1"/>
73-
<waitForPageLoad stepKey="waitForPageToLoad1"/>
74-
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeInListValue1"/>
75-
<dontSeeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $createCategory.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="dontSeeValue2"/>
64+
<actionGroup ref="AdminSearchUrlRewriteByRequestPathActionGroup" stepKey="searchingUrlRewriteAfterDisablingTheConfig">
65+
<argument name="requestPath" value="$createSimpleProduct.custom_attributes[url_key]$.html"/>
66+
</actionGroup>
67+
<actionGroup ref="AssertAdminRequestPathInUrlRewriteGrigActionGroup" stepKey="seeProductUrlInGridAfterDisablingTheConfig">
68+
<argument name="requestPath" value="$createSimpleProduct.custom_attributes[url_key]$.html"/>
69+
</actionGroup>
70+
<actionGroup ref="AssertAdminRequestPathIsNotFoundInUrlRewriteGrigActionGroup" stepKey="categoryUrlIsNotShownAfterDisablingTheConfig">
71+
<argument name="requestPath" value="$createCategory.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html"/>
72+
</actionGroup>
7673
</test>
7774
</tests>

0 commit comments

Comments
 (0)