Skip to content

Commit 6ba55e5

Browse files
authored
ENGCOM-9320: Replace repetitive actions with Action Groups in AdminCreateInactiveInMenuFlatCategoryTest #34418
2 parents 2b2e32a + fa79212 commit 6ba55e5

File tree

1 file changed

+31
-15
lines changed

1 file changed

+31
-15
lines changed

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

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,19 @@
5555
<!-- Select created category and disable Include In Menu option-->
5656
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openAdminCategoryIndexPage"/>
5757
<actionGroup ref="AdminExpandCategoryTreeActionGroup" stepKey="clickOnExpandTree"/>
58-
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(SimpleSubCategory.name)}}" stepKey="selectCreatedCategory"/>
59-
<waitForPageLoad stepKey="waitForCategoryPageToLoad"/>
60-
<click selector="{{AdminCategoryBasicFieldSection.includeInMenuLabel}}" stepKey="disableIcludeInMenuOption"/>
58+
<actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="selectCreatedCategory">
59+
<argument name="category" value="$$category$$"/>
60+
</actionGroup>
61+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCategoryPageToLoad"/>
62+
<actionGroup ref="AdminDisableIncludeInMenuConfigActionGroup" stepKey="disableIcludeInMenuOption"/>
6163
<actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSubCategory"/>
6264
<!--Verify category is saved and Include In Menu Option is disabled in Category Page -->
63-
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/>
64-
<see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{SimpleSubCategory.name}}" stepKey="seeUpdatedCategoryTitle"/>
65+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeSuccessMessage">
66+
<argument name="message" value="You saved the category."/>
67+
</actionGroup>
68+
<actionGroup ref="AssertAdminCategoryPageTitleActionGroup" stepKey="seeUpdatedCategoryTitle">
69+
<argument name="categoryName" value="{{SimpleSubCategory.name}}"/>
70+
</actionGroup>
6571
<dontSeeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.includeInMenuLabel}}" stepKey="verifyInactiveIncludeInMenu"/>
6672
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
6773
<argument name="indices" value="catalog_category_flat"/>
@@ -70,17 +76,27 @@
7076
<actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/>
7177
<see stepKey="seeIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="Ready"/>
7278
<!--Verify Category In Store Front-->
73-
<amOnPage url="/$$category.custom_attributes[url_key]$$.html" stepKey="openCategoryPage1"/>
74-
<waitForPageLoad stepKey="waitForCategoryStoreFrontPageToLoad"/>
79+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="openCategoryPage1">
80+
<argument name="category" value="$category$"/>
81+
</actionGroup>
82+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCategoryStoreFrontPageToLoad"/>
7583
<!--Verify category is not displayed in navigation menu in First Store View -->
76-
<click stepKey="selectStoreSwitcher" selector="{{StorefrontHeaderSection.storeViewSwitcher}}"/>
77-
<click stepKey="selectForstStoreView" selector="{{StorefrontHeaderSection.storeViewList(customStoreEN.name)}}"/>
78-
<waitForPageLoad stepKey="waitForFirstStoreView"/>
79-
<dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$category.name$$)}}" stepKey="seeCategoryOnNavigation"/>
84+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectStoreSwitcher"/>
85+
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="selectForstStoreView">
86+
<argument name="storeView" value="customStoreEN"/>
87+
</actionGroup>
88+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForFirstStoreView"/>
89+
<actionGroup ref="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup" stepKey="seeCategoryOnNavigation">
90+
<argument name="categoryName" value="$$category.name$$"/>
91+
</actionGroup>
8092
<!--Verify category is not displayed in navigation menu in Second Store View -->
81-
<click stepKey="selectStoreSwitcher1" selector="{{StorefrontHeaderSection.storeViewSwitcher}}"/>
82-
<click stepKey="selectSecondStoreView" selector="{{StorefrontHeaderSection.storeViewList(customStoreFR.name)}}"/>
83-
<waitForPageLoad stepKey="waitForSecondstoreView"/>
84-
<dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$category.name$$)}}" stepKey="seeCategoryOnNavigation1"/>
93+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectStoreSwitcher1"/>
94+
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="selectSecondStoreView">
95+
<argument name="storeView" value="customStoreFR"/>
96+
</actionGroup>
97+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSecondstoreView"/>
98+
<actionGroup ref="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup" stepKey="seeCategoryOnNavigation1">
99+
<argument name="categoryName" value="$$category.name$$"/>
100+
</actionGroup>
85101
</test>
86102
</tests>

0 commit comments

Comments
 (0)