Skip to content

Commit 0b0a751

Browse files
authored
ENGCOM-7621: MFTF: Refactoring AdminUrlRewritesForProductsWithConfigurationTurnedOffTest #28407
2 parents 08021cf + f02af5a commit 0b0a751

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

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

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,26 @@
4141
<!--Flush cache-->
4242
<magentoCLI command="cache:flush" stepKey="cleanCache2"/>
4343
</after>
44+
4445
<!-- 1. Log in to Admin -->
4546
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
47+
4648
<!-- 2. 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="seeProducturl"/>
53-
<dontSeeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $simpleSubCategory1.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="dontSeeCategoryProducturlKey"/>
54-
<amOnPage url="/$simpleSubCategory1.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html" stepKey="navigateToProductPage"/>
55-
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createSimpleProduct.name$$" stepKey="seeProductName"/>
49+
<actionGroup ref="AdminSearchUrlRewriteByRequestPathActionGroup" stepKey="searchingUrlRewrite">
50+
<argument name="requestPath" value="$createSimpleProduct.custom_attributes[url_key]$.html"/>
51+
</actionGroup>
52+
<actionGroup ref="AssertAdminRequestPathInUrlRewriteGrigActionGroup" stepKey="seeProductUrlInGrid">
53+
<argument name="requestPath" value="$createSimpleProduct.custom_attributes[url_key]$.html"/>
54+
</actionGroup>
55+
<actionGroup ref="AssertAdminRequestPathIsNotFoundInUrlRewriteGrigActionGroup" stepKey="categoryProductUrlIsNotShown">
56+
<argument name="requestPath" value="$simpleSubCategory1.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html"/>
57+
</actionGroup>
58+
59+
<!-- 3. Assert the Redirect works and Product is present on StoreFront-->
60+
<actionGroup ref="AssertStorefrontProductRedirectActionGroup" stepKey="verifyProductInStoreFrontPage">
61+
<argument name="productName" value="$$createSimpleProduct.name$$"/>
62+
<argument name="productSku" value="$$createSimpleProduct.sku$$"/>
63+
<argument name="productRequestPath" value="/$simpleSubCategory1.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html"/>
64+
</actionGroup>
5665
</test>
5766
</tests>

0 commit comments

Comments
 (0)