Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertMinicartEmpty.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Cms\Test\Page\CmsIndex;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
15 class AssertMinicartEmpty extends AbstractConstraint
16 {
20  const TEXT_EMPTY_MINICART = 'You have no items in your shopping cart.';
21 
27  public function processAssert(
28  CmsIndex $cmsIndex
29  ) {
30  $cmsIndex->open();
31  \PHPUnit\Framework\Assert::assertEquals(
32  self::TEXT_EMPTY_MINICART,
33  $cmsIndex->getCartSidebarBlock()->getEmptyMessage(),
34  'Empty minicart message not found'
35  );
36 
37  \PHPUnit\Framework\Assert::assertFalse(
38  $cmsIndex->getCartSidebarBlock()->isItemsQtyVisible(),
39  'Minicart is not empty'
40  );
41  }
42 
48  public function toString()
49  {
50  return 'Minicart is empty';
51  }
52 }