Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertProductReviewNotOnProductPage.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Catalog\Test\Page\Product\CatalogProductView;
12 use Magento\Mtf\Client\BrowserInterface;
13 use Magento\Mtf\Constraint\AbstractConstraint;
14 
19 class AssertProductReviewNotOnProductPage extends AbstractConstraint
20 {
29  public function processAssert(
30  CatalogProductView $catalogProductView,
31  Review $reviewInitial,
32  BrowserInterface $browser
33  ) {
35  $product = $reviewInitial->getDataFieldConfig('entity_id')['source']->getEntity();
36  $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
37 
38  $reviewBlock = $catalogProductView->getCustomerReviewBlock();
39  $catalogProductView->getViewBlock()->selectTab('Reviews');
40  \PHPUnit\Framework\Assert::assertFalse(
41  $reviewBlock->isVisibleReviewItem(),
42  'Error, product review is displayed.'
43  );
44  }
45 
51  public function toString()
52  {
53  return 'Review is not available on the product page.';
54  }
55 }