Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertVideoProductView.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Client\BrowserInterface;
10 use Magento\Mtf\Fixture\InjectableFixture;
11 use Magento\Mtf\Constraint\AbstractConstraint;
12 use Magento\Catalog\Test\Page\Product\CatalogProductView;
13 
17 class AssertVideoProductView extends AbstractConstraint
18 {
26  public function processAssert(
27  BrowserInterface $browser,
28  CatalogProductView $catalogProductView,
29  InjectableFixture $product
30  ) {
31  $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
32  \PHPUnit\Framework\Assert::assertTrue(
33  $catalogProductView->getViewBlock()->isVideoVisible(),
34  'Product video is not displayed on product view when it should.'
35  );
36  }
37 
43  public function toString()
44  {
45  return 'Product video is displayed on product view.';
46  }
47 }
processAssert(BrowserInterface $browser, CatalogProductView $catalogProductView, InjectableFixture $product)