Skip to content

Commit db8b074

Browse files
committed
MC-6443: Product custom URL Key is preserved when assigned to a Category (without custom URL Key) alongside with another Product without custom URL Key
1 parent dc2c7c0 commit db8b074

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,19 +399,19 @@
399399

400400
<actionGroup name="AdminCategoryAssignProduct">
401401
<annotations>
402-
<description>Assign products to category - using "Products in Category" tab.</description>
402+
<description>Requires navigation to category creation/edit page. Assign products to category - using "Products in Category" tab.</description>
403403
</annotations>
404404
<arguments>
405405
<argument name="productSku" type="string"/>
406406
</arguments>
407407

408408
<conditionalClick selector="{{AdminCategoryBasicFieldSection.productsInCategory}}" dependentSelector="{{CatalogProductsSection.resetFilter}}" visible="false" stepKey="clickOnProductInCategory"/>
409-
<waitForPageLoad stepKey="waitForProductsInCategoryOpened"/>
409+
<waitForPageLoad time="30" stepKey="waitForProductsInCategoryOpened"/>
410410
<click selector="{{CatalogProductsSection.resetFilter}}" stepKey="clickOnResetFilter"/>
411-
<waitForPageLoad stepKey="waitForProductsToLoad"/>
411+
<waitForPageLoad time="30" stepKey="waitForProductsToLoad"/>
412412
<fillField selector="{{AdminCategoryContentSection.productTableColumnSku}}" userInput="{{productSku}}" stepKey="selectProduct"/>
413413
<click selector="{{AdminCategoryContentSection.productSearch}}" stepKey="clickSearchButton"/>
414-
<waitForPageLoad stepKey="waitForSearch"/>
414+
<waitForPageLoad time="30" stepKey="waitForSearch"/>
415415
<click selector="{{AdminCategoryContentSection.productTableRow}}" stepKey="selectProductFromTableRow"/>
416416
</actionGroup>
417417
</actionGroups>

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
<test name="AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKey">
1212
<annotations>
1313
<stories value="Product"/>
14+
<features value="Catalog"/>
1415
<title value="Product custom URL Key is preserved when assigned to a Category (without custom URL Key) alongside with another Product without custom URL Key"/>
1516
<description value="The test verifies that product custom URL Key is preserved when assigned to a Category (without custom URL Key) alongside with another Product without custom URL Key."/>
1617
<severity value="MAJOR"/>
1718
<testCaseId value="MC-6443"/>
19+
<useCaseId value="MAGETWO-90331"/>
1820
<group value="catalog"/>
1921
</annotations>
2022
<before>
@@ -74,9 +76,9 @@
7476

7577
<actionGroup ref="saveCategoryForm" stepKey="saveCategory"/>
7678

77-
<executeJS function="var s = '$createCategory.name$'; var res=s.toLowerCase(); return res;" stepKey="categoryNameLower" />
78-
<executeJS function="var s = '$createSimpleProductFirst.name$'; var res=s.toLowerCase(); return res;" stepKey="simpleProductFirstNameLower" />
79-
<executeJS function="var s = '$createSimpleProductSecond.name$';var res=s.toLowerCase(); return res;" stepKey="simpleProductSecondNameLower" />
79+
<executeJS function="return '$createCategory.name$'.toLowerCase();" stepKey="categoryNameLower" />
80+
<executeJS function="return '$createSimpleProductFirst.name$'.toLowerCase();" stepKey="simpleProductFirstNameLower" />
81+
<executeJS function="return '$createSimpleProductSecond.name$'.toLowerCase();" stepKey="simpleProductSecondNameLower" />
8082

8183
<!-- Make assertions on frontend -->
8284
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToStorefrontPage"/>
@@ -85,11 +87,13 @@
8587

8688
<!-- Open first product -->
8789
<click selector="{{StorefrontCategoryProductSection.ProductTitleByName($createSimpleProductFirst.name$)}}" stepKey="openFirstProduct"/>
90+
<waitForPageLoad time="30" stepKey="waitForFirstProduct"/>
8891
<seeInCurrentUrl url="{$simpleProductFirstNameLower}.html" stepKey="checkFirstSimpleProductUrlKey"/>
8992

90-
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryView"/>
93+
<amOnPage url="{{StorefrontCategoryPage.url($createCategory.custom_attributes[url_key]$)}}" stepKey="onCategoryView"/>
9194
<!-- Open second product -->
9295
<click selector="{{StorefrontCategoryProductSection.ProductTitleByName($createSimpleProductSecond.name$)}}" stepKey="openSecondProduct"/>
96+
<waitForPageLoad time="30" stepKey="waitForSecondProduct"/>
9397
<seeInCurrentUrl url="{$simpleProductSecondNameLower}.html" stepKey="checkSecondSimpleProductUrlKey"/>
9498

9599
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToCustomStoreView">
@@ -101,11 +105,13 @@
101105

102106
<!-- Open product first -->
103107
<click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProductFirst.name$$)}}" stepKey="openFirstSimpleProduct"/>
108+
<waitForPageLoad time="30" stepKey="waitForFirstSimpleProduct"/>
104109
<seeInCurrentUrl url="{$simpleProductFirstNameLower}.html" stepKey="assertFirstSimpleProductUrlKey"/>
105110

106111
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName($createCategory.name$)}}" stepKey="openCategoryView"/>
107112
<!-- Open product2 -->
108113
<click selector="{{StorefrontCategoryProductSection.ProductTitleByName($createSimpleProductSecond.name$)}}" stepKey="openSecondSimpleProduct"/>
114+
<waitForPageLoad time="30" stepKey="waitForSecondSimpleProduct"/>
109115
<seeInCurrentUrl url="u2.html" stepKey="assertSecondSimpleProductUrlKey"/>
110116
</test>
111117
</tests>

0 commit comments

Comments
 (0)