Skip to content

MFTF: Extract Action Groups to separate files - magento/module-grouped-product #25821

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminAssignProductToGroupActionGroup">
<annotations>
<description>Adds the provided Product to a Grouped Product on an Admin Grouped Product creation/edit page.</description>
</annotations>
<arguments>
<argument name="product"/>
</arguments>

<scrollTo selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" x="0" y="-100" stepKey="scrollToGroupedSection"/>
<conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductsSection"/>
<click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/>
<conditionalClick selector="{{AdminAddProductsToGroupPanel.clearFilters}}" dependentSelector="{{AdminAddProductsToGroupPanel.clearFilters}}" visible="true" stepKey="clearExistingFilters"/>
<click selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="showFiltersPanel"/>
<fillField userInput="{{product.name}}" selector="{{AdminAddProductsToGroupPanel.nameFilter}}" stepKey="fillNameFilter"/>
<click selector="{{AdminAddProductsToGroupPanel.applyFilters}}" stepKey="clickApplyFilters"/>
<click selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="selectProduct"/>
<click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<!--Check that required fields are actually required-->
<actionGroup name="CheckRequiredFieldsInGroupedProductFormActionGroup">
<annotations>
<description>Clears the Product Name and SKU fields when adding a Grouped Product and then verifies that they are required after attempting to Save.</description>
</annotations>

<clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/>
<clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/>
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/>
<see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/>
<see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="FillDefaultQuantityForLinkedToGroupProductInGridActionGroup">
<annotations>
<description>Fills the provided Qty for a Product linked to a Grouped Product.</description>
</annotations>
<arguments>
<argument name="productName" type="string"/>
<argument name="qty" type="string"/>
</arguments>

<fillField selector="{{AdminAddedProductsToGroupGrid.inputByProductName(productName)}}" userInput="{{qty}}" stepKey="fillDefaultQtyForLinkedProduct"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="FillGroupedProductFormActionGroup">
<annotations>
<description>Fills in the provided Product Name and SKU on the Grouped Product creation/edit page.</description>
</annotations>
<arguments>
<argument name="product" defaultValue="GroupedProduct"/>
</arguments>

<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/>
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="ViewGroupedProductInAdminGridActionGroup">
<annotations>
<description>Goes to the Admin Products grid page. Filters the grid for the provided Product. Validates that the provided Product appears in the grid.</description>
</annotations>
<arguments>
<argument name="product" defaultValue="GroupedProduct"/>
</arguments>

<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
<waitForPageLoad stepKey="waitForPageLoadInitial"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
<fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/>
<selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionProductType"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
<see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeProductNameInGrid"/>
<click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@
*/
-->

<!--
NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore.
Please find the Comment with proper replacement for each of ActionGroups provided.
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<!--Check that required fields are actually required-->
<actionGroup name="checkRequiredFieldsInGroupedProductForm">
<annotations>
<description>Clears the Product Name and SKU fields when adding a Grouped Product and then verifies that they are required after attempting to Save.</description>
</annotations>


<!-- NOTICE: This ActionGroup is DEPRECATED! Use `CheckRequiredFieldsInGroupedProductFormActionGroup` instead -->
<clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/>
<clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/>
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/>
Expand All @@ -30,20 +34,21 @@
<arguments>
<argument name="product" defaultValue="GroupedProduct"/>
</arguments>


<!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillGroupedProductFormActionGroup` instead -->
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/>
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/>
</actionGroup>

<!--Filter product grid and see expected grouped product-->
<actionGroup name="viewGroupedProductInAdminGrid">
<annotations>
<description>Goes to the Admin Products grid page. Filters the grid for the provided Product. Validates that the provided Product appears in the grid.</description>
</annotations>
<arguments>
<argument name="product" defaultValue="GroupedProduct"/>
</arguments>


<!-- NOTICE: This ActionGroup is DEPRECATED! Use `ViewGroupedProductInAdminGridActionGroup` instead -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
<waitForPageLoad stepKey="waitForPageLoadInitial"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
Expand All @@ -56,7 +61,6 @@
<click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/>
</actionGroup>

<!--Fill product min quantity in group products grid-->
<actionGroup name="fillDefaultQuantityForLinkedToGroupProductInGrid">
<annotations>
<description>Fills the provided Qty for a Product linked to a Grouped Product.</description>
Expand All @@ -65,12 +69,11 @@
<argument name="productName" type="string"/>
<argument name="qty" type="string"/>
</arguments>


<!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillDefaultQuantityForLinkedToGroupProductInGridActionGroup` instead -->
<fillField selector="{{AdminAddedProductsToGroupGrid.inputByProductName(productName)}}" userInput="{{qty}}" stepKey="fillDefaultQtyForLinkedProduct"/>
</actionGroup>

<!-- Assign Specified Product To Grouped Product -->
<!-- Assumes web client is on grouped product edit page -->
<actionGroup name="AdminAssignProductToGroup">
<annotations>
<description>Adds the provided Product to a Grouped Product on an Admin Grouped Product creation/edit page.</description>
Expand All @@ -79,6 +82,7 @@
<argument name="product"/>
</arguments>

<!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAssignProductToGroupActionGroup` instead -->
<scrollTo selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" x="0" y="-100" stepKey="scrollToGroupedSection"/>
<conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductsSection"/>
<click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct">
<argument name="product" value="GroupedProduct"/>
</actionGroup>
<actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm">
<actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillProductForm">
<argument name="product" value="GroupedProduct"/>
</actionGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage">
<argument name="product" value="GroupedProduct"/>
</actionGroup>
<actionGroup ref="fillGroupedProductForm" stepKey="fillMainProductForm">
<actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillMainProductForm">
<argument name="product" value="GroupedProduct"/>
</actionGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@
</actionGroup>

<!-- Fill all main fields -->
<actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm">
<actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillProductForm">
<argument name="product" value="GroupedProduct"/>
</actionGroup>

<!-- Add simple product to the Group -->
<actionGroup ref="AdminAssignProductToGroup" stepKey="addFirstSimpleToGroup">
<actionGroup ref="AdminAssignProductToGroupActionGroup" stepKey="addFirstSimpleToGroup">
<argument name="product" value="$$createProduct$$"/>
</actionGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage">
<argument name="product" value="GroupedProduct"/>
</actionGroup>
<actionGroup ref="fillGroupedProductForm" stepKey="fillMainProductForm">
<actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillMainProductForm">
<argument name="product" value="GroupedProduct"/>
</actionGroup>
<!-- Add two simple products to grouped product -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct">
<argument name="product" value="GroupedProduct"/>
</actionGroup>
<actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm">
<actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillProductForm">
<argument name="product" value="GroupedProduct"/>
</actionGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct">
<argument name="product" value="GroupedProduct"/>
</actionGroup>
<actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm">
<actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillProductForm">
<argument name="product" value="GroupedProduct"/>
</actionGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage">
<argument name="product" value="GroupedProduct"/>
</actionGroup>
<actionGroup ref="fillGroupedProductForm" stepKey="fillMainProductForm">
<actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillMainProductForm">
<argument name="product" value="GroupedProduct"/>
</actionGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct">
<argument name="product" value="GroupedProduct"/>
</actionGroup>
<actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm">
<actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillProductForm">
<argument name="product" value="GroupedProduct"/>
</actionGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateGroupedProduct" after="waitForProductPageLoadGrouped">
<argument name="product" value="GroupedProduct"/>
</actionGroup>
<actionGroup ref="checkRequiredFieldsInGroupedProductForm" stepKey="checkRequiredFieldsProductGrouped" after="goToCreateGroupedProduct"/>
<actionGroup ref="fillGroupedProductForm" stepKey="fillGroupedProductForm" after="checkRequiredFieldsProductGrouped">
<actionGroup ref="CheckRequiredFieldsInGroupedProductFormActionGroup" stepKey="checkRequiredFieldsProductGrouped" after="goToCreateGroupedProduct"/>
<actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillGroupedProductForm" after="checkRequiredFieldsProductGrouped">
<argument name="product" value="GroupedProduct"/>
</actionGroup>
<scrollTo selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" x="0" y="-100" stepKey="scrollToGroupedSection" after="fillGroupedProductForm"/>
Expand All @@ -29,7 +29,7 @@
<checkOption selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="checkFilterResult" after="filterGroupedProductOptions"/>
<click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts" after="checkFilterResult"/>
<actionGroup ref="saveProductForm" stepKey="saveGroupedProduct" after="clickAddSelectedGroupProducts"/>
<actionGroup ref="viewGroupedProductInAdminGrid" stepKey="viewGroupedProductInGrid" after="saveGroupedProduct">
<actionGroup ref="ViewGroupedProductInAdminGridActionGroup" stepKey="viewGroupedProductInGrid" after="saveGroupedProduct">
<argument name="product" value="GroupedProduct"/>
</actionGroup>

Expand All @@ -39,4 +39,4 @@
<argument name="product" value="GroupedProduct"/>
</actionGroup>
</test>
</tests>
</tests>