Skip to content

Commit

Permalink
ENGCOM-7304: [MFTF] Use ActionGroup to open products grid page #27697
Browse files Browse the repository at this point in the history
 - Merge Pull Request #27697 from Usik2203/magento2:use-action-group-to-open-admin-product-page
 - Merged commits:
   1. 573308e
   2. e3c47c6
   3. 2888454
   4. fc452ce
   5. 47aa5da
   6. 8f6910c
   7. 7336d74
   8. 1c51ecf
   9. 2c69582
   10. 8f28bb1
   11. fdfb071
   12. 371c4d8
   13. f524ca0
  • Loading branch information
magento-engcom-team committed Jul 15, 2020
2 parents 1d8a6d7 + f524ca0 commit e89ef20
Show file tree
Hide file tree
Showing 135 changed files with 177 additions and 320 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
</after>

<!-- Create a bundle product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/>
<waitForPageLoad stepKey="waitForProductPageLoadBundle"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPageBundle"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
</after>

<!-- Create a bundle product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/>
<waitForPageLoad stepKey="waitForProductPageLoadBundle"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPageBundle"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
</after>

<!-- Create a bundle product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/>
<waitForPageLoad stepKey="waitForProductPageLoadBundle"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPageBundle"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@
<seeElement stepKey="LookingForNameOfProduct" selector="{{StorefrontBundledSection.bundleProductName}}"/>

<!--Testing disabled view-->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="GoToProductCatalog"/>
<waitForPageLoad stepKey="WaitForCatalogProductPageToLoad"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="GoToProductCatalog"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="FindProductEditPage">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@

<!-- Create a product to appear in the widget, fill in basic info first -->

<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductList"/>
<waitForPageLoad stepKey="waitForProductList"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="amOnProductList"/>
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductToggle"/>
<click selector="{{AdminProductGridActionSection.addBundleProduct}}" stepKey="clickAddBundleProduct"/>
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="fillProductName"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
</after>

<!-- Start creating a bundle product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/>
<waitForPageLoad stepKey="waitForProductList"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductList"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
</after>

<!-- Create a bundle product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/>
<waitForPageLoad stepKey="waitForProductPageLoadBundle"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPageBundle"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down Expand Up @@ -84,8 +83,7 @@
<grabTextFrom selector="{{CheckoutCartProductSection.nthBundleOptionName('1')}}" stepKey="grabTotalBefore"/>

<!-- Find the product that we just created using the product grid -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
<waitForPageLoad stepKey="waitForAdminProductPageLoad"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPage"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct">
<argument name="product" value="BundleProduct"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
</after>

<!-- Start creating a bundle product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/>
<waitForPageLoad stepKey="waitForProductList"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductList"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
</after>

<!-- Start creating a bundle product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/>
<waitForPageLoad stepKey="waitForProductList"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductList"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
</after>

<!-- Start creating a bundle product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/>
<waitForPageLoad stepKey="waitForProductList"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductList"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
</after>

<!-- Create a bundle product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/>
<waitForPageLoad stepKey="waitForProductPageLoadBundle"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPageBundle"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminOpenProductIndexPageActionGroup">
<annotations>
<description>Go to products grid page.</description>
</annotations>
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndexPage"/>
<waitForPageLoad stepKey="waitForProductIndexPageLoad"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
</after>

<!--Create product-->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
<waitForPageLoad stepKey="waitForProductIndexPage"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
<actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateSimpleProduct">
<argument name="product" value="SimpleProduct3"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
</after>

<!--Create product-->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
<waitForPageLoad stepKey="waitForProductIndexPage"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
<actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
<argument name="product" value="defaultVirtualProduct"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>
<!--Open Product Index Page and filter the product-->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
<waitForPageLoad stepKey="waitForProductIndexPageToLoad"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct">
<argument name="product" value="SimpleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
<deleteData createDataKey="createSimpleUSCustomer" stepKey="deleteCustomer"/>
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex1"/>
<waitForPageLoad time="30" stepKey="waitForProductIndexPageLoad"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex1"/>
<actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
</after>
Expand Down Expand Up @@ -69,8 +68,7 @@
<seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceLabel_2"/>
<seeElement selector="{{StorefrontCategoryProductSection.productPriceOld('100')}}" stepKey="assertRegularPriceAmount_2"/>
<!--Case: Tier Price for General Customer Group-->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex2"/>
<waitForPageLoad time="30" stepKey="waitForProductPageToLoad1"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex2"/>
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct2">
<argument name="product" value="$$createSimpleProduct$$"/>
</actionGroup>
Expand All @@ -94,8 +92,7 @@
<seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceLabel_4"/>
<seeElement selector="{{StorefrontCategoryProductSection.productPriceOld('100')}}" stepKey="assertRegularPriceAmount_3"/>
<!--Case: Tier Price applied if Product quantity meets Tier Price Condition-->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex3"/>
<waitForPageLoad time="30" stepKey="waitForProductPageToLoad2"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex3"/>
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct3">
<argument name="product" value="$$createSimpleProduct$$"/>
</actionGroup>
Expand Down Expand Up @@ -160,8 +157,7 @@
<actualResult type="variable">grabTextFromSubtotalField3</actualResult>
</assertEquals>
<!--Tier Price is changed in Shopping Cart and is changed on Product page if Tier Price parameters are changed in Admin-->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex4"/>
<waitForPageLoad time="30" stepKey="waitForProductPageToLoa4"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex4"/>
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct4">
<argument name="product" value="$$createSimpleProduct$$"/>
</actionGroup>
Expand Down Expand Up @@ -225,8 +221,7 @@
<seeElement selector="{{StorefrontProductInfoMainSection.productTierPriceAmount('2', '75')}}" stepKey="assertProductTierPriceAmountForSecondRow2"/>
<seeElement selector="{{StorefrontProductInfoMainSection.productTierPriceSavePercentageAmount('1', '10')}}" stepKey="assertProductTierPriceSavePercentageAmountForFirstRow2"/>
<seeElement selector="{{StorefrontProductInfoMainSection.productTierPriceSavePercentageAmount('2', '25')}}" stepKey="assertProductTierPriceSavePercentageAmountForSecondRow2"/>
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex5"/>
<waitForPageLoad time="30" stepKey="waitForProductPageToLoad3"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex5"/>
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct5">
<argument name="product" value="$$createSimpleProduct$$"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
<after>
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
<waitForPageLoad time="30" stepKey="waitForProductIndexPageLoad"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
<actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
</after>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigChildProduct3.price$$" stepKey="seeChildProduct3PriceInStoreFront"/>

<!-- Open Product Index Page and Filter First Child product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
<waitForPageLoad stepKey="waitForProductIndexPageToLoad"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct">
<argument name="product" value="ApiSimpleOne"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
</after>
<!--Open Product Index Page and filter the product-->
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/>

<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct">
<argument name="product" value="SimpleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
<magentoCLI stepKey="setDisplayOutOfStockProduct" command="config:set cataloginventory/options/show_out_of_stock 0" />
</after>
<!--Open Product Index Page and filter the product-->

<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/>

<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct">
<argument name="product" value="SimpleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@
<see userInput="$$createProductAttribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup2"/>

<!-- Assert attribute can be used in product creation -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToCatalogProductGrid"/>
<waitForPageLoad stepKey="waitForPageLoad3"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToCatalogProductGrid"/>
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/>
<click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
</after>

<!-- Find the product that we just created using the product grid and go to its page-->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
<waitForPageLoad stepKey="waitForAdminProductGridLoad"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPage"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct">
<argument name="product" value="SimpleTwo"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
<actionGroup ref="NavigateToAndResetProductGridToDefaultViewActionGroup" stepKey="NavigateToAndResetProductGridToDefaultView"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductList"/>
<waitForPageLoad stepKey="waitForProductList"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="amOnProductList"/>
<!--Create Default Product-->
<click selector="{{AdminProductGridActionSection.addProductBtn}}" stepKey="clickAddDefaultProduct"/>
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="fillDefaultProductName"/>
Expand All @@ -45,8 +44,7 @@
<waitForPageLoad stepKey="waitForPDefaultProductSaved"/>
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="successMessageYouSavedTheProductIsShown"/>
<!--Create product with grid filter Not Visible Individually-->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="ProductList"/>
<waitForPageLoad stepKey="waitForProductPage"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="ProductList"/>
<click selector="{{AdminProductGridActionSection.addProductBtn}}" stepKey="clickAddFilterProduct"/>
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{defaultSimpleProduct.name}}" stepKey="fillProductName"/>
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{defaultSimpleProduct.sku}}" stepKey="fillProductSku"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
</after>

<!-- Open Product Index Page-->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
<waitForPageLoad stepKey="waitForProductIndexPageToLoad"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>

<!-- Select Created Product-->
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@
<dontSeeElement selector="{{AdminProductAttributeSetEditSection.attributesInGroup(emptyGroup.name)}}" stepKey="seeNoAttributes"/>

<!-- Navigate to Catalog > Products -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductPage"/>
<waitForPageLoad stepKey="waitForProductPageLoad"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="amOnProductPage"/>

<!-- Start to create a new simple product with the custom attribute set from the preconditions -->
<click selector="{{AdminProductGridActionSection.addProductBtn}}" stepKey="clickAddProduct"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@
</after>

<!-- Open Product Index Page-->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
<waitForPageLoad stepKey="waitForProductIndexPageToLoad"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>

<!-- Select Created Product-->
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku">
Expand Down
Loading

0 comments on commit e89ef20

Please sign in to comment.