forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
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 magento#102 from magento-pangolin/MC-11063
MC-11063
- Loading branch information
Showing
6 changed files
with
106 additions
and
0 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
33 changes: 33 additions & 0 deletions
33
app/code/Magento/Catalog/Test/Mftf/Data/CatalogInventoryConfigData.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,33 @@ | ||
<?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="CatalogInventoryOptionsShowOutOfStockEnable"> | ||
<data key="path">cataloginventory/options/show_out_of_stock</data> | ||
<data key="label">Yes</data> | ||
<data key="value">1</data> | ||
</entity> | ||
<entity name="CatalogInventoryOptionsShowOutOfStockDisable"> | ||
<!-- Magento default value --> | ||
<data key="path">cataloginventory/options/show_out_of_stock</data> | ||
<data key="label">No</data> | ||
<data key="value">0</data> | ||
</entity> | ||
<entity name="CatalogInventoryItemOptionsBackordersEnable"> | ||
<data key="path">cataloginventory/item_options/backorders</data> | ||
<data key="label">Yes</data> | ||
<data key="value">1</data> | ||
</entity> | ||
<entity name="CatalogInventoryItemOptionsBackordersDisable"> | ||
<!-- Magento default value --> | ||
<data key="path">cataloginventory/item_options/backorders</data> | ||
<data key="label">No</data> | ||
<data key="value">0</data> | ||
</entity> | ||
</entities> |
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
53 changes: 53 additions & 0 deletions
53
app/code/Magento/Catalog/Test/Mftf/Test/AdminBackorderAllowedAddProductToCartTest.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,53 @@ | ||
<?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="AdminBackorderAllowedAddProductToCartTest"> | ||
<annotations> | ||
<stories value="Manage products"/> | ||
<title value="Add Product to Cart, Backorder Allowed"/> | ||
<description value="Customer should be able to add products to cart when that products quantity is zero"/> | ||
<severity value="CRITICAL"/> | ||
<testCaseId value="MC-11063"/> | ||
<group value="mtf_migrated"/> | ||
</annotations> | ||
|
||
<before> | ||
<!-- Create a product that is "In Stock" but has quantity zero --> | ||
<createData entity="SimpleProductInStockQuantityZero" stepKey="createProduct"/> | ||
|
||
<!-- Configure Magento to show out of stock products and to allow backorders --> | ||
<magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockEnable.path}} {{CatalogInventoryOptionsShowOutOfStockEnable.value}}" stepKey="setConfigShowOutOfStockTrue"/> | ||
<magentoCLI command="config:set {{CatalogInventoryItemOptionsBackordersEnable.path}} {{CatalogInventoryItemOptionsBackordersEnable.value}}" stepKey="setConfigAllowBackordersTrue"/> | ||
</before> | ||
|
||
<after> | ||
<!-- Set Magento back to default configuration --> | ||
<magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockDisable.path}} {{CatalogInventoryOptionsShowOutOfStockDisable.value}}" stepKey="setConfigShowOutOfStockFalse"/> | ||
<magentoCLI command="config:set {{CatalogInventoryItemOptionsBackordersDisable.path}} {{CatalogInventoryItemOptionsBackordersDisable.value}}" stepKey="setConfigAllowBackordersFalse"/> | ||
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/> | ||
</after> | ||
|
||
<!-- Go to the storefront and add the product to the cart --> | ||
<actionGroup ref="AddSimpleProductToCart" stepKey="gotoAndAddProductToCart"> | ||
<argument name="product" value="$$createProduct$$"/> | ||
</actionGroup> | ||
|
||
<!-- Go to the cart page and verify we see the product --> | ||
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="gotoCart"/> | ||
<waitForPageLoad stepKey="waitForCartLoad"/> | ||
<actionGroup ref="AssertStorefrontCheckoutCartItemsActionGroup" stepKey="assertProductItemInCheckOutCart"> | ||
<argument name="productName" value="$$createProduct.name$$"/> | ||
<argument name="productSku" value="$$createProduct.sku$$"/> | ||
<argument name="productPrice" value="$$createProduct.price$$"/> | ||
<argument name="subtotal" value="$$createProduct.price$$" /> | ||
<argument name="qty" value="1"/> | ||
</actionGroup> | ||
</test> | ||
</tests> |