Skip to content

Commit

Permalink
Merge branch 'b-7.3.x' into b-8.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
tkcreateit committed Nov 20, 2024
2 parents 7cbf8f4 + bf04714 commit 614bc18
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 @@ -706,6 +706,39 @@ public function lowStockProductVariantTests(AcceptanceTester $I): void
$I->see($lowStockMessage);
}

#[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 getProductData(string $productID): array
{
return Fixtures::get('product-' . $productID);
Expand Down

0 comments on commit 614bc18

Please sign in to comment.