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

MFTF: Extract Action Groups to separate files - magento/module-catalog-inventory #25845

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,20 @@
<?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="AdminProductMaxQtyAllowedInShoppingCartValidationActionGroup" extends="AdminProductSetMaxQtyAllowedInShoppingCartActionGroup">
<arguments>
<argument name="qty" type="string"/>
<argument name="errorMessage" type="string"/>
</arguments>

<waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" after="clickDone" stepKey="waitProductValidationErrorMessageAppears"/>
<see selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" userInput="{{errorMessage}}" after="waitProductValidationErrorMessageAppears" stepKey="checkProductValidationErrorMessage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminProductSetMaxQtyAllowedInShoppingCart">
<actionGroup name="AdminProductSetMaxQtyAllowedInShoppingCartActionGroup">
<arguments>
<argument name="qty" type="string"/>
</arguments>
Expand All @@ -19,13 +19,5 @@
<click selector="{{AdminSlideOutDialogSection.doneButton}}" stepKey="clickDone"/>
</actionGroup>

<actionGroup name="AdminProductMaxQtyAllowedInShoppingCartValidationActionGroup" extends="AdminProductSetMaxQtyAllowedInShoppingCart">
<arguments>
<argument name="qty" type="string"/>
<argument name="errorMessage" type="string"/>
</arguments>

<waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" after="clickDone" stepKey="waitProductValidationErrorMessageAppears"/>
<see selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" userInput="{{errorMessage}}" after="waitProductValidationErrorMessageAppears" stepKey="checkProductValidationErrorMessage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="displayOutOfStockProduct">
<actionGroup name="DisplayOutOfStockProductActionGroup">
<annotations>
<description>Goes to the 'Configuration' page for 'Inventory'. Enables 'Display Out of Stock Products'. Clicks on the Save button.</description>
</annotations>

<amOnPage url="{{InventoryConfigurationPage.url}}" stepKey="navigateToInventoryConfigurationPage"/>
<waitForPageLoad stepKey="waitForConfigPageToLoad"/>
<conditionalClick stepKey="expandProductStockOptions" selector="{{InventoryConfigSection.ProductStockOptionsTab}}" dependentSelector="{{InventoryConfigSection.CheckIfProductStockOptionsTabExpanded}}" visible="true"/>
Expand All @@ -22,18 +22,4 @@
<selectOption selector="{{InventoryConfigSection.DisplayOutOfStockDropdown}}" userInput="Yes" stepKey="switchToYes"/>
<click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/>
</actionGroup>

<actionGroup name="noDisplayOutOfStockProduct">
<annotations>
<description>Goes to the 'Configuration' page for 'Inventory'. Disables 'Display Out of Stock Products'. Clicks on the Save button.</description>
</annotations>

<amOnPage url="{{InventoryConfigurationPage.url}}" stepKey="navigateToInventoryConfigurationPage"/>
<waitForPageLoad stepKey="waitForConfigPageToLoad"/>
<conditionalClick stepKey="expandProductStockOptions" selector="{{InventoryConfigSection.ProductStockOptionsTab}}" dependentSelector="{{InventoryConfigSection.CheckIfProductStockOptionsTabExpanded}}" visible="true"/>
<uncheckOption selector="{{InventoryConfigSection.DisplayOutOfStockSystemValue}}" stepKey="uncheckUseSystemValue"/>
<waitForElementVisible selector="{{InventoryConfigSection.DisplayOutOfStockDropdown}}" stepKey="waitForSwitcherDropdown"/>
<selectOption selector="{{InventoryConfigSection.DisplayOutOfStockDropdown}}" userInput="No" stepKey="switchToNo"/>
<click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/>
</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">
<actionGroup name="NoDisplayOutOfStockProductActionGroup">
<annotations>
<description>Goes to the 'Configuration' page for 'Inventory'. Disables 'Display Out of Stock Products'. Clicks on the Save button.</description>
</annotations>

<amOnPage url="{{InventoryConfigurationPage.url}}" stepKey="navigateToInventoryConfigurationPage"/>
<waitForPageLoad stepKey="waitForConfigPageToLoad"/>
<conditionalClick stepKey="expandProductStockOptions" selector="{{InventoryConfigSection.ProductStockOptionsTab}}" dependentSelector="{{InventoryConfigSection.CheckIfProductStockOptionsTabExpanded}}" visible="true"/>
<uncheckOption selector="{{InventoryConfigSection.DisplayOutOfStockSystemValue}}" stepKey="uncheckUseSystemValue"/>
<waitForElementVisible selector="{{InventoryConfigSection.DisplayOutOfStockDropdown}}" stepKey="waitForSwitcherDropdown"/>
<selectOption selector="{{InventoryConfigSection.DisplayOutOfStockDropdown}}" userInput="No" stepKey="switchToNo"/>
<click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<argument name="errorMessage" value="Please enter a valid number in this field."/>
</actionGroup>
<!-- Fill correct value -->
<actionGroup ref="AdminProductSetMaxQtyAllowedInShoppingCart" stepKey="setProductMaxQtyAllowedInShoppingCartToCorrectNumber">
<actionGroup ref="AdminProductSetMaxQtyAllowedInShoppingCartActionGroup" stepKey="setProductMaxQtyAllowedInShoppingCartToCorrectNumber">
<argument name="qty" value="50"/>
</actionGroup>
<waitForElementNotVisible selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryModal}}" stepKey="waitForModalFormToDisappear"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</before>
<after>
<!-- Don't display out of stock product -->
<actionGroup ref="noDisplayOutOfStockProduct" stepKey="revertDisplayOutOfStockProduct"/>
<actionGroup ref="NoDisplayOutOfStockProductActionGroup" stepKey="revertDisplayOutOfStockProduct"/>

<!-- Delete configurable product -->
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct">
Expand Down Expand Up @@ -105,7 +105,7 @@
<see userInput="$$createSimpleProduct.name$$" selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" stepKey="seeProductNameInConfigurations"/>

<!-- Display out of stock product -->
<actionGroup ref="displayOutOfStockProduct" stepKey="displayOutOfStockProduct"/>
<actionGroup ref="DisplayOutOfStockProductActionGroup" stepKey="displayOutOfStockProduct"/>

<!-- Flash cache -->
<magentoCLI command="cache:flush" stepKey="flushCache"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</before>
<after>
<!-- Don't display out of stock product -->
<actionGroup ref="noDisplayOutOfStockProduct" stepKey="revertDisplayOutOfStockProduct"/>
<actionGroup ref="NoDisplayOutOfStockProductActionGroup" stepKey="revertDisplayOutOfStockProduct"/>

<!-- Delete configurable product -->
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct">
Expand Down Expand Up @@ -119,7 +119,7 @@
<actionGroup ref="saveProductForm" stepKey="saveConfigurableProduct"/>

<!-- Display out of stock product -->
<actionGroup ref="displayOutOfStockProduct" stepKey="displayOutOfStockProduct"/>
<actionGroup ref="DisplayOutOfStockProductActionGroup" stepKey="displayOutOfStockProduct"/>

<!-- Flash cache -->
<magentoCLI command="cache:flush" stepKey="flushCache"/>
Expand All @@ -137,4 +137,4 @@
<waitForPageLoad stepKey="waitForProductPageLoad"/>
<see userInput="$$createConfigProductAttributeOptionThree.option[store_labels][1][label]$$" selector="{{StorefrontProductInfoMainSection.optionByAttributeId($$createConfigProductAttribute.attribute_id$$)}}" stepKey="assertOptionNotAvailable" />
</test>
</tests>
</tests>