forked from magento/inventory
-
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.
MSI-2708: The configurable product is displayed in Storefront despite…
… that all the quantity is reserved. Two error messages appear if try to add this product to cart.
- Loading branch information
1 parent
9466c0b
commit 704d92b
Showing
11 changed files
with
439 additions
and
3 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
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
101 changes: 101 additions & 0 deletions
101
...AdminUi/Test/Mftf/Test/StorefrontCreateOrderAllQuantityConfigurableProductCustomStock.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,101 @@ | ||
<?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="StorefrontCreateOrderAllQuantityConfigurableProductCustomStock"> | ||
<annotations> | ||
<stories value="Configurable Product Custom Stock."/> | ||
<title value="Place order with all quantity with configurable product on custom stock."/> | ||
<description value="Verify, configurable product will change status after order placement with all it's quantity on custom stock."/> | ||
<severity value="MAJOR"/> | ||
<group value="msi"/> | ||
<group value="multi_mode"/> | ||
</annotations> | ||
|
||
<before> | ||
<!--Create test data.--> | ||
<createData entity="SimpleSubCategory" stepKey="category"/> | ||
<createData entity="ApiConfigurableProduct" stepKey="configurableProduct"> | ||
<requiredEntity createDataKey="category"/> | ||
</createData> | ||
<createData entity="productAttributeWithTwoOptions" stepKey="configurableProductAttribute"/> | ||
<createData entity="productAttributeOption1" stepKey="configurableProductAttributeOption"> | ||
<requiredEntity createDataKey="configurableProductAttribute"/> | ||
</createData> | ||
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> | ||
<requiredEntity createDataKey="configurableProductAttribute"/> | ||
</createData> | ||
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption"> | ||
<requiredEntity createDataKey="configurableProductAttribute"/> | ||
</getData> | ||
<createData entity="ApiSimpleOne" stepKey="configurableChildProduct"> | ||
<requiredEntity createDataKey="configurableProductAttribute"/> | ||
<requiredEntity createDataKey="getConfigAttributeOption"/> | ||
</createData> | ||
<createData entity="ConfigurableProductOneOption" stepKey="configurableProductOption"> | ||
<requiredEntity createDataKey="configurableProduct"/> | ||
<requiredEntity createDataKey="configurableProductAttribute"/> | ||
<requiredEntity createDataKey="getConfigAttributeOption"/> | ||
</createData> | ||
<createData entity="ConfigurableProductAddChild" stepKey="configurableProductAddChild"> | ||
<requiredEntity createDataKey="configurableProduct"/> | ||
<requiredEntity createDataKey="configurableChildProduct"/> | ||
</createData> | ||
<createData entity="Simple_US_Customer" stepKey="customer"/> | ||
<createData entity="_minimalSource" stepKey="source"/> | ||
<createData entity="BasicMsiStockWithMainWebsite1" stepKey="stock"/> | ||
<createData entity="SourceStockLinked1" stepKey="sourceStockLink"> | ||
<requiredEntity createDataKey="stock"/> | ||
<requiredEntity createDataKey="source"/> | ||
</createData> | ||
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/> | ||
<!--Assign additional source to configurable product.--> | ||
<amOnPage url="{{AdminProductEditPage.url($configurableChildProduct.id$)}}" stepKey="openProductEditPage"/> | ||
<actionGroup ref="UnassignSourceFromProductActionGroup" stepKey="unassignDefaultSourceFromProduct"> | ||
<argument name="sourceCode" value="{{_defaultSource.name}}"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminAssignSourceToProductAndSetSourceQuantityActionGroup" stepKey="assignSourceToProduct"> | ||
<argument name="sourceCode" value="$source.source[source_code]$"/> | ||
</actionGroup> | ||
<actionGroup ref="saveProductForm" stepKey="saveProduct"/> | ||
</before> | ||
<after> | ||
<deleteData createDataKey="configurableProduct" stepKey="deleteConfigurableProduct"/> | ||
<deleteData createDataKey="configurableChildProduct" stepKey="deleteConfigurableProductVariation1"/> | ||
<deleteData createDataKey="configurableProductAttribute" stepKey="deleteConfigurableProductAttribute"/> | ||
<!--Assign Default Stock to Main Website.--> | ||
<actionGroup ref="AssignWebsiteToStockActionGroup" stepKey="assignMainWebsiteToDefaultStock"> | ||
<argument name="stockName" value="{{_defaultStock.name}}"/> | ||
<argument name="websiteName" value="{{_defaultWebsite.name}}"/> | ||
</actionGroup> | ||
<deleteData createDataKey="stock" stepKey="deleteStock"/> | ||
<!--Disable source.--> | ||
<actionGroup ref="DisableAllSourcesActionGroup" stepKey="disableAllSources"/> | ||
<actionGroup ref="logout" stepKey="logoutFromAdminArea"/> | ||
</after> | ||
|
||
<!--Add configurable product to cart.--> | ||
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> | ||
<argument name="Customer" value="$customer$" /> | ||
</actionGroup> | ||
<actionGroup ref="StorefrontAddConfigurableProductToTheCartActionGroup" stepKey="addConfigurableProductToCart"> | ||
<argument name="urlKey" value="$configurableProduct.custom_attributes[url_key]$" /> | ||
<argument name="productAttribute" value="$configurableProductAttribute.default_value$"/> | ||
<argument name="productOption" value="$getConfigAttributeOption.value$"/> | ||
<argument name="qty" value="{{defaultProductQty.value}}"/> | ||
</actionGroup> | ||
<!--Place order.--> | ||
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="navigateToCheckoutPage"/> | ||
<click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickOnNextButton"/> | ||
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/> | ||
<magentoCLI command="cache:flush" stepKey="flushCache"/> | ||
<!--Verify, configurable product has 'out of stock' status.--> | ||
<amOnPage url="{{StorefrontProductPage.url($configurableProduct.custom_attributes[url_key]$)}}" stepKey="navigateToConfigurablePDP"/> | ||
<see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="{{SourceStatusOutOfStock.value}}" stepKey="verifyProductStatus"/> | ||
</test> | ||
</tests> |
127 changes: 127 additions & 0 deletions
127
.../StorefrontLoggedInCustomerCreateOrderAllOptionQuantityConfigurableProductCustomStock.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,127 @@ | ||
<?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="StorefrontLoggedInCustomerCreateOrderAllOptionQuantityConfigurableProductCustomStock"> | ||
<annotations> | ||
<stories value="Configurable Product Custom Stock."/> | ||
<title value="Place order with all option quantity with configurable product on custom stock."/> | ||
<description value="Verify, configurable product option not visible after order placement with all it's quantity on custom stock."/> | ||
<severity value="MAJOR"/> | ||
<group value="msi"/> | ||
<group value="multi_mode"/> | ||
</annotations> | ||
|
||
<before> | ||
<!--Create test data.--> | ||
<createData entity="_defaultCategory" stepKey="category"/> | ||
<createData entity="BaseConfigurableProduct" stepKey="configurableProduct"> | ||
<requiredEntity createDataKey="category"/> | ||
</createData> | ||
<createData entity="productAttributeWithTwoOptions" stepKey="configurableProductAttribute"/> | ||
<createData entity="productAttributeOption1" stepKey="configurableProductAttributeOption1"> | ||
<requiredEntity createDataKey="configurableProductAttribute"/> | ||
</createData> | ||
<createData entity="productAttributeOption2" stepKey="configurableProductAttributeOption2"> | ||
<requiredEntity createDataKey="configurableProductAttribute"/> | ||
</createData> | ||
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> | ||
<requiredEntity createDataKey="configurableProductAttribute"/> | ||
</createData> | ||
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> | ||
<requiredEntity createDataKey="configurableProductAttribute"/> | ||
</getData> | ||
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> | ||
<requiredEntity createDataKey="configurableProductAttribute"/> | ||
</getData> | ||
<createData entity="ConfigurableProductTwoOptions" stepKey="configurableProductOption"> | ||
<requiredEntity createDataKey="configurableProduct"/> | ||
<requiredEntity createDataKey="configurableProductAttribute"/> | ||
<requiredEntity createDataKey="getConfigAttributeOption1"/> | ||
<requiredEntity createDataKey="getConfigAttributeOption2"/> | ||
</createData> | ||
<createData entity="ApiSimpleOne" stepKey="configurableChildProduct1"> | ||
<requiredEntity createDataKey="configurableProductAttribute"/> | ||
<requiredEntity createDataKey="getConfigAttributeOption1"/> | ||
</createData> | ||
<createData entity="ApiSimpleOne" stepKey="configurableChildProduct2"> | ||
<requiredEntity createDataKey="configurableProductAttribute"/> | ||
<requiredEntity createDataKey="getConfigAttributeOption2"/> | ||
</createData> | ||
<createData entity="ConfigurableProductAddChild" stepKey="configurableProductAddChild1"> | ||
<requiredEntity createDataKey="configurableProduct"/> | ||
<requiredEntity createDataKey="configurableChildProduct1"/> | ||
</createData> | ||
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> | ||
<requiredEntity createDataKey="configurableProduct"/> | ||
<requiredEntity createDataKey="configurableChildProduct2"/> | ||
</createData> | ||
<createData entity="Simple_US_Customer" stepKey="customer"/> | ||
<createData entity="_minimalSource" stepKey="source"/> | ||
<createData entity="BasicMsiStockWithMainWebsite1" stepKey="stock"/> | ||
<createData entity="SourceStockLinked1" stepKey="sourceStockLink"> | ||
<requiredEntity createDataKey="stock"/> | ||
<requiredEntity createDataKey="source"/> | ||
</createData> | ||
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/> | ||
<!--Assign additional source to configurable product.--> | ||
<amOnPage url="{{AdminProductEditPage.url($$configurableChildProduct1.id$$)}}" stepKey="openProduct1EditPage"/> | ||
<actionGroup ref="UnassignSourceFromProductActionGroup" stepKey="unassignDefaultSourceFromProduct1"> | ||
<argument name="sourceCode" value="{{_defaultSource.name}}"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminAssignSourceToProductAndSetSourceQuantityActionGroup" stepKey="assignSourceToProduct1"> | ||
<argument name="sourceCode" value="$$source.source[source_code]$$"/> | ||
</actionGroup> | ||
<actionGroup ref="saveProductForm" stepKey="saveProduct1"/> | ||
<amOnPage url="{{AdminProductEditPage.url($$configurableChildProduct2.id$$)}}" stepKey="openProduct2EditPage"/> | ||
<actionGroup ref="UnassignSourceFromProductActionGroup" stepKey="unassignDefaultSourceFromProduct2"> | ||
<argument name="sourceCode" value="{{_defaultSource.name}}"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminAssignSourceToProductAndSetSourceQuantityActionGroup" stepKey="assignSourceToProduct2"> | ||
<argument name="sourceCode" value="$$source.source[source_code]$$"/> | ||
</actionGroup> | ||
<actionGroup ref="saveProductForm" stepKey="saveProduct2"/> | ||
</before> | ||
<after> | ||
<deleteData createDataKey="configurableProduct" stepKey="deleteConfigurableProduct"/> | ||
<deleteData createDataKey="configurableChildProduct1" stepKey="deleteConfigurableProductVariation1"/> | ||
<deleteData createDataKey="configurableChildProduct2" stepKey="deleteConfigurableProductVariation2"/> | ||
<deleteData createDataKey="configurableProductAttribute" stepKey="deleteConfigurableProductAttribute"/> | ||
<!--Assign Default Stock to Main Website.--> | ||
<actionGroup ref="AssignWebsiteToStockActionGroup" stepKey="assignMainWebsiteToDefaultStock"> | ||
<argument name="stockName" value="{{_defaultStock.name}}"/> | ||
<argument name="websiteName" value="{{_defaultWebsite.name}}"/> | ||
</actionGroup> | ||
<deleteData createDataKey="stock" stepKey="deleteStock"/> | ||
<!--Disable source.--> | ||
<actionGroup ref="DisableAllSourcesActionGroup" stepKey="disableAllSources"/> | ||
<actionGroup ref="logout" stepKey="logoutFromAdminArea"/> | ||
</after> | ||
|
||
<!--Add configurable product to cart.--> | ||
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> | ||
<argument name="Customer" value="$$customer$$" /> | ||
</actionGroup> | ||
<actionGroup ref="StorefrontAddConfigurableProductToTheCartActionGroup" stepKey="addConfigurableProductToCart"> | ||
<argument name="urlKey" value="$$configurableProduct.custom_attributes[url_key]$$" /> | ||
<argument name="productAttribute" value="$$configurableProductAttribute.default_frontend_label$$"/> | ||
<argument name="productOption" value="$$getConfigAttributeOption1.value$$"/> | ||
<argument name="qty" value="{{defaultProductQty.value}}"/> | ||
</actionGroup> | ||
<!--Place order.--> | ||
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="navigateToCheckoutPage"/> | ||
<click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickOnNextButton"/> | ||
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/> | ||
<magentoCLI command="cache:flush" stepKey="flushCache"/> | ||
<!-- Assert out of stock option is absent on product page --> | ||
<amOnPage url="{{StorefrontProductPage.url($$configurableProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToConfigurablePDP"/> | ||
<waitForPageLoad stepKey="waitForConfigurablePDP"/> | ||
<dontSee userInput="$$getConfigAttributeOption1.label$$" selector="{{StorefrontProductInfoMainSection.optionByAttributeId($$configurableProductAttribute.attribute_id$$)}}" stepKey="assertOptionNotAvailable" /> | ||
<see userInput="$$getConfigAttributeOption2.label$$" selector="{{StorefrontProductInfoMainSection.optionByAttributeId($$configurableProductAttribute.attribute_id$$)}}" stepKey="assertOptionAvailable" /> | ||
</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
Oops, something went wrong.