-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4795 from magento-tsg/2.3-develop-pr67
[TSG] Fixes for 2.3 (pr67) (2.3-develop)
- Loading branch information
Showing
25 changed files
with
300 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
.../CatalogInventory/Test/Mftf/ActionGroup/AdminCatalogInventoryConfigurationActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="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> |
31 changes: 31 additions & 0 deletions
31
app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?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="AdminProductSetMaxQtyAllowedInShoppingCart"> | ||
<arguments> | ||
<argument name="qty" type="string"/> | ||
</arguments> | ||
<conditionalClick selector="{{AdminProductFormSection.advancedInventoryLink}}" dependentSelector="{{AdminProductFormAdvancedInventorySection.advancedInventoryModal}}" visible="false" stepKey="clickOnAdvancedInventoryLinkIfNeeded"/> | ||
<waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.maxiQtyConfigSetting}}" stepKey="waitForAdvancedInventoryModalWindowOpen"/> | ||
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.maxiQtyConfigSetting}}" stepKey="uncheckMaxQtyCheckBox"/> | ||
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventoryItemOptionsData.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> | ||
<entity name="DefaultValueForMaxSaleQty" type="cataloginventory_item_options"> | ||
<requiredEntity type="max_sale_qty">MaxSaleQtyDefaultValue</requiredEntity> | ||
</entity> | ||
<entity name="MaxSaleQtyDefaultValue" type="max_sale_qty"> | ||
<data key="value">10000</data> | ||
</entity> | ||
</entities> |
24 changes: 0 additions & 24 deletions
24
app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventryConfigData.xml
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
app/code/Magento/CatalogInventory/Test/Mftf/Metadata/cataloginventory_item_options-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> | ||
<operation name="CatalogInventoryProductStockOptionsConfiguration" dataType="cataloginventory_item_options" type="create" | ||
auth="adminFormKey" url="/admin/system_config/save/section/cataloginventory/" method="POST" successRegex="/messages-message-success/"> | ||
<object key="groups" dataType="cataloginventory_item_options"> | ||
<object key="item_options" dataType="cataloginventory_item_options"> | ||
<object key="fields" dataType="cataloginventory_item_options"> | ||
<object key="max_sale_qty" dataType="max_sale_qty"> | ||
<field key="value">integer</field> | ||
</object> | ||
</object> | ||
</object> | ||
</object> | ||
</operation> | ||
</operations> |
14 changes: 14 additions & 0 deletions
14
...e/Magento/CatalogInventory/Test/Mftf/Page/AdminInventoryProductStockOptionsConfigPage.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> | ||
<page name="AdminInventoryProductStockOptionsConfigPage" url="admin/system_config/edit/section/cataloginventory/#cataloginventory_item_options-link" area="admin" module="Magento_Config"> | ||
<section name="AdminInventoryProductStockOptionsConfigSection"/> | ||
</page> | ||
</pages> |
14 changes: 14 additions & 0 deletions
14
app/code/Magento/CatalogInventory/Test/Mftf/Page/AdminProductCreatePage.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> | ||
<page name="AdminProductCreatePage" url="catalog/product/new/set/{{set}}/type/{{type}}/" area="admin" module="Magento_Catalog" parameterized="true"> | ||
<section name="AdminProductFormAdvancedInventorySection"/> | ||
</page> | ||
</pages> |
16 changes: 16 additions & 0 deletions
16
...nto/CatalogInventory/Test/Mftf/Section/AdminInventoryProductStockOptionsConfigSection.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> | ||
<section name="AdminInventoryProductStockOptionsConfigSection"> | ||
<element name="maxSaleQtyInherit" type="checkbox" selector="#cataloginventory_item_options_max_sale_qty_inherit" timeout="30"/> | ||
<element name="maxSaleQty" type="input" selector="#cataloginventory_item_options_max_sale_qty"/> | ||
<element name="maxSaleQtyError" type="input" selector="#cataloginventory_item_options_max_sale_qty-error"/> | ||
</section> | ||
</sections> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
app/code/Magento/CatalogInventory/Test/Mftf/Section/AdminProductFormSection.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> | ||
<section name="AdminProductFormSection"> | ||
<element name="advancedInventoryLink" type="button" selector="button[data-index='advanced_inventory_button']" timeout="30"/> | ||
</section> | ||
</sections> |
80 changes: 80 additions & 0 deletions
80
...nventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest"> | ||
<annotations> | ||
<features value="CatalogInventory"/> | ||
<stories value="Sales restrictions"/> | ||
<title value="Verify that product maximum qty allowed in shopping cart can't be set to zero or less"/> | ||
<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> | ||
|
||
<!-- Go to Inventory configuration page --> | ||
<amOnPage url="{{AdminInventoryProductStockOptionsConfigPage.url}}" stepKey="openInventoryConfigPage"/> | ||
<uncheckOption selector="{{AdminInventoryProductStockOptionsConfigSection.maxSaleQtyInherit}}" stepKey="uncheckUseDefaultValueForMaxSaleQty"/> | ||
<!-- Validate zero value --> | ||
<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 --> | ||
<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 --> | ||
<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"/> | ||
|
||
<!-- Go to product page --> | ||
<amOnPage url="{{AdminProductEditPage.url($$createdProduct.id$$)}}" stepKey="openAdminProductEditPage"/> | ||
<!-- Validate zero value --> | ||
<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> | ||
<!-- Validate negative value --> | ||
<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> | ||
<!-- Validate alphabetical value --> | ||
<actionGroup ref="AdminProductMaxQtyAllowedInShoppingCartValidationActionGroup" stepKey="productValidateAlphabeticalValue"> | ||
<argument name="qty" value="abc"/> | ||
<argument name="errorMessage" value="Please enter a valid number in this field."/> | ||
</actionGroup> | ||
<!-- 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.