Skip to content

Commit 8fad53d

Browse files
committed
Refactoring AdminCreateInactiveFlatCategoryTest
1 parent c2c5ec4 commit 8fad53d

File tree

1 file changed

+41
-14
lines changed

1 file changed

+41
-14
lines changed

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

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,18 @@
5555
<!-- Select created category and make category inactive-->
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.enableCategoryLabel}}" stepKey="disableActiveCategory"/>
58+
<actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="selectCreatedCategory">
59+
<argument name="category" value="$$createCategory$$"/>
60+
</actionGroup>
61+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCategoryPageToLoad"/>
62+
<actionGroup ref="AdminDisableActiveCategoryActionGroup" stepKey="disableActiveCategory"/>
6163
<actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSubCategory"/>
62-
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/>
63-
<see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{SimpleSubCategory.name}}" stepKey="seeUpdatedCategoryTitle"/>
64+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeSuccessMessage">
65+
<argument name="message" value="You saved the category."/>
66+
</actionGroup>
67+
<actionGroup ref="AssertAdminCategoryPageTitleActionGroup" stepKey="seeUpdatedCategoryTitle">
68+
<argument name="categoryName" value="{{SimpleSubCategory.name}}"/>
69+
</actionGroup>
6470
<dontSeeCheckboxIsChecked selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}" stepKey="verifyInactiveIncludeInMenu"/>
6571
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
6672
<argument name="indices" value="catalog_category_flat"/>
@@ -69,18 +75,39 @@
6975
<actionGroup ref="AdminOpenIndexManagementPageActionGroup" stepKey="openIndexManagementPage"/>
7076
<see stepKey="seeIndexStatus" selector="{{AdminIndexManagementSection.indexerStatus('Category Flat Data')}}" userInput="Ready"/>
7177
<!--Verify Category In Store Front-->
72-
<amOnPage url="/$$createCategory.custom_attributes[url_key]$$.html" stepKey="openCategoryPage1"/>
73-
<waitForPageLoad stepKey="waitForCategoryStoreFrontPageToLoad"/>
78+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="openCategoryPage1">
79+
<argument name="category" value="$createCategory$"/>
80+
</actionGroup>
81+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCategoryStoreFrontPageToLoad"/>
82+
7483
<!--Verify category is not visible in First Store View -->
75-
<click stepKey="selectStoreSwitcher" selector="{{StorefrontHeaderSection.storeViewSwitcher}}"/>
76-
<click stepKey="selectForstStoreView" selector="{{StorefrontHeaderSection.storeViewList(customStoreEN.name)}}"/>
77-
<waitForPageLoad stepKey="waitForFirstStoreView"/>
78-
<dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="dontSeeCategoryOnNavigation"/>
84+
<!--<click stepKey="selectStoreSwitcher" selector="{{StorefrontHeaderSection.storeViewSwitcher}}"/>-->
85+
<!--<click stepKey="selectForstStoreView" selector="{{StorefrontHeaderSection.storeViewList(customStoreEN.name)}}"/>-->
86+
<!--<waitForPageLoad stepKey="waitForFirstStoreView"/>-->
87+
88+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectStoreSwitcher"/>
89+
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="selectForstStoreView">
90+
<argument name="storeView" value="customStoreEN"/>
91+
</actionGroup>
92+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForFirstStoreView"/>
93+
94+
<!--<dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="dontSeeCategoryOnNavigation"/>-->
7995
<seeElement selector="{{StorefrontBundledSection.pageNotFound}}" stepKey="seeWhoopsOurBadMessage"/>
96+
<actionGroup ref="StorefrontAssertCategoryNameIsNotShownInMenuActionGroup" stepKey="dontSeeCategoryOnNavigation">
97+
<argument name="categoryName" value="$$createCategory.name$$"/>
98+
</actionGroup>
99+
80100
<!--Verify category is not visible in Second Store View -->
81-
<click stepKey="selectStoreSwitcher1" selector="{{StorefrontHeaderSection.storeViewSwitcher}}"/>
82-
<click stepKey="selectSecondStoreView" selector="{{StorefrontHeaderSection.storeViewList(customStoreFR.name)}}"/>
83-
<waitForPageLoad stepKey="waitForSecondstoreView"/>
101+
<!--<click stepKey="selectStoreSwitcher1" selector="{{StorefrontHeaderSection.storeViewSwitcher}}"/>-->
102+
<!--<click stepKey="selectSecondStoreView" selector="{{StorefrontHeaderSection.storeViewList(customStoreFR.name)}}"/>-->
103+
<!--<waitForPageLoad stepKey="waitForSecondstoreView"/>-->
104+
105+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectStoreSwitcher1"/>
106+
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="selectSecondStoreView">
107+
<argument name="storeView" value="customStoreFR"/>
108+
</actionGroup>
109+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSecondstoreView"/>
110+
84111
<dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="dontSeeCategoryOnNavigation1"/>
85112
<seeElement selector="{{StorefrontBundledSection.pageNotFound}}" stepKey="seeWhoopsOurBadMessage1"/>
86113
</test>

0 commit comments

Comments
 (0)