Skip to content

Commit

Permalink
ENGCOM-6399: MFTF: Extract Action Groups to separate files - magento/…
Browse files Browse the repository at this point in the history
…module-catalog-inventory #25845
  • Loading branch information
VladimirZaets committed Dec 6, 2019
2 parents d7be970 + 91bd14e commit 042890b
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 30 deletions.
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 Down

0 comments on commit 042890b

Please sign in to comment.