Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace repetitive actions with Action Groups in AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest #32539

Original file line number Diff line number Diff line change
Expand Up @@ -39,67 +39,105 @@
<actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openProductCatalogPage">
<argument name="productSku" value="$initialSimpleProduct.sku$"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility"
stepKey="filterProductGrid"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility"
stepKey="clickFirstRowToOpenDefaultSimpleProduct"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility"
stepKey="waitUntilProductIsOpened"/>

<!-- Update simple product with regular price(in stock) -->
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="fillSimpleProductName"/>
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductRegularPrice32501InStock.sku}}" stepKey="fillSimpleProductSku"/>
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductRegularPrice32501InStock.price}}" stepKey="fillSimpleProductPrice"/>
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductRegularPrice32501InStock.quantity}}" stepKey="fillSimpleProductQuantity"/>
<selectOption selector="{{AdminProductFormSection.stockStatus}}" userInput="{{simpleProductRegularPrice32501InStock.status}}" stepKey="selectStockStatusInStock"/>
<fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice32501InStock.weight}}" stepKey="fillSimpleProductWeight"/>
<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/>
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$initialCategoryEntity.name$$" stepKey="fillSearchForInitialCategory"/>
<waitForPageLoad stepKey="waitForCategory1"/>
<click selector="{{AdminProductFormSection.selectCategory($$initialCategoryEntity.name$$)}}" stepKey="unselectInitialCategory"/>
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="$$categoryEntity.name$$" stepKey="fillSearchCategory"/>
<waitForPageLoad stepKey="waitForCategory2"/>
<click selector="{{AdminProductFormSection.selectCategory($$categoryEntity.name$$)}}" stepKey="clickOnCategory"/>
<actionGroup ref="FillMainProductFormByStringActionGroup" stepKey="fillSimpleProductName">
<argument name="productName" value="{{simpleProductRegularPrice32501InStock.name}}"/>
<argument name="productSku" value="{{simpleProductRegularPrice32501InStock.sku}}"/>
<argument name="productPrice" value="{{simpleProductRegularPrice32501InStock.price}}"/>
<argument name="productQuantity" value="{{simpleProductRegularPrice32501InStock.quantity}}"/>
<argument name="productStatus" value="{{simpleProductRegularPrice32501InStock.status}}"/>
<argument name="productWeight" value="{{simpleProductRegularPrice32501InStock.weight}}"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility"
stepKey="fillSimpleProductSku"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility"
stepKey="fillSimpleProductPrice"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility"
stepKey="fillSimpleProductQuantity"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility"
stepKey="selectStockStatusInStock"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility"
stepKey="fillSimpleProductWeight"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility"
stepKey="clickCategoriesDropDown"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility"
stepKey="fillSearchForInitialCategory"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility"
stepKey="waitForCategory1"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility"
stepKey="unselectInitialCategory"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility"
stepKey="fillSearchCategory"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility"
stepKey="waitForCategory2"/>
<actionGroup ref="SetCategoryByNameActionGroup" stepKey="clickOnCategory">
<argument name="categoryName" value="$$categoryEntity.name$$"/>
</actionGroup>
<actionGroup ref="AdminSubmitCategoriesPopupActionGroup" stepKey="clickOnDoneAdvancedCategorySelect"/>
<selectOption selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice32501InStock.visibility}}" stepKey="selectVisibility"/>
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection"/>
<fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice32501InStock.urlKey}}" stepKey="fillUrlKey"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickAdminProductSEOSection"/>
<actionGroup ref="SetProductUrlKeyByStringActionGroup" stepKey="fillUrlKey">
<argument name="urlKey" value="{{simpleProductRegularPrice32501InStock.urlKey}}"/>
</actionGroup>
<scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/>
<actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickSaveButton"/>

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

<!-- Search updated simple product(from above step) in the grid page -->
<actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPageToSearchUpdatedSimpleProduct"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clickClearAll"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="clickFiltersButton"/>
<fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="fillSimpleProductNameInNameFilter"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{simpleProductRegularPrice32501InStock.sku}}" stepKey="fillProductSku"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickClearAll"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickFiltersButton"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillSimpleProductNameInNameFilter"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductSku"/>
<actionGroup ref="FilterProductGridBySkuAndNameActionGroup" stepKey="clickApplyFiltersButton">
<argument name="product" value="simpleProductRegularPrice32501InStock"/>
</actionGroup>
<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickFirstRowToVerifyUpdatedSimpleProductVisibleInGrid"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilSimpleProductPageIsOpened"/>

<!-- Verify customer see updated simple product in the product form page -->
<seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="seeSimpleProductName"/>
<seeInField selector="{{AdminProductFormSection.productSku}}" userInput="{{simpleProductRegularPrice32501InStock.sku}}" stepKey="seeSimpleProductSku"/>
<seeInField selector="{{AdminProductFormSection.productPrice}}" userInput="{{simpleProductRegularPrice32501InStock.price}}" stepKey="seeSimpleProductPrice"/>
<seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{simpleProductRegularPrice32501InStock.quantity}}" stepKey="seeSimpleProductQuantity"/>
<seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{simpleProductRegularPrice32501InStock.status}}" stepKey="seeSimpleProductStockStatus"/>
<seeInField selector="{{AdminProductFormSection.productWeight}}" userInput="{{simpleProductRegularPrice32501InStock.weight}}" stepKey="seeSimpleProductWeight"/>

<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/>
<actionGroup ref="AssertAdminProductIsAssignedToCategoryActionGroup" stepKey="selectedCategories">
<actionGroup ref="AdminAssertProductInfoOnEditPageActionGroup" stepKey="seeSimpleProductName">
<argument name="productName" value="{{simpleProductRegularPrice32501InStock.name}}"/>
<argument name="productSku" value="{{simpleProductRegularPrice32501InStock.sku}}"/>
<argument name="productPrice" value="{{simpleProductRegularPrice32501InStock.price}}"/>
<argument name="productQuantity" value="{{simpleProductRegularPrice32501InStock.quantity}}"/>
<argument name="productWeight" value="{{simpleProductRegularPrice32501InStock.weight}}"/>
<argument name="productVisibility" value="{{simpleProductRegularPrice32501InStock.visibility}}"/>
<argument name="categoryName" value="$$categoryEntity.name$$"/>
</actionGroup>
<seeInField selector="{{AdminProductFormSection.visibility}}" userInput="{{simpleProductRegularPrice32501InStock.visibility}}" stepKey="seeVisibility"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductSku"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductPrice"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductQuantity"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductStockStatus"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductWeight"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickCategoriesDropDownToVerify"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectedCategories"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeVisibility"/>
<scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection1"/>
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickAdminProductSEOSection1"/>
<seeInField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{simpleProductRegularPrice32501InStock.urlKey}}" stepKey="seeUrlKey"/>

<comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/>

<!--Verify customer see updated simple product link on category page -->
<amOnPage url="{{StorefrontCategoryPage.url($$categoryEntity.name$$)}}" stepKey="openCategoryPage"/>
<waitForPageLoad stepKey="waitForCategoryPageLoad"/>
<see selector="{{StorefrontCategoryMainSection.productLink}}" userInput="{{simpleProductRegularPrice32501InStock.name}}" stepKey="seeSimpleProductNameOnCategoryPage"/>
<actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage">
<argument name="categoryName" value="$$categoryEntity.name$$"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCategoryPageLoad"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeSimpleProductNameOnCategoryPage"/>
<actionGroup ref="AssertStorefrontProductIsPresentOnCategoryPageActionGroup" stepKey="assertFirstBundleProduct">
<argument name="productName" value="{{simpleProductRegularPrice32501InStock.name}}"/>
</actionGroup>

<!-- Verify customer see updated simple product (from the above step) on the storefront page -->
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage">
Expand Down Expand Up @@ -127,8 +165,8 @@
<comment userInput="Comment is added to preserve the step key for backward compatibilityr" stepKey="assertOldPriceTextOnProductPage"/>

<!--Verify customer don't see updated simple product link on magento storefront page and is searchable by sku -->
<amOnPage url="{{StorefrontProductPage.url(simpleProductRegularPrice32501InStock.urlKey)}}" stepKey="goToMagentoStorefrontPage"/>
<waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/>
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToMagentoStorefrontPage"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForStoreFrontProductPageLoad"/>
<actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="fillSimpleProductSkuInSearchTextBox">
<argument name="phrase" value="{{simpleProductRegularPrice32501InStock.sku}}"/>
</actionGroup>
Expand Down