Skip to content

Commit 80ccd9f

Browse files
committed
Merge remote-tracking branch 'origin/MC-17605' into 2.2-develop-pr108
2 parents e465c8a + 6db5533 commit 80ccd9f

15 files changed

+271
-5
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,15 @@
6060

6161
<!--Save product and see success message-->
6262
<actionGroup name="saveProductForm">
63-
<scrollToTopOfPage stepKey="scrollToTop"/>
63+
<annotations>
64+
<description>Clicks on the Save button. Validates that the Success Message is present and correct.</description>
65+
</annotations>
66+
67+
<scrollToTopOfPage stepKey="scrollTopPageProduct"/>
68+
<waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveProductButton"/>
6469
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
65-
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/>
70+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitProductSaveSuccessMessage"/>
71+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/>
6672
</actionGroup>
6773

6874
<!--Upload image for product-->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminCatalogInventoryConfigurationMaxQtyAllowedInShoppingCartValidationActionGroup">
12+
<arguments>
13+
<argument name="qty" type="string"/>
14+
<argument name="errorMessage" type="string"/>
15+
</arguments>
16+
17+
<fillField selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQty}}" userInput="{{qty}}" stepKey="setMaxSaleQtyValue"/>
18+
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveConfigButton"/>
19+
<waitForElementVisible selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyError}}" stepKey="waitValidationErrorMessageAppears"/>
20+
<see selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyError}}" userInput="{{errorMessage}}" stepKey="checkValidationErrorMessage"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminProductSetMaxQtyAllowedInShoppingCart">
12+
<arguments>
13+
<argument name="qty" type="string"/>
14+
</arguments>
15+
<conditionalClick selector="{{AdminProductFormSection.advancedInventoryLink}}" dependentSelector="{{AdminProductFormAdvancedInventorySection.advancedInventoryModal}}" visible="false" stepKey="clickOnAdvancedInventoryLinkIfNeeded"/>
16+
<waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.maxiQtyConfigSetting}}" stepKey="waitForAdvancedInventoryModalWindowOpen"/>
17+
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.maxiQtyConfigSetting}}" stepKey="uncheckMaxQtyCheckBox"/>
18+
<fillField selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCart}}" userInput="{{qty}}" stepKey="fillMaxAllowedQty"/>
19+
<click selector="{{AdminSlideOutDialogSection.doneButton}}" stepKey="clickDone"/>
20+
</actionGroup>
21+
22+
<actionGroup name="AdminProductMaxQtyAllowedInShoppingCartValidationActionGroup" extends="AdminProductSetMaxQtyAllowedInShoppingCart">
23+
<arguments>
24+
<argument name="qty" type="string"/>
25+
<argument name="errorMessage" type="string"/>
26+
</arguments>
27+
28+
<waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" after="clickDone" stepKey="waitProductValidationErrorMessageAppears"/>
29+
<see selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" userInput="{{errorMessage}}" after="waitProductValidationErrorMessageAppears" stepKey="checkProductValidationErrorMessage"/>
30+
</actionGroup>
31+
</actionGroups>

app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventoryConfigData.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,17 @@
2020
<data key="label">No</data>
2121
<data key="value">0</data>
2222
</entity>
23+
<entity name="EnableCatalogInventoryConfigData">
24+
<!--Default Value -->
25+
<data key="path">cataloginventory/options/can_subtract</data>
26+
<data key="scope_id">0</data>
27+
<data key="label">Yes</data>
28+
<data key="value">1</data>
29+
</entity>
30+
<entity name="DisableCatalogInventoryConfigData">
31+
<data key="path">cataloginventory/options/can_subtract</data>
32+
<data key="scope_id">0</data>
33+
<data key="label">No</data>
34+
<data key="value">0</data>
35+
</entity>
2336
</entities>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="DefaultValueForMaxSaleQty" type="cataloginventory_item_options">
12+
<requiredEntity type="max_sale_qty">MaxSaleQtyDefaultValue</requiredEntity>
13+
</entity>
14+
<entity name="MaxSaleQtyDefaultValue" type="max_sale_qty">
15+
<data key="value">10000</data>
16+
</entity>
17+
</entities>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
9+
<operation name="CatalogInventoryProductStockOptionsConfiguration" dataType="cataloginventory_item_options" type="create"
10+
auth="adminFormKey" url="/admin/system_config/save/section/cataloginventory/" method="POST" successRegex="/messages-message-success/">
11+
<object key="groups" dataType="cataloginventory_item_options">
12+
<object key="item_options" dataType="cataloginventory_item_options">
13+
<object key="fields" dataType="cataloginventory_item_options">
14+
<object key="max_sale_qty" dataType="max_sale_qty">
15+
<field key="value">integer</field>
16+
</object>
17+
</object>
18+
</object>
19+
</object>
20+
</operation>
21+
</operations>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminInventoryProductStockOptionsConfigPage" url="admin/system_config/edit/section/cataloginventory/#cataloginventory_item_options-link" area="admin" module="Magento_Config">
12+
<section name="AdminInventoryProductStockOptionsConfigSection"/>
13+
</page>
14+
</pages>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminProductCreatePage" url="catalog/product/new/set/{{set}}/type/{{type}}/" area="admin" module="Magento_Catalog" parameterized="true">
12+
<section name="AdminProductFormAdvancedInventorySection"/>
13+
</page>
14+
</pages>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminInventoryProductStockOptionsConfigSection">
12+
<element name="maxSaleQtyInherit" type="checkbox" selector="#cataloginventory_item_options_max_sale_qty_inherit" timeout="30"/>
13+
<element name="maxSaleQty" type="input" selector="#cataloginventory_item_options_max_sale_qty"/>
14+
<element name="maxSaleQtyError" type="input" selector="#cataloginventory_item_options_max_sale_qty-error"/>
15+
</section>
16+
</sections>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminProductFormAdvancedInventorySection">
12+
<element name="maxiQtyConfigSetting" type="checkbox" selector="[name='product[stock_data][use_config_max_sale_qty]']"/>
13+
<element name="maxiQtyAllowedInCart" type="input" selector="[name='product[stock_data][max_sale_qty]']"/>
14+
<element name="maxiQtyAllowedInCartError" type="text" selector="[name='product[stock_data][max_sale_qty]'] + label.admin__field-error"/>
15+
<element name="advancedInventoryModal" type="block" selector=".product_form_product_form_advanced_inventory_modal[data-role=modal]"/>
16+
</section>
17+
</sections>

0 commit comments

Comments
 (0)