Skip to content

Commit 920867a

Browse files
committed
Refactoring the test
1 parent 7d5967f commit 920867a

File tree

1 file changed

+59
-37
lines changed

1 file changed

+59
-37
lines changed

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

Lines changed: 59 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -36,67 +36,89 @@
3636
</after>
3737

3838
<!-- Search default simple product in the grid page -->
39-
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/>
39+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="openProductCatalogPage"/>
4040
<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$$"/>
41+
<actionGroup ref="FilterAndSelectProductActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct">
42+
<argument name="productSku" value="$initialSimpleProduct.sku$"/>
4343
</actionGroup>
4444
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/>
4545

4646
<!-- Update simple product with regular price(in stock) -->
47-
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductNotVisibleIndividually.name}}" stepKey="fillSimpleProductName"/>
48-
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductNotVisibleIndividually.sku}}" stepKey="fillSimpleProductSku"/>
49-
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductNotVisibleIndividually.price}}" stepKey="fillSimpleProductPrice"/>
50-
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductNotVisibleIndividually.quantity}}" stepKey="fillSimpleProductQuantity"/>
51-
<selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductNotVisibleIndividually.status}}" stepKey="selectStockStatusInStock"/>
52-
<fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductNotVisibleIndividually.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"/>
47+
<actionGroup ref="FillMainProductFormByStringActionGroup" stepKey="fillSimpleProductName">
48+
<argument name="productName" value="{{simpleProductNotVisibleIndividually.name}}"/>
49+
<argument name="productSku" value="{{simpleProductNotVisibleIndividually.sku}}"/>
50+
<argument name="productPrice" value="{{simpleProductNotVisibleIndividually.price}}"/>
51+
<argument name="productQuantity" value="{{simpleProductNotVisibleIndividually.quantity}}"/>
52+
<argument name="productStatus" value="{{simpleProductNotVisibleIndividually.status}}"/>
53+
<argument name="productWeight" value="{{simpleProductNotVisibleIndividually.weight}}"/>
54+
</actionGroup>
55+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSimpleProductSku"/>
56+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSimpleProductPrice"/>
57+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSimpleProductQuantity"/>
58+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectStockStatusInStock"/>
59+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSimpleProductWeight"/>
60+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDown"/>
61+
<actionGroup ref="SetCategoryByNameActionGroup" stepKey="fillSearchForInitialCategory">
62+
<argument name="categoryName" value="$$initialCategoryEntity.name$$"/>
63+
</actionGroup>
64+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCategory1"/>
65+
<actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="unselectInitialCategory"/>
66+
<actionGroup ref="SetCategoryByNameActionGroup" stepKey="fillSearchCategory">
67+
<argument name="categoryName" value="$$categoryEntity.name$$"/>
68+
</actionGroup>
69+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCategory2"/>
70+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickOnCategory"/>
6071
<actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/>
6172
<selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductNotVisibleIndividually.visibility}}" stepKey="selectVisibility"/>
62-
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/>
63-
<fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductNotVisibleIndividually.urlKey}}" stepKey="fillSimpleProductUrlKey"/>
73+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickAdminProductSEOSection"/>
74+
<actionGroup ref="SetProductUrlKeyByStringActionGroup" stepKey="fillSimpleProductUrlKey">
75+
<argument name="urlKey" value="{{simpleProductNotVisibleIndividually.urlKey}}"/>
76+
</actionGroup>
6477
<scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/>
6578
<actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/>
6679

6780
<!-- Verify customer see success message -->
68-
<see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/>
81+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeAssertSimpleProductSaveSuccessMessage">
82+
<argument name="message" value="You saved the product."/>
83+
</actionGroup>
6984

7085
<!-- Search updated simple product(from above step) in the grid page -->
7186
<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="{{simpleProductNotVisibleIndividually.name}}" stepKey="fillSimpleProductNameInNameFilter"/>
75-
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{simpleProductNotVisibleIndividually.sku}}" stepKey="fillProductSku"/>
76-
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/>
87+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickClearAll"/>
88+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickFiltersButton"/>
89+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSimpleProductNameInNameFilter"/>
90+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductSku"/>
91+
<actionGroup ref="FilterProductGridBySkuAndNameActionGroup" stepKey="clickApplyFiltersButton">
92+
<argument name="product" value="simpleProductNotVisibleIndividually"/>
93+
</actionGroup>
7794
<click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/>
7895
<waitForPageLoad stepKey="waitUntilSimpleProductPageIsOpened"/>
7996

80-
<!-- Verify customer see updated simple product in the product form page -->
81-
<seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductNotVisibleIndividually.name}}" stepKey="seeSimpleProductName"/>
82-
<seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductNotVisibleIndividually.sku}}" stepKey="seeSimpleProductSku"/>
83-
<seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductNotVisibleIndividually.price}}" stepKey="seeSimpleProductPrice"/>
84-
<seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductNotVisibleIndividually.quantity}}" stepKey="seeSimpleProductQuantity"/>
85-
<seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductNotVisibleIndividually.status}}" stepKey="seeSimpleProductStockStatus"/>
86-
<seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductNotVisibleIndividually.weightNoDecimals}}" stepKey="seeSimpleProductWeight"/>
87-
88-
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/>
89-
<actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="seeSelectedCategories">
97+
<!--Verify customer see updated simple product in the product form page-->
98+
<actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="seeSimpleProductName">
99+
<argument name="productName" value="{{simpleProductNotVisibleIndividually.name}}"/>
100+
<argument name="productSku" value="{{simpleProductNotVisibleIndividually.sku}}"/>
101+
<argument name="productPrice" value="{{simpleProductNotVisibleIndividually.price}}"/>
102+
<argument name="productQuantity" value="{{simpleProductNotVisibleIndividually.quantity}}"/>
103+
<argument name="productWeight" value="{{simpleProductNotVisibleIndividually.weightNoDecimals}}"/>
104+
<argument name="productVisibility" value="{{simpleProductNotVisibleIndividually.visibility}}"/>
90105
<argument name="categoryName" value="$$categoryEntity.name$$"/>
91106
</actionGroup>
92-
<seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductNotVisibleIndividually.visibility}}" stepKey="seeSimpleProductVisibility"/>
107+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductSku"/>
108+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductPrice"/>
109+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductQuantity"/>
110+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductStockStatus"/>
111+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductWeight"/>
112+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/>
113+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSelectedCategories"/>
114+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductVisibility"/>
93115
<scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection"/>
94116
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSectionHeader"/>
95117
<seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductNotVisibleIndividually.urlKey}}" stepKey="seeSimpleProductUrlKey"/>
96118

97119
<!--Verify customer don't see updated simple product link on magento storefront page -->
98-
<amOnPage url="{{StorefrontProductPage.url(simpleProductNotVisibleIndividually.urlKey)}}" stepKey="goToMagentoStorefrontPage"/>
99-
<waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/>
120+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToMagentoStorefrontPage"/>
121+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStoreFrontProductPageLoad"/>
100122
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox">
101123
<argument name="phrase" value="{{simpleProductNotVisibleIndividually.sku}}"/>
102124
</actionGroup>

0 commit comments

Comments
 (0)