Skip to content

Commit

Permalink
Merge branch 'b-7.3.x-low_stock_popup-OXDEV-7605' into b-7.3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
tkcreateit committed Nov 20, 2024
2 parents 3aa822f + 563d081 commit bf04714
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/Codeception/Acceptance/ProductDetailsPageCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,39 @@ public function checkProductAmountPrice(AcceptanceTester $I): void
->seeAmountPrices($amountPrices);
}

#[group('product')]
public function popupWhenExceedingStockAvailability(AcceptanceTester $I): void
{
$I->wantToTest('popup is show when exceeding stock availability');

$productNavigation = new ProductNavigation($I);

$productId = '1000';

$I->updateConfigInDatabase('iNewBasketItemMessage', '2', 'str');

// making product out of stock now
$I->updateInDatabase('oxarticles', ['oxstock' => '1', 'oxstockflag' => '2'], ['oxid' => $productId]);

//open details page
$productNavigation
->openProductDetailsPage($productId)
->addProductToBasket(2);

$I->see(Translator::translate('ERROR_MESSAGE_OUTOFSTOCK_OUTOFSTOCK'));

//assert product in basket
$basketItem = [
'id' => $productId,
'title' => 'Test product 0 [EN] šÄßüл',
'totalPrice' => '50,00 €',
'amount' => 1
];

$basketPage = $I->openShop()->openBasket();
$basketPage->seeBasketContains([$basketItem], '50,00 €');
}

private function getExistingUserData()
{
return Fixtures::get('existingUser');
Expand Down

0 comments on commit bf04714

Please sign in to comment.