9 use Magento\Mtf\Constraint\AbstractConstraint;
10 use Magento\Checkout\Test\Page\CheckoutOnepage;
11 use Magento\Cms\Test\Page\CmsIndex;
36 CheckoutOnepage $checkoutPage,
37 $checkoutSummaryMaxVisibleCartItemsCount,
38 $totalItemsCountInShoppingCart
40 $sidebar = $cmsIndex->getCartSidebarBlock();
41 $sidebar->openMiniCart();
42 $sidebar->clickProceedToCheckoutButton();
44 $reviewBlock = $checkoutPage->getReviewBlock();
46 if ($totalItemsCountInShoppingCart > $checkoutSummaryMaxVisibleCartItemsCount) {
47 $counterMessage = sprintf(
48 self::VISIBLE_ITEMS_COUNTER_MASSAGE,
49 $checkoutSummaryMaxVisibleCartItemsCount,
50 $totalItemsCountInShoppingCart
53 $counterMessage = sprintf(self::ITEMS_COUNTER_MASSAGE, $totalItemsCountInShoppingCart);
56 $count = $reviewBlock->getVisibleItemsCounter();
58 \PHPUnit\Framework\Assert::assertEquals(
61 'Wrong counter text of visible Cart items in mini shopping cart' 72 return 'Quantity of visible Cart items the same as minicart configuration value.';
const ITEMS_COUNTER_MASSAGE
processAssert(CmsIndex $cmsIndex, CheckoutOnepage $checkoutPage, $checkoutSummaryMaxVisibleCartItemsCount, $totalItemsCountInShoppingCart)
const VISIBLE_ITEMS_COUNTER_MASSAGE