Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertVideoCategoryView.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Cms\Test\Page\CmsIndex;
10 use Magento\Mtf\Fixture\InjectableFixture;
11 use Magento\Mtf\Constraint\AbstractConstraint;
12 use Magento\Catalog\Test\Page\Category\CatalogCategoryView;
13 
17 class AssertVideoCategoryView extends AbstractConstraint
18 {
27  public function processAssert(
28  CmsIndex $cmsIndex,
29  CatalogCategoryView $catalogCategoryView,
30  InjectableFixture $product
31  ) {
32  $cmsIndex->open();
33  $cmsIndex->getTopmenu()->selectCategoryByName($product->getCategoryIds()[0]);
34  $src = $catalogCategoryView->getListProductBlock()->getProductItem($product)->getBaseImageSource();
35  \PHPUnit\Framework\Assert::assertFalse(
36  strpos($src, '/placeholder/') !== false,
37  'Video preview image is not displayed on category view when it should.'
38  );
39  }
40 
46  public function toString()
47  {
48  return 'Video preview images is displayed on category view.';
49  }
50 }
processAssert(CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, InjectableFixture $product)