Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertProductIsPresentInWishlist.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Cms\Test\Page\CmsIndex;
10 use Magento\Customer\Test\Page\CustomerAccountIndex;
11 use Magento\Wishlist\Test\Page\WishlistIndex;
12 use Magento\Mtf\Constraint\AbstractConstraint;
13 use Magento\Mtf\Fixture\InjectableFixture;
14 
18 class AssertProductIsPresentInWishlist extends AbstractConstraint
19 {
29  public function processAssert(
30  CmsIndex $cmsIndex,
31  CustomerAccountIndex $customerAccountIndex,
32  WishlistIndex $wishlistIndex,
33  InjectableFixture $product
34  ) {
35  $cmsIndex->open();
36  $cmsIndex->getLinksBlock()->openLink('My Account');
37  $customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Wish List');
38 
39  \PHPUnit\Framework\Assert::assertTrue(
40  $wishlistIndex->getWishlistBlock()->getProductItemsBlock()->getItemProduct($product)->isVisible(),
41  $product->getName() . ' is not visible on Wish List page.'
42  );
43  }
44 
50  public function toString()
51  {
52  return 'Product is present in default Wish List.';
53  }
54 }
processAssert(CmsIndex $cmsIndex, CustomerAccountIndex $customerAccountIndex, WishlistIndex $wishlistIndex, InjectableFixture $product)