Skip to content

Commit 466a537

Browse files
committed
Refactoring the test
1 parent feaed6b commit 466a537

File tree

1 file changed

+116
-54
lines changed

1 file changed

+116
-54
lines changed

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

Lines changed: 116 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -36,102 +36,164 @@
3636
</after>
3737

3838
<!-- Search default simple product in the grid -->
39-
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/>
40-
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/>
41-
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct">
42-
<argument name="product" value="$$initialSimpleProduct$$"/>
39+
<actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openProductCatalogPage">
40+
<argument name="productSku" value="$$initialSimpleProduct.sku$$"/>
4341
</actionGroup>
44-
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/>
42+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
43+
stepKey="filterProductGrid"/>
44+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
45+
stepKey="clickFirstRowToOpenDefaultSimpleProduct"/>
46+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
47+
stepKey="waitUntilProductIsOpened"/>
4548

4649
<!-- Update simple product with regular price(out of stock) -->
47-
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}" stepKey="fillSimpleProductName"/>
48-
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductRegularPrice32503OutOfStock.sku}}" stepKey="fillSimpleProductSku"/>
49-
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductRegularPrice32503OutOfStock.price}}" stepKey="fillSimpleProductPrice"/>
50-
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductRegularPrice32503OutOfStock.quantity}}" stepKey="fillSimpleProductQuantity"/>
51-
<selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductRegularPrice32503OutOfStock.status}}" stepKey="selectStockStatusInStock"/>
52-
<fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice32503OutOfStock.weight}}" stepKey="fillSimpleProductWeight"/>
53-
<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/>
54-
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory"/>
55-
<waitForPageLoad stepKey="waitForCategory1"/>
56-
<click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/>
57-
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/>
58-
<waitForPageLoad stepKey="waitForCategory2"/>
59-
<click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/>
50+
<actionGroup ref="FillMainProductFormByStringActionGroup" stepKey="fillSimpleProductName">
51+
<argument name="productName" value="{{simpleProductRegularPrice32503OutOfStock.name}}"/>
52+
<argument name="productSku" value="{{simpleProductRegularPrice32503OutOfStock.sku}}"/>
53+
<argument name="productPrice" value="{{simpleProductRegularPrice32503OutOfStock.price}}"/>
54+
<argument name="productQuantity" value="{{simpleProductRegularPrice32503OutOfStock.quantity}}"/>
55+
<argument name="productStatus" value="{{simpleProductRegularPrice32503OutOfStock.status}}"/>
56+
<argument name="productWeight" value="{{simpleProductRegularPrice32503OutOfStock.weight}}"/>
57+
</actionGroup>
58+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
59+
stepKey="fillSimpleProductSku"/>
60+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
61+
stepKey="fillSimpleProductPrice"/>
62+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
63+
stepKey="fillSimpleProductQuantity"/>
64+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
65+
stepKey="selectStockStatusInStock"/>
66+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
67+
stepKey="fillSimpleProductWeight"/>
68+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
69+
stepKey="clickCategoriesDropDown"/>
70+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
71+
stepKey="fillSearchForInitialCategory"/>
72+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
73+
stepKey="waitForCategory1"/>
74+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
75+
stepKey="unselectInitialCategory"/>
76+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
77+
stepKey="fillSearchCategory"/>
78+
<actionGroup ref="SetCategoryByNameActionGroup" stepKey="clickOnCategory">
79+
<argument name="categoryName" value="$$categoryEntity.name$$"/>
80+
</actionGroup>
6081
<actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/>
61-
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/>
62-
<fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice32503OutOfStock.urlKey}}" stepKey="fillUrlKey"/>
82+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
83+
stepKey="clickAdminProductSEOSection"/>
84+
<actionGroup ref="SetProductUrlKeyByStringActionGroup" stepKey="fillUrlKey">
85+
<argument name="urlKey" value="{{simpleProductRegularPrice32503OutOfStock.urlKey}}"/>
86+
</actionGroup>
6387
<scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/>
64-
6588
<actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/>
6689

6790
<!-- Verify customer see success message -->
68-
<see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/>
91+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeAssertSimpleProductSaveSuccessMessage">
92+
<argument name="message" value="You saved the product."/>
93+
</actionGroup>
6994

7095
<!-- Search updated simple product(from above step) in the grid page -->
7196
<actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPageToSearchUpdatedSimpleProduct"/>
72-
<conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clickClearAll"/>
73-
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickFiltersButton"/>
74-
<fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}" stepKey="fillSimpleProductNameInNameFilter"/>
75-
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{simpleProductRegularPrice32503OutOfStock.sku}}" stepKey="fillProductSku"/>
76-
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/>
77-
<click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/>
97+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
98+
stepKey="clickClearAll"/>
99+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
100+
stepKey="clickFiltersButton"/>
101+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
102+
stepKey="fillSimpleProductNameInNameFilter"/>
103+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
104+
stepKey="fillProductSku"/>
105+
<actionGroup ref="FilterProductGridBySkuAndNameActionGroup" stepKey="clickApplyFiltersButton">
106+
<argument name="product" value="simpleProductRegularPrice32503OutOfStock"/>
107+
</actionGroup>
108+
<click selector="{{AdminProductGridFilterSection.nthRow('1')}}"
109+
stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/>
78110
<waitForPageLoad stepKey="waitUntilSimpleProductPageIsOpened"/>
79111

80112
<!-- Verify customer see updated simple product in the product form page -->
81-
<seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}" stepKey="seeSimpleProductName"/>
82-
<seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductRegularPrice32503OutOfStock.sku}}" stepKey="seeSimpleProductSku"/>
83-
<seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductRegularPrice32503OutOfStock.price}}" stepKey="seeSimpleProductPrice"/>
84-
<seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductRegularPrice32503OutOfStock.quantity}}" stepKey="seeSimpleProductQuantity"/>
85-
<seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductRegularPrice32503OutOfStock.status}}" stepKey="seeSimpleProductStockStatus"/>
86-
<seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice32503OutOfStock.weight}}" stepKey="seeSimpleProductWeight"/>
87-
88-
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/>
89-
<actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories">
113+
<actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="seeSimpleProductName">
114+
<argument name="productName" value="{{simpleProductRegularPrice32503OutOfStock.name}}"/>
115+
<argument name="productSku" value="{{simpleProductRegularPrice32503OutOfStock.sku}}"/>
116+
<argument name="productPrice" value="{{simpleProductRegularPrice32503OutOfStock.price}}"/>
117+
<argument name="productQuantity" value="{{simpleProductRegularPrice32503OutOfStock.quantity}}"/>
118+
<argument name="productStockStatus" value="{{simpleProductRegularPrice32503OutOfStock.status}}"/>
119+
<argument name="productWeight" value="{{simpleProductRegularPrice32503OutOfStock.weight}}"/>
90120
<argument name="categoryName" value="$$categoryEntity.name$$"/>
91121
</actionGroup>
122+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
123+
stepKey="seeSimpleProductSku"/>
124+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
125+
stepKey="seeSimpleProductPrice"/>
126+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
127+
stepKey="seeSimpleProductQuantity"/>
128+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
129+
stepKey="seeSimpleProductStockStatus"/>
130+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
131+
stepKey="seeSimpleProductWeight"/>
132+
133+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
134+
stepKey="clickCategoriesDropDownToVerify"/>
135+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
136+
stepKey="selectedCategories"/>
92137
<scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/>
93138
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/>
94-
<seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice32503OutOfStock.urlKey}}" stepKey="seeUrlKey"/>
139+
<seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice32503OutOfStock.urlKey}}"
140+
stepKey="seeUrlKey"/>
95141

96142
<!--Verify customer don't see updated simple product link on category page -->
97-
<amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/>
98-
<waitForPageLoad stepKey="waitForCategoryPageLoad"/>
99-
<dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}" stepKey="dontSeeSimpleProductNameOnCategoryPage"/>
143+
<actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage">
144+
<argument name="categoryName" value="$$categoryEntity.name$$"/>
145+
</actionGroup>
146+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
147+
stepKey="waitForCategoryPageLoad"/>
148+
<dontSee selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice32503OutOfStock.name}}"
149+
stepKey="dontSeeSimpleProductNameOnCategoryPage"/>
100150

101151
<!-- Verify customer see updated simple product (from the above step) on the storefront page -->
102152
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage">
103153
<argument name="productUrlKey" value="{{simpleProductRegularPrice32503OutOfStock.urlKey}}"/>
104154
</actionGroup>
105-
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="waitForStorefrontProductPageLoad"/>
155+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr"
156+
stepKey="waitForStorefrontProductPageLoad"/>
106157

107-
<actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage">
158+
<actionGroup ref="StorefrontAssertProductNameOnProductPageActionGroup"
159+
stepKey="seeSimpleProductNameOnStoreFrontPage">
108160
<argument name="productName" value="{{simpleProductRegularPrice32503OutOfStock.name}}"/>
109161
</actionGroup>
110162

111-
<actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup" stepKey="seeSimpleProductPriceOnStoreFrontPage">
163+
<actionGroup ref="StorefrontAssertProductPriceOnProductPageActionGroup"
164+
stepKey="seeSimpleProductPriceOnStoreFrontPage">
112165
<argument name="productPrice" value="{{simpleProductRegularPrice32503OutOfStock.price}}"/>
113166
</actionGroup>
114167

115-
<actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSkuOnStoreFrontPage">
168+
<actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup"
169+
stepKey="seeSimpleProductSkuOnStoreFrontPage">
116170
<argument name="productSku" value="{{simpleProductRegularPrice32503OutOfStock.sku}}"/>
117171
</actionGroup>
118172

119-
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productStockAvailableStatus"/>
120-
<actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup" stepKey="assertStockAvailableOnProductPage">
173+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr"
174+
stepKey="productStockAvailableStatus"/>
175+
<actionGroup ref="AssertStorefrontProductStockStatusOnProductPageActionGroup"
176+
stepKey="assertStockAvailableOnProductPage">
121177
<argument name="productStockStatus" value="{{simpleProductRegularPrice32503OutOfStock.storefrontStatus}}"/>
122178
</actionGroup>
123-
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="productPriceAmount"/>
124-
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/>
179+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr"
180+
stepKey="productPriceAmount"/>
181+
<comment userInput="Comment is added to preserve the step key for backward compatibilityr"
182+
stepKey="assertOldPriceTextOnProductPage"/>
125183

126184
<!--Verify customer don't see updated simple product link on magento storefront page and is searchable by sku -->
127-
<amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32503OutOfStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/>
128-
<waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/>
185+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToMagentoStorefrontPage"/>
186+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
187+
stepKey="waitForStoreFrontProductPageLoad"/>
129188
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox">
130189
<argument name="phrase" value="{{simpleProductRegularPrice32503OutOfStock.sku}}"/>
131190
</actionGroup>
132-
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/>
133-
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/>
134-
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/>
191+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
192+
stepKey="waitForSearchTextBox"/>
193+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
194+
stepKey="clickSearchTextBoxButton"/>
195+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
196+
stepKey="waitForSearch"/>
135197
<actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProductName">
136198
<argument name="productName" value="{{simpleProductRegularPrice32503OutOfStock.name}}"/>
137199
</actionGroup>

0 commit comments

Comments
 (0)