Skip to content

Commit d1428d1

Browse files
committed
Refactoring the test
1 parent 7e78c28 commit d1428d1

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,28 @@
4343

4444
<!-- Update simple product by unselecting categories -->
4545
<scrollTo selector="{{AdminProductFormSection.productStockStatus}}" stepKey="scroll"/>
46-
<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/>
47-
<click selector="{{AdminProductFormSection.unselectCategories($$initialCategoryEntity.name$$)}}" stepKey="unselectCategories"/>
48-
<actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategory"/>
46+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDown"/>
47+
<actionGroup ref="RemoveCategoryFromProductActionGroup" stepKey="unselectCategories">
48+
<argument name="categoryName" value="$$initialCategoryEntity.name$$"/>
49+
</actionGroup>
50+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickOnDoneAdvancedCategory"/>
4951
<scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/>
5052
<actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/>
5153

5254
<!-- Verify customer see success message -->
53-
<see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/>
55+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeAssertSimpleProductSaveSuccessMessage">
56+
<argument name="message" value="You saved the product."/>
57+
</actionGroup>
5458

5559
<!--Search default simple product in the grid page -->
5660
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="OpenCategoryCatalogPage"/>
5761
<actionGroup ref="AdminExpandCategoryTreeActionGroup" stepKey="clickExpandTree"/>
58-
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$initialCategoryEntity.name$$)}}" stepKey="selectCategory"/>
59-
<waitForPageLoad stepKey="waitForPageToLoad"/>
60-
<click selector="{{AdminCategoryProductsSection.sectionHeader}}" stepKey="clickAdminCategoryProductSection"/>
61-
<waitForPageLoad stepKey="waitForSectionHeaderToLoad"/>
62+
<actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="selectCategory">
63+
<argument name="category" value="$$initialCategoryEntity$$"/>
64+
</actionGroup>
65+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageToLoad"/>
66+
<actionGroup ref="AdminCategoryPageOpenProductsInCategorySectionActionGroup" stepKey="clickAdminCategoryProductSection"/>
67+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSectionHeaderToLoad"/>
6268
<dontSee selector="{{AdminCategoryProductsGridSection.rowProductName($$initialSimpleProduct.name$$)}}" stepKey="dontSeeProductNameOnCategoryCatalogPage"/>
6369
</test>
6470
</tests>

0 commit comments

Comments
 (0)