Skip to content

Commit c0f7468

Browse files
committed
Replace repetitive actions
1 parent be9b1fe commit c0f7468

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@
5353
</actionGroup>
5454

5555
<!--Go to Catalog > Categories (choose category where created products)-->
56-
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="onCategoryIndexPage"/>
57-
<waitForPageLoad stepKey="waitForCategoryPageLoadAddProducts" after="onCategoryIndexPage"/>
58-
<click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="clickExpandAll" after="waitForCategoryPageLoadAddProducts"/>
59-
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(SimpleSubCategory.name)}}" stepKey="clickCategoryLink"/>
60-
<waitForPageLoad stepKey="waitForCategoryPageLoad"/>
56+
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="onCategoryIndexPage"/>
57+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCategoryPageLoadAddProducts"/>
58+
<actionGroup ref="AdminExpandCategoryTreeActionGroup" stepKey="clickExpandAll"/>
59+
<actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="clickCategoryLink">
60+
<argument name="category" value="SimpleSubCategory"/>
61+
</actionGroup>
62+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCategoryPageLoad"/>
6163

6264
<!--Content > Add CMS Block: name saved block-->
6365
<waitForElementVisible selector="{{AdminCategoryContentSection.sectionHeader}}" stepKey="waitForContentSection"/>
@@ -75,8 +77,10 @@
7577
<actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="seeSuccessMessage"/>
7678

7779
<!--Go to Storefront > category-->
78-
<amOnPage url="$$simplecategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage"/>
79-
<waitForPageLoad stepKey="waitForStorefrontPageLoaded"/>
80+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="goToStorefrontCategoryPage">
81+
<argument name="category" value="$$simplecategory$$"/>
82+
</actionGroup>
83+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontPageLoaded"/>
8084

8185
<!--Check operators Greater than-->
8286
<dontSeeElement selector="{{InsertWidgetSection.checkElementStorefrontByPrice('10')}}" stepKey="dontSeeElementByPrice20"/>
@@ -95,8 +99,10 @@
9599
</actionGroup>
96100

97101
<!--Go to Storefront > category-->
98-
<amOnPage url="$$simplecategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage2"/>
99-
<waitForPageLoad stepKey="waitForStorefrontPageLoaded2"/>
102+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="goToStorefrontCategoryPage2">
103+
<argument name="category" value="$$simplecategory$$"/>
104+
</actionGroup>
105+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontPageLoaded2"/>
100106

101107
<!--Check operators Greater than-->
102108
<seeElement selector="{{InsertWidgetSection.checkElementStorefrontByPrice('10')}}" stepKey="seeElementByPrice20"/>
@@ -115,8 +121,10 @@
115121
</actionGroup>
116122

117123
<!--Go to Storefront > category-->
118-
<amOnPage url="$$simplecategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage3"/>
119-
<waitForPageLoad stepKey="waitForStorefrontPageLoaded3"/>
124+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="goToStorefrontCategoryPage3">
125+
<argument name="category" value="$$simplecategory$$"/>
126+
</actionGroup>
127+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontPageLoaded3"/>
120128

121129
<!--Check operators Greater than-->
122130
<dontSeeElement selector="{{InsertWidgetSection.checkElementStorefrontByPrice('10')}}" stepKey="dontSeeElementByPrice20s"/>
@@ -135,8 +143,10 @@
135143
</actionGroup>
136144

137145
<!--Go to Storefront > category-->
138-
<amOnPage url="$$simplecategory.custom_attributes[url_key]$$.html" stepKey="goToStorefrontCategoryPage4"/>
139-
<waitForPageLoad stepKey="waitForStorefrontPageLoaded4"/>
146+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="goToStorefrontCategoryPage4">
147+
<argument name="category" value="$$simplecategory$$"/>
148+
</actionGroup>
149+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStorefrontPageLoaded4"/>
140150

141151
<!--Check operators Greater than-->
142152
<seeElement selector="{{InsertWidgetSection.checkElementStorefrontByPrice('10')}}" stepKey="seeElementByPrice20s"/>

0 commit comments

Comments
 (0)