Skip to content

Commit feaed6b

Browse files
committed
Refactoring the test
1 parent 592c792 commit feaed6b

File tree

1 file changed

+79
-33
lines changed

1 file changed

+79
-33
lines changed

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

Lines changed: 79 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -34,60 +34,106 @@
3434
</after>
3535

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

4447
<!-- Update simple product with regular price(in stock) -->
45-
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductDisabled.name}}" stepKey="fillSimpleProductName"/>
46-
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductDisabled.sku}}" stepKey="fillSimpleProductSku"/>
47-
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductDisabled.price}}" stepKey="fillSimpleProductPrice"/>
48-
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductDisabled.quantity}}" stepKey="fillSimpleProductQuantity"/>
49-
<selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductDisabled.status}}" stepKey="selectStockStatusInStock"/>
50-
<fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductDisabled.weight}}" stepKey="fillSimpleProductWeight"/>
51-
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/>
52-
<fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductDisabled.urlKey}}" stepKey="fillUrlKey"/>
48+
<actionGroup ref="FillMainProductFormByStringActionGroup" stepKey="fillSimpleProductName">
49+
<argument name="productName" value="{{simpleProductDisabled.name}}"/>
50+
<argument name="productSku" value="{{simpleProductDisabled.sku}}"/>
51+
<argument name="productPrice" value="{{simpleProductDisabled.price}}"/>
52+
<argument name="productQuantity" value="{{simpleProductDisabled.quantity}}"/>
53+
<argument name="productStatus" value="{{simpleProductDisabled.status}}"/>
54+
<argument name="productWeight" value="{{simpleProductDisabled.weight}}"/>
55+
</actionGroup>
56+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
57+
stepKey="fillSimpleProductSku"/>
58+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
59+
stepKey="fillSimpleProductPrice"/>
60+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
61+
stepKey="fillSimpleProductQuantity"/>
62+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
63+
stepKey="selectStockStatusInStock"/>
64+
<actionGroup ref="SetCategoryByNameActionGroup" stepKey="fillSimpleProductWeight">
65+
<argument name="categoryName" value="$$initialCategoryEntity.name$$"/>
66+
</actionGroup>
67+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
68+
stepKey="clickAdminProductSEOSection"/>
69+
<actionGroup ref="SetProductUrlKeyByStringActionGroup" stepKey="fillUrlKey">
70+
<argument name="urlKey" value="{{simpleProductDisabled.urlKey}}"/>
71+
</actionGroup>
5372
<scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/>
54-
<click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="clickEnableProductLabelToDisableProduct"/>
73+
<actionGroup ref="ToggleProductEnabledActionGroup" stepKey="clickEnableProductLabelToDisableProduct"/>
5574
<actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/>
5675

5776
<!-- Verify customer see success message -->
58-
<see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/>
77+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeAssertSimpleProductSaveSuccessMessage">
78+
<argument name="message" value="You saved the product."/>
79+
</actionGroup>
5980

6081
<!-- Search updated simple product(from above step) in the grid -->
6182
<actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPageToSearchUpdatedSimpleProduct"/>
62-
<conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clickClearAll"/>
63-
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickFiltersButton"/>
64-
<fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{simpleProductDisabled.name}}" stepKey="fillSimpleProductNameInNameFilter"/>
65-
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{simpleProductDisabled.sku}}" stepKey="fillProductSku"/>
66-
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/>
83+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
84+
stepKey="clickClearAll"/>
85+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
86+
stepKey="clickFiltersButton"/>
87+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
88+
stepKey="fillSimpleProductNameInNameFilter"/>
89+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
90+
stepKey="fillProductSku"/>
91+
<actionGroup ref="FilterProductGridBySkuAndNameActionGroup" stepKey="clickApplyFiltersButton">
92+
<argument name="product" value="simpleProductDisabled"/>
93+
</actionGroup>
6794
<click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/>
6895
<waitForPageLoad stepKey="waitUntilSimpleProductPageIsOpened"/>
6996

7097
<!-- Verify customer see updated simple product in the product form page -->
71-
<seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductDisabled.name}}" stepKey="seeSimpleProductName"/>
72-
<seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductDisabled.sku}}" stepKey="seeSimpleProductSku"/>
73-
<seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductDisabled.price}}" stepKey="seeSimpleProductPrice"/>
74-
<seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductDisabled.quantity}}" stepKey="seeSimpleProductQuantity"/>
75-
<seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductDisabled.status}}" stepKey="seeSimpleProductStockStatus"/>
76-
<seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductDisabled.weight}}" stepKey="seeSimpleProductWeight"/>
98+
<actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="seeSimpleProductName">
99+
<argument name="productStatus" value="{{SimpleProductDisabled.status}}"/>
100+
<argument name="productName" value="{{simpleProductDisabled.name}}"/>
101+
<argument name="productSku" value="{{simpleProductDisabled.sku}}"/>
102+
<argument name="productPrice" value="{{simpleProductDisabled.price}}"/>
103+
<argument name="productQuantity" value="{{simpleProductDisabled.quantity}}"/>
104+
<argument name="productWeight" value="{{simpleProductDisabled.weight}}"/>
105+
<argument name="categoryName" value="$$initialCategoryEntity.name$$"/>
106+
</actionGroup>
107+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
108+
stepKey="seeSimpleProductSku"/>
109+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
110+
stepKey="seeSimpleProductPrice"/>
111+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
112+
stepKey="seeSimpleProductQuantity"/>
113+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
114+
stepKey="seeSimpleProductStockStatus"/>
115+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
116+
stepKey="seeSimpleProductWeight"/>
77117
<scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSectionHeader"/>
78118
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSectionHeader"/>
79-
<seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductDisabled.urlKey}}" stepKey="seeSimpleProductUrlKey"/>
119+
<seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductDisabled.urlKey}}"
120+
stepKey="seeSimpleProductUrlKey"/>
80121

81122
<!--Verify customer don't see updated simple product link on magento storefront page -->
82-
<amOnPage url="{{StorefrontProductPage.url(simpleProductDisabled.urlKey)}}" stepKey="goToMagentoStorefrontPage"/>
83-
<waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/>
123+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToMagentoStorefrontPage"/>
124+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
125+
stepKey="waitForStoreFrontProductPageLoad"/>
84126
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox">
85127
<argument name="phrase" value="{{simpleProductDisabled.sku}}"/>
86128
</actionGroup>
87-
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearchTextBox"/>
88-
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchTextBoxButton"/>
89-
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/>
90-
<actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup" stepKey="dontSeeProductNameOnStorefrontPage">
129+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
130+
stepKey="waitForSearchTextBox"/>
131+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
132+
stepKey="clickSearchTextBoxButton"/>
133+
<comment userInput="Comment is added to preserve the step key for backward compatibility"
134+
stepKey="waitForSearch"/>
135+
<actionGroup ref="AssertStorefrontProductNameIsNotOnProductMainPageActionGroup"
136+
stepKey="dontSeeProductNameOnStorefrontPage">
91137
<argument name="productName" value="{{simpleProductDisabled.name}}"/>
92138
</actionGroup>
93139
</test>

0 commit comments

Comments
 (0)