Skip to content

Commit 28997a8

Browse files
MAGETWO-98522: Adding out of stock items to comparison shows success message but fails
- Fix static and functional test
1 parent 27326b0 commit 28997a8

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/AddOutOfStockProductToCompareListTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<deleteData createDataKey="product" stepKey="deleteProduct"/>
3030
<deleteData createDataKey="category" stepKey="deleteCategory"/>
3131
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
32+
<actionGroup ref="noDisplayOutOfStockProduct" stepKey="noDisplayOutOfStockProduct"/>
3233
</after>
3334

3435
<!--Check 'out of stock' is turned off by default-->

app/code/Magento/Catalog/ViewModel/Product/Checker/AddToCompareAvailability.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public function __construct(StockConfigurationInterface $stockConfiguration)
3232
/**
3333
* Is product available for comparison.
3434
*
35+
* @param ProductInterface $product
3536
* @return bool
3637
*/
3738
public function isAvailableForCompare(ProductInterface $product): bool
@@ -43,6 +44,7 @@ public function isAvailableForCompare(ProductInterface $product): bool
4344
/**
4445
* Get is in stock status.
4546
*
47+
* @param ProductInterface $product
4648
* @return bool
4749
*/
4850
private function isInStock(ProductInterface $product): bool

app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/DisplayOutOfStockProductActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<actionGroup name="noDisplayOutOfStockProduct">
2222
<amOnPage url="{{InventoryConfigurationPage.url}}" stepKey="navigateToInventoryConfigurationPage"/>
2323
<waitForPageLoad stepKey="waitForConfigPageToLoad"/>
24+
<conditionalClick stepKey="expandProductStockOptions" selector="{{InventoryConfigSection.ProductStockOptionsTab}}" dependentSelector="{{InventoryConfigSection.CheckIfProductStockOptionsTabExpanded}}" visible="true" />
2425
<uncheckOption selector="{{InventoryConfigSection.DisplayOutOfStockSystemValue}}" stepKey="uncheckUseSystemValue"/>
2526
<waitForElementVisible selector="{{InventoryConfigSection.DisplayOutOfStockDropdown}}" stepKey="waitForSwitcherDropdown" />
2627
<selectOption selector="{{InventoryConfigSection.DisplayOutOfStockDropdown}}" userInput="No" stepKey="switchToNo" />

0 commit comments

Comments
 (0)