From 778b42b6b9ce7f083c7e7adf45eb588519b7e538 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra Date: Mon, 2 Sep 2019 17:12:52 +0300 Subject: [PATCH 01/24] MC-17606: Unable to save edited product when max_sale_qty is Magento's default --- app/code/Magento/CatalogInventory/etc/adminhtml/system.xml | 2 +- .../view/adminhtml/ui_component/product_form.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogInventory/etc/adminhtml/system.xml b/app/code/Magento/CatalogInventory/etc/adminhtml/system.xml index 08ed0a8f49470..546f838b9b428 100644 --- a/app/code/Magento/CatalogInventory/etc/adminhtml/system.xml +++ b/app/code/Magento/CatalogInventory/etc/adminhtml/system.xml @@ -55,7 +55,7 @@ - validate-number + validate-number validate-greater-than-zero diff --git a/app/code/Magento/CatalogInventory/view/adminhtml/ui_component/product_form.xml b/app/code/Magento/CatalogInventory/view/adminhtml/ui_component/product_form.xml index fc0690157fb37..b813aa5d356cb 100644 --- a/app/code/Magento/CatalogInventory/view/adminhtml/ui_component/product_form.xml +++ b/app/code/Magento/CatalogInventory/view/adminhtml/ui_component/product_form.xml @@ -304,6 +304,7 @@ [GLOBAL] + true true From 931af1d74c659912c5bad7477ca7070fb1488f60 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra Date: Mon, 2 Sep 2019 17:13:15 +0300 Subject: [PATCH 02/24] MC-17606: Unable to save edited product when max_sale_qty is Magento's default --- .../ActionGroup/AdminProductActionGroup.xml | 4 +- .../Test/Mftf/Page/AdminProductCreatePage.xml | 1 - .../ActionGroup/AdminProductActionGroup.xml | 21 +++++ .../Mftf/Data/CatalogInventoryConfigData.xml | 13 +++ .../Data/CatalogInventoryItemOptionsData.xml | 24 ++++++ .../Mftf/Data/CatalogInventryConfigData.xml | 24 ------ .../cataloginventory_item_options-meta.xml | 21 +++++ ...InventoryProductStockOptionsConfigPage.xml | 14 ++++ .../Test/Mftf/Page/AdminProductCreatePage.xml | 14 ++++ ...entoryProductStockOptionsConfigSection.xml | 16 ++++ ...minProductFormAdvancedInventorySection.xml | 2 + .../Mftf/Section/AdminProductFormSection.xml | 14 ++++ ...eroMaximumQtyAllowedInShoppingCartTest.xml | 83 +++++++++++++++++++ .../AdminSaveConfigActionGroup.xml | 4 +- 14 files changed, 226 insertions(+), 29 deletions(-) create mode 100644 app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductActionGroup.xml create mode 100644 app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventoryItemOptionsData.xml delete mode 100644 app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventryConfigData.xml create mode 100644 app/code/Magento/CatalogInventory/Test/Mftf/Metadata/cataloginventory_item_options-meta.xml create mode 100644 app/code/Magento/CatalogInventory/Test/Mftf/Page/AdminInventoryProductStockOptionsConfigPage.xml create mode 100644 app/code/Magento/CatalogInventory/Test/Mftf/Page/AdminProductCreatePage.xml create mode 100644 app/code/Magento/CatalogInventory/Test/Mftf/Section/AdminInventoryProductStockOptionsConfigSection.xml rename app/code/Magento/{Catalog => CatalogInventory}/Test/Mftf/Section/AdminProductFormAdvancedInventorySection.xml (91%) create mode 100644 app/code/Magento/CatalogInventory/Test/Mftf/Section/AdminProductFormSection.xml create mode 100644 app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml index 0bb73e7416b07..a2588d6cb908b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml @@ -134,8 +134,8 @@ - - + + diff --git a/app/code/Magento/Catalog/Test/Mftf/Page/AdminProductCreatePage.xml b/app/code/Magento/Catalog/Test/Mftf/Page/AdminProductCreatePage.xml index e4c4ece5ac6cf..5c7cb4d51084f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Page/AdminProductCreatePage.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Page/AdminProductCreatePage.xml @@ -18,7 +18,6 @@
-
diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductActionGroup.xml b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductActionGroup.xml new file mode 100644 index 0000000000000..b4694365caff7 --- /dev/null +++ b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductActionGroup.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventoryConfigData.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventoryConfigData.xml index e14c36446fc2b..cd5a8cf5bbac9 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventoryConfigData.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventoryConfigData.xml @@ -20,4 +20,17 @@ No 0 + + + cataloginventory/options/can_subtract + 0 + Yes + 1 + + + cataloginventory/options/can_subtract + 0 + No + 0 + diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventoryItemOptionsData.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventoryItemOptionsData.xml new file mode 100644 index 0000000000000..912218e63abbe --- /dev/null +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventoryItemOptionsData.xml @@ -0,0 +1,24 @@ + + + + + + MaxSaleQtyZeroValue + + + 0 + + + + MaxSaleQtyDefaultValue + + + 10000 + + diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventryConfigData.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventryConfigData.xml deleted file mode 100644 index 3a49b821ead5f..0000000000000 --- a/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventryConfigData.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - cataloginventory/options/can_subtract - 0 - Yes - 1 - - - cataloginventory/options/can_subtract - 0 - No - 0 - - \ No newline at end of file diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Metadata/cataloginventory_item_options-meta.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Metadata/cataloginventory_item_options-meta.xml new file mode 100644 index 0000000000000..7672cb7478f1a --- /dev/null +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Metadata/cataloginventory_item_options-meta.xml @@ -0,0 +1,21 @@ + + + + + + + + + integer + + + + + + diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Page/AdminInventoryProductStockOptionsConfigPage.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Page/AdminInventoryProductStockOptionsConfigPage.xml new file mode 100644 index 0000000000000..3d8c3ef3cf9f8 --- /dev/null +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Page/AdminInventoryProductStockOptionsConfigPage.xml @@ -0,0 +1,14 @@ + + + + + +
+ + diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Page/AdminProductCreatePage.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Page/AdminProductCreatePage.xml new file mode 100644 index 0000000000000..5835e7564c172 --- /dev/null +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Page/AdminProductCreatePage.xml @@ -0,0 +1,14 @@ + + + + + +
+ + diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Section/AdminInventoryProductStockOptionsConfigSection.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Section/AdminInventoryProductStockOptionsConfigSection.xml new file mode 100644 index 0000000000000..ef7fe30f4970b --- /dev/null +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Section/AdminInventoryProductStockOptionsConfigSection.xml @@ -0,0 +1,16 @@ + + + + +
+ + + +
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAdvancedInventorySection.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Section/AdminProductFormAdvancedInventorySection.xml similarity index 91% rename from app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAdvancedInventorySection.xml rename to app/code/Magento/CatalogInventory/Test/Mftf/Section/AdminProductFormAdvancedInventorySection.xml index 4196a86fe25db..cdcd53144e70b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAdvancedInventorySection.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Section/AdminProductFormAdvancedInventorySection.xml @@ -30,5 +30,7 @@ + +
diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Section/AdminProductFormSection.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Section/AdminProductFormSection.xml new file mode 100644 index 0000000000000..f4b79b17b3fc3 --- /dev/null +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Section/AdminProductFormSection.xml @@ -0,0 +1,14 @@ + + + + +
+ +
+
diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml new file mode 100644 index 0000000000000..6ad7e4dab16f4 --- /dev/null +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml @@ -0,0 +1,83 @@ + + + + + + + + + + <description value="Verify that product maximum qty allowed in shopping cart can't be set to zero or less"/> + <severity value="MAJOR"/> + <useCaseId value="MC-17606"/> + <testCaseId value="MC-17636"/> + <group value="catalog"/> + <group value="catalogInventory"/> + </annotations> + <before> + <createData entity="DefaultValueForMaxSaleQty" stepKey="setDefaultValueForMaxSaleQty"/> + <createData entity="SimpleProduct2" stepKey="createdProduct"/> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <createData entity="DefaultValueForMaxSaleQty" stepKey="setDefaultValueForMaxSaleQty"/> + <deleteData createDataKey="createdProduct" stepKey="deleteProduct"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <amOnPage url="{{AdminInventoryProductStockOptionsConfigPage.url}}" stepKey="openInventoryConfigPage"/> + <uncheckOption selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyInherit}}" stepKey="uncheckUseDefaultValueForMaxSaleQty"/> + <!-- Validate zero value --> + <fillField selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQty}}" userInput="0" stepKey="setMaxSaleQtyValueToZero"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveConfigButton"/> + <waitForElementVisible selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyError}}" stepKey="waitValidationErrorMessageAppearsZero"/> + <see selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyError}}" userInput="Please enter a number greater than 0 in this field." stepKey="checkValidationErrorMessageZero"/> + <!-- Validate negative value --> + <fillField selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQty}}" userInput="-1" stepKey="setMaxSaleQtyValueToNegative"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveConfigButtonNegative"/> + <waitForElementVisible selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyError}}" stepKey="waitValidationErrorMessageAppearsNegative"/> + <see selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyError}}" userInput="Please enter a number greater than 0 in this field." stepKey="checkValidationErrorMessageNegative"/> + <!-- Validate alphabetical value --> + <fillField selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQty}}" userInput="abc" stepKey="setMaxSaleQtyValueToAlphabetical"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveConfigButtonAlphabetical"/> + <waitForElementVisible selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyError}}" stepKey="waitValidationErrorMessageAppearsAlphabetical"/> + <see selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyError}}" userInput="Please enter a valid number in this field." stepKey="checkValidationErrorMessageAlphabetical"/> + <!-- Fill correct value --> + <fillField selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQty}}" userInput="100" stepKey="setMaxSaleQtyValueToCorrectNumber"/> + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfigWithCorrectNumber"/> + + <!-- Go to product page --> + <amOnPage url="{{AdminProductEditPage.url($$createdProduct.id$$)}}" stepKey="openAdminProductEditPage"/> + <!-- Validate zero value --> + <actionGroup ref="AdminProductSetMaxQtyAllowedInShoppingCart" stepKey="setProductMaxQtyAllowedInShoppingCartToZero"> + <argument name="qty" value="0"/> + </actionGroup> + <waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" stepKey="waitProductValidationErrorMessageAppearsZero"/> + <see selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" userInput="Please enter a number greater than 0 in this field." stepKey="checkProductValidationErrorMessageZero"/> + <!-- Validate negative value --> + <actionGroup ref="AdminProductSetMaxQtyAllowedInShoppingCart" stepKey="setProductMaxQtyAllowedInShoppingCartToNegative"> + <argument name="qty" value="-1"/> + </actionGroup> + <waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" stepKey="waitProductValidationErrorMessageAppearsNegative"/> + <see selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" userInput="Please enter a number greater than 0 in this field." stepKey="checkProductValidationErrorMessageNegative"/> + <!-- Validate alphabetical value --> + <actionGroup ref="AdminProductSetMaxQtyAllowedInShoppingCart" stepKey="setProductMaxQtyAllowedInShoppingCartToAlphabetical"> + <argument name="qty" value="abc"/> + </actionGroup> + <waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" stepKey="waitProductValidationErrorMessageAppearsAlphabetical"/> + <see selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" userInput="Please enter a valid number in this field." stepKey="checkProductValidationErrorMessageAlphabetical"/> + + <!-- Fill correct value --> + <actionGroup ref="AdminProductSetMaxQtyAllowedInShoppingCart" stepKey="setProductMaxQtyAllowedInShoppingCartToCorrectNumber"> + <argument name="qty" value="50"/> + </actionGroup> + <waitForElementNotVisible selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryModal}}" stepKey="waitForModalFormToDisappear"/> + <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + </test> +</tests> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/AdminSaveConfigActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/AdminSaveConfigActionGroup.xml index 6ed0cfe95cb94..bd23292d3ee6a 100644 --- a/app/code/Magento/Config/Test/Mftf/ActionGroup/AdminSaveConfigActionGroup.xml +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/AdminSaveConfigActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminSaveConfigActionGroup"> <click selector="{{AdminConfigSection.saveButton}}" stepKey="clickSaveConfigBtn"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration." stepKey="seeSuccessMessage"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="seeSuccessMessage"/> </actionGroup> </actionGroups> From eeb60b0ec5b5dc9df7b2f2e03adffefa1dc37a8a Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Mon, 2 Sep 2019 18:42:52 +0300 Subject: [PATCH 03/24] MC-17606: Unable to save edited product when max_sale_qty is Magento's default --- .../Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml index a2588d6cb908b..96c2c2900dccf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml @@ -152,6 +152,7 @@ <description>EXTENDS: saveProductForm. Removes 'seeSaveConfirmation'.</description> </annotations> + <remove keyForRemoval="waitProductSaveSuccessMessage"/> <remove keyForRemoval="seeSaveConfirmation"/> </actionGroup> From 2ac7ada06a077c7d47cb38b035ef40a8a75402f0 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Tue, 3 Sep 2019 12:35:37 +0300 Subject: [PATCH 04/24] MC-17606: Unable to save edited product when max_sale_qty is Magento's default --- ...sertStorefrontShoppingCartSummaryWithShippingActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontShoppingCartSummaryWithShippingActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontShoppingCartSummaryWithShippingActionGroup.xml index e74f5c24fb4f6..d5ae9abf44676 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontShoppingCartSummaryWithShippingActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontShoppingCartSummaryWithShippingActionGroup.xml @@ -16,9 +16,9 @@ <argument name="shipping" type="string"/> </arguments> - <waitForElementVisible selector="{{CheckoutCartSummarySection.shipping}}" stepKey="waitForElementToBeVisible" after="assertSubtotal"/> <reloadPage stepKey="reloadPage" after="waitForElementToBeVisible" /> <waitForPageLoad after="reloadPage" stepKey="WaitForPageLoaded" /> + <waitForElementVisible selector="{{CheckoutCartSummarySection.shipping}}" stepKey="waitForElementToBeVisible" after="assertSubtotal"/> <waitForText userInput="{{shipping}}" selector="{{CheckoutCartSummarySection.shipping}}" time="30" stepKey="assertShipping" after="WaitForPageLoaded"/> </actionGroup> </actionGroups> From a15f822811cf19b7673dc05ac7c110380730cc58 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Tue, 3 Sep 2019 16:06:03 +0300 Subject: [PATCH 05/24] MC-17606: Unable to save edited product when max_sale_qty is Magento's default --- .../ActionGroup/AdminProductActionGroup.xml | 2 +- ...talogInventoryConfigurationActionGroup.xml | 22 ++++++++++ .../ActionGroup/AdminProductActionGroup.xml | 10 +++++ .../Data/CatalogInventoryItemOptionsData.xml | 7 ---- ...minProductFormAdvancedInventorySection.xml | 2 +- ...eroMaximumQtyAllowedInShoppingCartTest.xml | 41 +++++++++---------- ...pingCartSummaryWithShippingActionGroup.xml | 6 +-- 7 files changed, 55 insertions(+), 35 deletions(-) create mode 100644 app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminCatalogInventoryConfigurationActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml index 96c2c2900dccf..5c5ee0f9cb321 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml @@ -149,7 +149,7 @@ <!-- Save product but do not expect a success message --> <actionGroup name="SaveProductFormNoSuccessCheck" extends="saveProductForm"> <annotations> - <description>EXTENDS: saveProductForm. Removes 'seeSaveConfirmation'.</description> + <description>EXTENDS: saveProductForm. Removes 'waitProductSaveSuccessMessage' and 'seeSaveConfirmation'.</description> </annotations> <remove keyForRemoval="waitProductSaveSuccessMessage"/> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminCatalogInventoryConfigurationActionGroup.xml b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminCatalogInventoryConfigurationActionGroup.xml new file mode 100644 index 0000000000000..49956473132ec --- /dev/null +++ b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminCatalogInventoryConfigurationActionGroup.xml @@ -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="AdminCatalogInventoryConfigurationMaxQtyAllowedInShoppingCartValidationActionGroup"> + <arguments> + <argument name="qty" type="string"/> + <argument name="errorMessage" type="string"/> + </arguments> + + <fillField selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQty}}" userInput="{{qty}}" stepKey="setMaxSaleQtyValue"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveConfigButton"/> + <waitForElementVisible selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyError}}" stepKey="waitValidationErrorMessageAppears"/> + <see selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyError}}" userInput="{{errorMessage}}" stepKey="checkValidationErrorMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductActionGroup.xml b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductActionGroup.xml index b4694365caff7..84dc6b93c885f 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductActionGroup.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductActionGroup.xml @@ -18,4 +18,14 @@ <fillField selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCart}}" userInput="{{qty}}" stepKey="fillMaxAllowedQty"/> <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> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventoryItemOptionsData.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventoryItemOptionsData.xml index 912218e63abbe..767d65f9facca 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventoryItemOptionsData.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventoryItemOptionsData.xml @@ -8,13 +8,6 @@ <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> - <entity name="ZeroValueForMaxSaleQty" type="cataloginventory_item_options"> - <requiredEntity type="max_sale_qty">MaxSaleQtyZeroValue</requiredEntity> - </entity> - <entity name="MaxSaleQtyZeroValue" type="max_sale_qty"> - <data key="value">0</data> - </entity> - <entity name="DefaultValueForMaxSaleQty" type="cataloginventory_item_options"> <requiredEntity type="max_sale_qty">MaxSaleQtyDefaultValue</requiredEntity> </entity> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Section/AdminProductFormAdvancedInventorySection.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Section/AdminProductFormAdvancedInventorySection.xml index cdcd53144e70b..7ff9c2d70755f 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/Section/AdminProductFormAdvancedInventorySection.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Section/AdminProductFormAdvancedInventorySection.xml @@ -31,6 +31,6 @@ <element name="outOfStockThreshold" type="select" selector="//*[@name='product[stock_data][min_qty]']" timeout="30"/> <element name="minQtyConfigSetting" type="checkbox" selector="//input[@name='product[stock_data][use_config_min_qty]']" timeout="30"/> <element name="advancedInventoryModal" type="block" selector=".product_form_product_form_advanced_inventory_modal[data-role=modal]"/> - <element name="maxiQtyAllowedInCartError" type="text" selector="//*[@name='product[stock_data][max_sale_qty]']/..//label[@class='admin__field-error']"/> + <element name="maxiQtyAllowedInCartError" type="text" selector="[name='product[stock_data][max_sale_qty]'] + label.admin__field-error"/> </section> </sections> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml index 6ad7e4dab16f4..f7cf0a4deba4b 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml @@ -31,23 +31,24 @@ <actionGroup ref="logout" stepKey="logout"/> </after> + <!-- Go to Inventory configuration page --> <amOnPage url="{{AdminInventoryProductStockOptionsConfigPage.url}}" stepKey="openInventoryConfigPage"/> <uncheckOption selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyInherit}}" stepKey="uncheckUseDefaultValueForMaxSaleQty"/> <!-- Validate zero value --> - <fillField selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQty}}" userInput="0" stepKey="setMaxSaleQtyValueToZero"/> - <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveConfigButton"/> - <waitForElementVisible selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyError}}" stepKey="waitValidationErrorMessageAppearsZero"/> - <see selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyError}}" userInput="Please enter a number greater than 0 in this field." stepKey="checkValidationErrorMessageZero"/> + <actionGroup ref="AdminCatalogInventoryConfigurationMaxQtyAllowedInShoppingCartValidationActionGroup" stepKey="validateZeroValue"> + <argument name="qty" value="0"/> + <argument name="errorMessage" value="Please enter a number greater than 0 in this field."/> + </actionGroup> <!-- Validate negative value --> - <fillField selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQty}}" userInput="-1" stepKey="setMaxSaleQtyValueToNegative"/> - <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveConfigButtonNegative"/> - <waitForElementVisible selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyError}}" stepKey="waitValidationErrorMessageAppearsNegative"/> - <see selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyError}}" userInput="Please enter a number greater than 0 in this field." stepKey="checkValidationErrorMessageNegative"/> + <actionGroup ref="AdminCatalogInventoryConfigurationMaxQtyAllowedInShoppingCartValidationActionGroup" stepKey="validateNegativeValue"> + <argument name="qty" value="-1"/> + <argument name="errorMessage" value="Please enter a number greater than 0 in this field."/> + </actionGroup> <!-- Validate alphabetical value --> - <fillField selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQty}}" userInput="abc" stepKey="setMaxSaleQtyValueToAlphabetical"/> - <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveConfigButtonAlphabetical"/> - <waitForElementVisible selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyError}}" stepKey="waitValidationErrorMessageAppearsAlphabetical"/> - <see selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyError}}" userInput="Please enter a valid number in this field." stepKey="checkValidationErrorMessageAlphabetical"/> + <actionGroup ref="AdminCatalogInventoryConfigurationMaxQtyAllowedInShoppingCartValidationActionGroup" stepKey="validateAlphabeticalValue"> + <argument name="qty" value="abc"/> + <argument name="errorMessage" value="Please enter a valid number in this field."/> + </actionGroup> <!-- Fill correct value --> <fillField selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQty}}" userInput="100" stepKey="setMaxSaleQtyValueToCorrectNumber"/> <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfigWithCorrectNumber"/> @@ -55,24 +56,20 @@ <!-- Go to product page --> <amOnPage url="{{AdminProductEditPage.url($$createdProduct.id$$)}}" stepKey="openAdminProductEditPage"/> <!-- Validate zero value --> - <actionGroup ref="AdminProductSetMaxQtyAllowedInShoppingCart" stepKey="setProductMaxQtyAllowedInShoppingCartToZero"> + <actionGroup ref="AdminProductMaxQtyAllowedInShoppingCartValidationActionGroup" stepKey="productValidateZeroValue"> <argument name="qty" value="0"/> + <argument name="errorMessage" value="Please enter a number greater than 0 in this field."/> </actionGroup> - <waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" stepKey="waitProductValidationErrorMessageAppearsZero"/> - <see selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" userInput="Please enter a number greater than 0 in this field." stepKey="checkProductValidationErrorMessageZero"/> <!-- Validate negative value --> - <actionGroup ref="AdminProductSetMaxQtyAllowedInShoppingCart" stepKey="setProductMaxQtyAllowedInShoppingCartToNegative"> + <actionGroup ref="AdminProductMaxQtyAllowedInShoppingCartValidationActionGroup" stepKey="productValidateNegativeValue"> <argument name="qty" value="-1"/> + <argument name="errorMessage" value="Please enter a number greater than 0 in this field."/> </actionGroup> - <waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" stepKey="waitProductValidationErrorMessageAppearsNegative"/> - <see selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" userInput="Please enter a number greater than 0 in this field." stepKey="checkProductValidationErrorMessageNegative"/> <!-- Validate alphabetical value --> - <actionGroup ref="AdminProductSetMaxQtyAllowedInShoppingCart" stepKey="setProductMaxQtyAllowedInShoppingCartToAlphabetical"> + <actionGroup ref="AdminProductMaxQtyAllowedInShoppingCartValidationActionGroup" stepKey="productValidateAlphabeticalValue"> <argument name="qty" value="abc"/> + <argument name="errorMessage" value="Please enter a valid number in this field."/> </actionGroup> - <waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" stepKey="waitProductValidationErrorMessageAppearsAlphabetical"/> - <see selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" userInput="Please enter a valid number in this field." stepKey="checkProductValidationErrorMessageAlphabetical"/> - <!-- Fill correct value --> <actionGroup ref="AdminProductSetMaxQtyAllowedInShoppingCart" stepKey="setProductMaxQtyAllowedInShoppingCartToCorrectNumber"> <argument name="qty" value="50"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontShoppingCartSummaryWithShippingActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontShoppingCartSummaryWithShippingActionGroup.xml index d5ae9abf44676..0ba739e415fb7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontShoppingCartSummaryWithShippingActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontShoppingCartSummaryWithShippingActionGroup.xml @@ -16,9 +16,7 @@ <argument name="shipping" type="string"/> </arguments> - <reloadPage stepKey="reloadPage" after="waitForElementToBeVisible" /> - <waitForPageLoad after="reloadPage" stepKey="WaitForPageLoaded" /> - <waitForElementVisible selector="{{CheckoutCartSummarySection.shipping}}" stepKey="waitForElementToBeVisible" after="assertSubtotal"/> - <waitForText userInput="{{shipping}}" selector="{{CheckoutCartSummarySection.shipping}}" time="30" stepKey="assertShipping" after="WaitForPageLoaded"/> + <waitForElementVisible selector="{{CheckoutCartSummarySection.shipping}}" after="assertSubtotal" stepKey="waitForShippingElementToBeVisible"/> + <waitForText userInput="{{shipping}}" selector="{{CheckoutCartSummarySection.shipping}}" time="30" after="waitForShippingElementToBeVisible" stepKey="assertShipping"/> </actionGroup> </actionGroups> From c094e33782221fc07ee63a9612d29a6d807b3f26 Mon Sep 17 00:00:00 2001 From: Viktor Petryk <victor.petryk@transoftgroup.com> Date: Wed, 4 Sep 2019 17:05:26 +0300 Subject: [PATCH 06/24] MC-19849: Full reindex of "catalogsearch_fulltext" leads to delete real index DB table --- .../CatalogSearch/Model/Indexer/Fulltext.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php index 21d8b7297da7d..912dec8666191 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext.php @@ -3,11 +3,14 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\CatalogSearch\Model\Indexer; use Magento\CatalogSearch\Model\Indexer\Fulltext\Action\FullFactory; +use Magento\CatalogSearch\Model\Indexer\Scope\State; use Magento\CatalogSearch\Model\Indexer\Scope\StateFactory; use Magento\CatalogSearch\Model\ResourceModel\Fulltext as FulltextResource; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Indexer\DimensionProviderInterface; use Magento\Store\Model\StoreDimensionProvider; use Magento\Indexer\Model\ProcessManager; @@ -79,6 +82,7 @@ class Fulltext implements * @param DimensionProviderInterface $dimensionProvider * @param array $data * @param ProcessManager $processManager + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function __construct( FullFactory $fullActionFactory, @@ -95,11 +99,9 @@ public function __construct( $this->fulltextResource = $fulltextResource; $this->data = $data; $this->indexSwitcher = $indexSwitcher; - $this->indexScopeState = $indexScopeStateFactory->create(); + $this->indexScopeState = ObjectManager::getInstance()->get(State::class); $this->dimensionProvider = $dimensionProvider; - $this->processManager = $processManager ?: \Magento\Framework\App\ObjectManager::getInstance()->get( - ProcessManager::class - ); + $this->processManager = $processManager ?: ObjectManager::getInstance()->get(ProcessManager::class); } /** @@ -127,9 +129,11 @@ public function executeByDimensions(array $dimensions, \Traversable $entityIds = throw new \InvalidArgumentException('Indexer "' . self::INDEXER_ID . '" support only Store dimension'); } $storeId = $dimensions[StoreDimensionProvider::DIMENSION_NAME]->getValue(); - $saveHandler = $this->indexerHandlerFactory->create([ - 'data' => $this->data - ]); + $saveHandler = $this->indexerHandlerFactory->create( + [ + 'data' => $this->data, + ] + ); if (null === $entityIds) { $this->indexScopeState->useTemporaryIndex(); From aa55e958b40dabdb839ae413cdebebe49e0df4e3 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Wed, 4 Sep 2019 11:11:09 -0500 Subject: [PATCH 07/24] MC-19791: Poor performance on sales order update - string to integer --- .../Magento/Framework/Model/ResourceModel/Db/AbstractDb.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php index fc0edf931fa9c..67cd6679de98d 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php @@ -793,7 +793,10 @@ protected function saveNewObject(\Magento\Framework\Model\AbstractModel $object) */ protected function updateObject(\Magento\Framework\Model\AbstractModel $object) { - $condition = $this->getConnection()->quoteInto($this->getIdFieldName() . '=?', $object->getId()); + //quoting integer values as strings may decrease query performance on some environments + $condition = is_int($object->getId()) + ? $this->getIdFieldName() . '=' . (int) $object->getId() + : $this->getConnection()->quoteInto($this->getIdFieldName() . '=?', $object->getId()); /** * Not auto increment primary key support */ From 6cbe1f482913d24e15e4b6df1549bae5bc49a7e2 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Wed, 4 Sep 2019 11:16:25 -0500 Subject: [PATCH 08/24] MC-19791: Poor performance on sales order update - string to integer --- .../Magento/Framework/Model/ResourceModel/Db/AbstractDb.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php index 67cd6679de98d..3fd44db548149 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php @@ -793,8 +793,8 @@ protected function saveNewObject(\Magento\Framework\Model\AbstractModel $object) */ protected function updateObject(\Magento\Framework\Model\AbstractModel $object) { - //quoting integer values as strings may decrease query performance on some environments - $condition = is_int($object->getId()) + //quoting numeric values as strings may decrease query performance on some environments + $condition = is_numeric($object->getId()) ? $this->getIdFieldName() . '=' . (int) $object->getId() : $this->getConnection()->quoteInto($this->getIdFieldName() . '=?', $object->getId()); /** From 4b2db0f7a29e5c13cfbc06c33b401ba9d34bd0c2 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Wed, 4 Sep 2019 12:19:38 -0500 Subject: [PATCH 09/24] MC-19791: Poor performance on sales order update - string to integer --- .../Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php index b69f50cf4f341..fea17c3c0b8c2 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php @@ -489,7 +489,7 @@ public function testPrepareDataForUpdate() ->with( 'tableName', $newData, - 'idFieldName' + 'idFieldName=0' ); $select = $this->getMockBuilder(\Magento\Framework\DB\Select::class) ->disableOriginalConstructor() From 1129337146a2d18c95d845dd4b3e1391b8eab27a Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Wed, 4 Sep 2019 15:11:48 -0500 Subject: [PATCH 10/24] MC-19791: Poor performance on sales order update - string to integer --- .../Test/Unit/ResourceModel/Db/AbstractDbTest.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php index fea17c3c0b8c2..4236c4f076dcb 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php @@ -429,12 +429,10 @@ public function testPrepareDataForUpdate() \Magento\Framework\Model\Context::class ); $registryMock = $this->createMock(\Magento\Framework\Registry::class); - $resourceMock = $this->createPartialMock(AbstractDb::class, [ - '_construct', - 'getConnection', - '__wakeup', - 'getIdFieldName' - ]); + $resourceMock = $this->createPartialMock( + AbstractDb::class, + ['_construct', 'getConnection', '__wakeup', 'getIdFieldName'] + ); $connectionInterfaceMock = $this->createMock(AdapterInterface::class); $resourceMock->expects($this->any()) ->method('getConnection') From 650a4a1b70d9ca531b8a3093eeeb2cfabe0a0e0c Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 9 Sep 2019 14:56:50 -0500 Subject: [PATCH 11/24] MC-19791: Poor performance on sales order update - string to integer --- .../Framework/Model/ResourceModel/Db/AbstractDb.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php index 3fd44db548149..62d2edcc89d19 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php @@ -793,10 +793,15 @@ protected function saveNewObject(\Magento\Framework\Model\AbstractModel $object) */ protected function updateObject(\Magento\Framework\Model\AbstractModel $object) { - //quoting numeric values as strings may decrease query performance on some environments - $condition = is_numeric($object->getId()) - ? $this->getIdFieldName() . '=' . (int) $object->getId() - : $this->getConnection()->quoteInto($this->getIdFieldName() . '=?', $object->getId()); + $tableDescription = $this->getConnection() + ->describeTable($this->getMainTable()); + $preparedValue = $this->getConnection() + ->prepareColumnValue( + $tableDescription[$this->getIdFieldName()], + $object->getId() + ); + $condition = $this->getIdFieldName() . '=' . $preparedValue; + /** * Not auto increment primary key support */ From 29f99e690035f43d49062b521058658288d42d82 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 9 Sep 2019 15:41:52 -0500 Subject: [PATCH 12/24] MC-19791: Poor performance on sales order update - string to integer --- .../Model/ResourceModel/Db/AbstractDb.php | 26 +++++++++---------- .../Unit/ResourceModel/Db/AbstractDbTest.php | 9 +++++++ 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php index 62d2edcc89d19..5db1d999a0cfc 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php @@ -11,6 +11,7 @@ use Magento\Framework\Model\ResourceModel\AbstractResource; use Magento\Framework\DB\Adapter\DuplicateException; use Magento\Framework\Phrase; +use Magento\Framework\DB\Adapter\AdapterInterface; /** * Abstract resource model @@ -301,7 +302,7 @@ public function getTable($tableName) * Get connection by resource name * * @param string $resourceName - * @return \Magento\Framework\DB\Adapter\AdapterInterface|false + * @return AdapterInterface|false */ protected function _getConnection($resourceName) { @@ -320,7 +321,7 @@ protected function _getConnection($resourceName) /** * Get connection * - * @return \Magento\Framework\DB\Adapter\AdapterInterface|false + * @return AdapterInterface|false */ public function getConnection() { @@ -793,13 +794,10 @@ protected function saveNewObject(\Magento\Framework\Model\AbstractModel $object) */ protected function updateObject(\Magento\Framework\Model\AbstractModel $object) { - $tableDescription = $this->getConnection() - ->describeTable($this->getMainTable()); - $preparedValue = $this->getConnection() - ->prepareColumnValue( - $tableDescription[$this->getIdFieldName()], - $object->getId() - ); + /** @var AdapterInterface $connection */ + $connection = $this->getConnection(); + $tableDescription = $connection->describeTable($this->getMainTable()); + $preparedValue = $connection->prepareColumnValue($tableDescription[$this->getIdFieldName()], $object->getId()); $condition = $this->getIdFieldName() . '=' . $preparedValue; /** @@ -808,22 +806,22 @@ protected function updateObject(\Magento\Framework\Model\AbstractModel $object) if ($this->_isPkAutoIncrement) { $data = $this->prepareDataForUpdate($object); if (!empty($data)) { - $this->getConnection()->update($this->getMainTable(), $data, $condition); + $connection->update($this->getMainTable(), $data, $condition); } } else { - $select = $this->getConnection()->select()->from( + $select = $connection->select()->from( $this->getMainTable(), [$this->getIdFieldName()] )->where( $condition ); - if ($this->getConnection()->fetchOne($select) !== false) { + if ($connection->fetchOne($select) !== false) { $data = $this->prepareDataForUpdate($object); if (!empty($data)) { - $this->getConnection()->update($this->getMainTable(), $data, $condition); + $connection->update($this->getMainTable(), $data, $condition); } } else { - $this->getConnection()->insert( + $connection->insert( $this->getMainTable(), $this->_prepareDataForSave($object) ); diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php index 4236c4f076dcb..7fb5ec4b506e2 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php @@ -425,6 +425,7 @@ public function testPrepareDataForUpdate() $connectionMock = $this->getMockBuilder(AdapterInterface::class) ->setMethods(['save']) ->getMockForAbstractClass(); + $context = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this))->getObject( \Magento\Framework\Model\Context::class ); @@ -451,6 +452,7 @@ public function testPrepareDataForUpdate() $this->_resourcesMock->expects($this->any())->method('getTableName')->with($data)->will( $this->returnValue('tableName') ); + $mainTableReflection = new \ReflectionProperty( AbstractDb::class, '_mainTable' @@ -465,6 +467,13 @@ public function testPrepareDataForUpdate() $idFieldNameReflection->setValue($this->_model, 'idFieldName'); $connectionMock->expects($this->any())->method('save')->with('tableName', 'idFieldName'); $connectionMock->expects($this->any())->method('quoteInto')->will($this->returnValue('idFieldName')); + $connectionMock->expects($this->any()) + ->method('describeTable') + ->with('tableName') + ->willReturn(['idFieldName' => []]); + $connectionMock->expects($this->any()) + ->method('prepareColumnValue') + ->willReturn(0); $abstractModelMock->setIdFieldName('id'); $abstractModelMock->setData( [ From aefa7d98fe89b92e389d5ba8a266d2d5807179ef Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 9 Sep 2019 15:57:11 -0500 Subject: [PATCH 13/24] MC-19791: Poor performance on sales order update - string to integer --- .../Model/ResourceModel/Db/AbstractDb.php | 22 ++++++++++++++++++- .../Unit/ResourceModel/Db/AbstractDbTest.php | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php index 5db1d999a0cfc..5d9f05c3eb8c9 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php @@ -785,6 +785,24 @@ protected function saveNewObject(\Magento\Framework\Model\AbstractModel $object) } } + /** + * Check in column value should be quoted + * + * Based on column description + * + * @param array $columnDescription + * @return bool + */ + private function isNeedToQuoteValue(array $columnDescription): bool + { + $result = true; + if (!empty($columnDescription['DATA_TYPE']) + && in_array($columnDescription['DATA_TYPE'], ['smallint', 'int'])) { + $result = false; + } + return $result; + } + /** * Update existing object * @@ -798,7 +816,9 @@ protected function updateObject(\Magento\Framework\Model\AbstractModel $object) $connection = $this->getConnection(); $tableDescription = $connection->describeTable($this->getMainTable()); $preparedValue = $connection->prepareColumnValue($tableDescription[$this->getIdFieldName()], $object->getId()); - $condition = $this->getIdFieldName() . '=' . $preparedValue; + $condition = (!$this->isNeedToQuoteValue($tableDescription[$this->getIdFieldName()])) + ? $this->getIdFieldName() . '=' . $preparedValue + : $connection->quoteInto($this->getIdFieldName() . '=?', $preparedValue); /** * Not auto increment primary key support diff --git a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php index 7fb5ec4b506e2..2a87cd774332a 100644 --- a/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php +++ b/lib/internal/Magento/Framework/Model/Test/Unit/ResourceModel/Db/AbstractDbTest.php @@ -496,7 +496,7 @@ public function testPrepareDataForUpdate() ->with( 'tableName', $newData, - 'idFieldName=0' + 'idFieldName' ); $select = $this->getMockBuilder(\Magento\Framework\DB\Select::class) ->disableOriginalConstructor() From b7339908bed639a9199d463fbe4c4e9c1536a106 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 9 Sep 2019 16:41:56 -0500 Subject: [PATCH 14/24] MC-19791: Poor performance on sales order update - string to integer --- .../Magento/Framework/Model/ResourceModel/Db/AbstractDb.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php index 5d9f05c3eb8c9..d75b7ee9be647 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php @@ -11,7 +11,6 @@ use Magento\Framework\Model\ResourceModel\AbstractResource; use Magento\Framework\DB\Adapter\DuplicateException; use Magento\Framework\Phrase; -use Magento\Framework\DB\Adapter\AdapterInterface; /** * Abstract resource model @@ -302,7 +301,7 @@ public function getTable($tableName) * Get connection by resource name * * @param string $resourceName - * @return AdapterInterface|false + * @return \Magento\Framework\DB\Adapter\AdapterInterface|false */ protected function _getConnection($resourceName) { @@ -321,7 +320,7 @@ protected function _getConnection($resourceName) /** * Get connection * - * @return AdapterInterface|false + * @return \Magento\Framework\DB\Adapter\AdapterInterface|false */ public function getConnection() { From fa77e7cc434195a21daec65bbe4a2f02314fa694 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 9 Sep 2019 16:45:33 -0500 Subject: [PATCH 15/24] MC-19791: Poor performance on sales order update - string to integer --- .../Customer/Test/Unit/Model/ResourceModel/GroupTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/GroupTest.php b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/GroupTest.php index b245702ce07f9..069ddc63d74d7 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/GroupTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/ResourceModel/GroupTest.php @@ -127,7 +127,7 @@ public function testSaveWithReservedId() ] ) ->getMockForAbstractClass(); - $dbAdapter->expects($this->any())->method('describeTable')->willReturn([]); + $dbAdapter->expects($this->any())->method('describeTable')->willReturn(['customer_group_id' => []]); $dbAdapter->expects($this->any())->method('update')->willReturnSelf(); $dbAdapter->expects($this->once())->method('lastInsertId')->willReturn($expectedId); $selectMock = $this->getMockBuilder(\Magento\Framework\DB\Select::class) From 3d1b4aad391aedd7d5acf710090b48694068e06e Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 9 Sep 2019 16:50:30 -0500 Subject: [PATCH 16/24] MC-19791: Poor performance on sales order update - string to integer --- .../Magento/Framework/Model/ResourceModel/Db/AbstractDb.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php index d75b7ee9be647..9e11e2a9b9acb 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php @@ -811,7 +811,6 @@ private function isNeedToQuoteValue(array $columnDescription): bool */ protected function updateObject(\Magento\Framework\Model\AbstractModel $object) { - /** @var AdapterInterface $connection */ $connection = $this->getConnection(); $tableDescription = $connection->describeTable($this->getMainTable()); $preparedValue = $connection->prepareColumnValue($tableDescription[$this->getIdFieldName()], $object->getId()); From d79b8a6c5d2ca75e3eb2779eb9c3aaf3ba802aed Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Tue, 10 Sep 2019 12:19:40 -0500 Subject: [PATCH 17/24] MC-19791: Poor performance on sales order update - string to integer --- .../Framework/Model/ResourceModel/Db/AbstractDb.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php index 9e11e2a9b9acb..34265bcca6310 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php @@ -792,11 +792,11 @@ protected function saveNewObject(\Magento\Framework\Model\AbstractModel $object) * @param array $columnDescription * @return bool */ - private function isNeedToQuoteValue(array $columnDescription): bool + private function isNumericValue(array $columnDescription): bool { $result = true; if (!empty($columnDescription['DATA_TYPE']) - && in_array($columnDescription['DATA_TYPE'], ['smallint', 'int'])) { + && in_array($columnDescription['DATA_TYPE'], ['tinyint', 'smallint', 'mediumint', 'int', 'bigint'])) { $result = false; } return $result; @@ -814,8 +814,8 @@ protected function updateObject(\Magento\Framework\Model\AbstractModel $object) $connection = $this->getConnection(); $tableDescription = $connection->describeTable($this->getMainTable()); $preparedValue = $connection->prepareColumnValue($tableDescription[$this->getIdFieldName()], $object->getId()); - $condition = (!$this->isNeedToQuoteValue($tableDescription[$this->getIdFieldName()])) - ? $this->getIdFieldName() . '=' . $preparedValue + $condition = (!$this->isNumericValue($tableDescription[$this->getIdFieldName()])) + ? sprintf('%s=%d', $this->getIdFieldName(), $preparedValue) : $connection->quoteInto($this->getIdFieldName() . '=?', $preparedValue); /** From 62e5233ee9f725ee30aade3449f563b9089f5c81 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Tue, 10 Sep 2019 13:51:22 -0500 Subject: [PATCH 18/24] MC-19857: Remaining amount discrepancy in Admin Panel for RMA --- .../Magento/Framework/Model/ResourceModel/Db/AbstractDb.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php index 34265bcca6310..90fa73de427bc 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php @@ -785,7 +785,7 @@ protected function saveNewObject(\Magento\Framework\Model\AbstractModel $object) } /** - * Check in column value should be quoted + * Check is column data type is numeric * * Based on column description * From f73e645a86691fda1ed8321d2b160854f4b753e5 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Tue, 10 Sep 2019 13:51:22 -0500 Subject: [PATCH 19/24] MC-19791: Poor performance on sales order update - string to integer --- .../Magento/Framework/Model/ResourceModel/Db/AbstractDb.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php index 34265bcca6310..90fa73de427bc 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php @@ -785,7 +785,7 @@ protected function saveNewObject(\Magento\Framework\Model\AbstractModel $object) } /** - * Check in column value should be quoted + * Check is column data type is numeric * * Based on column description * From 20141ce952d7dd65af9e17dcde55c6e5609891f2 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Wed, 11 Sep 2019 10:54:47 +0300 Subject: [PATCH 20/24] MC-20109: [MFTF] StorefrontVerifySearchSuggestionByProductDescriptionTest is flaky --- .../AdminProductGridActionGroup.xml | 19 +++++++++++++++++++ ...archSuggestionByProductDescriptionTest.xml | 1 + 2 files changed, 20 insertions(+) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml index 6a260bbf22522..aef79e651b584 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml @@ -423,4 +423,23 @@ <click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmProductDelete"/> <waitForPageLoad stepKey="waitForGridLoad"/> </actionGroup> + + <actionGroup name="deleteAllProductsUsingProductGrid"> + <annotations> + <description>Deletes all products in Admin Products grid page.</description> + </annotations> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="openAdminGridProductsPage"/> + <waitForPageLoad time="60" stepKey="waitForPageFullyLoad"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clearGridFilters"/> + + <conditionalClick selector="{{AdminProductGridSection.multicheckDropdown}}" dependentSelector="{{AdminDataGridTableSection.dataGridEmpty}}" visible="false" stepKey="openMulticheckDropdown"/> + <conditionalClick selector="{{AdminProductGridSection.multicheckOption('Select All')}}" dependentSelector="{{AdminDataGridTableSection.dataGridEmpty}}" visible="false" stepKey="selectAllProductsInGrid"/> + <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> + <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> + + <waitForElementVisible selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForConfirmModal"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/> + <waitForElementVisible selector="{{AdminDataGridTableSection.dataGridEmpty}}" stepKey="waitGridIsEmpty"/> + </actionGroup> </actionGroups> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml index 0ec33c48f259e..61a89b4610d6a 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml @@ -28,6 +28,7 @@ <!-- Delete all search terms --> <comment userInput="Delete all search terms" stepKey="deleteAllSearchTermsComment"/> <actionGroup ref="DeleteAllSearchTerms" stepKey="deleteAllSearchTerms"/> + <actionGroup ref="deleteAllProductsUsingProductGrid" stepKey="deleteAllProducts"/> <!-- Create product with description --> <comment userInput="Create product with description" stepKey="createProductWithDescriptionComment"/> <createData entity="SimpleProductWithDescription" stepKey="simpleProduct"/> From 24ae0a99a302105bb913fed3b0d8b52a23cae780 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Wed, 11 Sep 2019 14:52:50 +0300 Subject: [PATCH 21/24] MC-17606: Unable to save edited product when max_sale_qty is Magento's default --- ...sertStorefrontShoppingCartSummaryWithShippingActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontShoppingCartSummaryWithShippingActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontShoppingCartSummaryWithShippingActionGroup.xml index 0ba739e415fb7..fe5887bbf6f7c 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontShoppingCartSummaryWithShippingActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontShoppingCartSummaryWithShippingActionGroup.xml @@ -16,7 +16,7 @@ <argument name="shipping" type="string"/> </arguments> - <waitForElementVisible selector="{{CheckoutCartSummarySection.shipping}}" after="assertSubtotal" stepKey="waitForShippingElementToBeVisible"/> + <waitForElementVisible selector="{{CheckoutCartSummarySection.shipping}}" time="60" after="assertSubtotal" stepKey="waitForShippingElementToBeVisible"/> <waitForText userInput="{{shipping}}" selector="{{CheckoutCartSummarySection.shipping}}" time="30" after="waitForShippingElementToBeVisible" stepKey="assertShipping"/> </actionGroup> </actionGroups> From 75dce6df5072ccf54ea8c65d6f34af8b7b2dc562 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Thu, 12 Sep 2019 16:29:32 +0300 Subject: [PATCH 22/24] MC-17606: Unable to save edited product when max_sale_qty is Magento's default --- .../Test/StorefrontAddConfigurableProductToShoppingCartTest.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml index 09608eef7178a..18e4cd7db2871 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml @@ -20,6 +20,8 @@ <before> <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> <magentoCLI command="config:set {{EnableFlatRateDefaultPriceConfigData.path}} {{EnableFlatRateDefaultPriceConfigData.value}}" stepKey="enableFlatRatePrice"/> + <magentoCLI command="config:set {{EnableFlatRateToAllAllowedCountriesConfigData.path}} {{EnableFlatRateToAllAllowedCountriesConfigData.value}}" stepKey="allowFlatRateToAllCountries"/> + <!-- Create Default Category --> <createData entity="_defaultCategory" stepKey="createCategory"/> From c78dfec370f4ad98f9e9cd0a654947132f8c4321 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Thu, 12 Sep 2019 13:25:00 -0500 Subject: [PATCH 23/24] MC-19791: Poor performance on sales order update - string to integer --- .../Magento/Framework/Model/ResourceModel/Db/AbstractDb.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php index 90fa73de427bc..ca21c85af8d9a 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/AbstractDb.php @@ -785,7 +785,7 @@ protected function saveNewObject(\Magento\Framework\Model\AbstractModel $object) } /** - * Check is column data type is numeric + * Check if column data type is numeric * * Based on column description * From 807cb5cc9babed76a93f99b5b917d8db03939adb Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Fri, 13 Sep 2019 11:42:28 +0300 Subject: [PATCH 24/24] MC-17606: Unable to save edited product when max_sale_qty is Magento's default --- ...ddConfigurableProductToShoppingCartTest.xml | 1 + ...StoreFrontCheckingWithMultishipmentTest.xml | 1 + ...toreFrontCheckingWithSingleShipmentTest.xml | 1 + ...StoreFrontMinicartWithMultishipmentTest.xml | 18 ++++++++++-------- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml index 18e4cd7db2871..e3090d6cb311b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml @@ -21,6 +21,7 @@ <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> <magentoCLI command="config:set {{EnableFlatRateDefaultPriceConfigData.path}} {{EnableFlatRateDefaultPriceConfigData.value}}" stepKey="enableFlatRatePrice"/> <magentoCLI command="config:set {{EnableFlatRateToAllAllowedCountriesConfigData.path}} {{EnableFlatRateToAllAllowedCountriesConfigData.value}}" stepKey="allowFlatRateToAllCountries"/> + <createData entity="FreeShippinMethodDefault" stepKey="disableFreeShipping"/> <!-- Create Default Category --> <createData entity="_defaultCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml index 271f6e707cd69..3a58ead3b6dfa 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml @@ -57,6 +57,7 @@ <deleteData stepKey="deleteProduct1" createDataKey="product1"/> <deleteData stepKey="deleteProduct2" createDataKey="product2"/> <deleteData stepKey="deleteCustomer" createDataKey="customer"/> + <createData entity="FreeShippinMethodDefault" stepKey="disableFreeShipping"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml index f425a44130ecb..c9f1856249762 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml @@ -57,6 +57,7 @@ <deleteData stepKey="deleteProduct1" createDataKey="product1"/> <deleteData stepKey="deleteProduct2" createDataKey="product2"/> <deleteData stepKey="deleteCustomer" createDataKey="customer"/> + <createData entity="FreeShippinMethodDefault" stepKey="disableFreeShipping"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml index 8d5a58acc7e18..d52ddb11212aa 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml @@ -37,6 +37,16 @@ </actionGroup> </before> + <after> + <deleteData stepKey="deleteCategory" createDataKey="category"/> + <deleteData stepKey="deleteProduct1" createDataKey="product1"/> + <deleteData stepKey="deleteProduct2" createDataKey="product2"/> + <deleteData stepKey="deleteCustomer" createDataKey="customer"/> + <createData entity="FreeShippinMethodDefault" stepKey="disableFreeShipping"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> + <actionGroup ref="logout" stepKey="logoutAdmin"/> + </after> + <amOnPage url="$$product1.name$$.html" stepKey="goToProduct1"/> <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProduct1"> <argument name="productName" value="$$product1.name$$"/> @@ -53,13 +63,5 @@ <amOnPage url="/checkout/cart/index/" stepKey="amOnCheckoutCartIndexPage"/> <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCartAgain"/> <actionGroup ref="CheckingWithMinicartActionGroup" stepKey="checkoutWithMinicart"/> - - <after> - <deleteData stepKey="deleteCategory" createDataKey="category"/> - <deleteData stepKey="deleteProduct1" createDataKey="product1"/> - <deleteData stepKey="deleteProduct2" createDataKey="product2"/> - <deleteData stepKey="deleteCustomer" createDataKey="customer"/> - <actionGroup ref="logout" stepKey="logout"/> - </after> </test> </tests>