Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertProductAttributeDisplayingOnFrontend.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Catalog\Test\Fixture\CatalogProductAttribute;
10 use Magento\Catalog\Test\Page\Product\CatalogProductView;
11 use Magento\Mtf\Client\BrowserInterface;
12 use Magento\Mtf\Constraint\AbstractConstraint;
13 use Magento\Mtf\Fixture\InjectableFixture;
14 
18 class AssertProductAttributeDisplayingOnFrontend extends AbstractConstraint
19 {
29  public function processAssert(
30  InjectableFixture $product,
31  CatalogProductAttribute $attribute,
32  CatalogProductView $catalogProductView,
33  BrowserInterface $browser
34  ) {
35  $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
36 
37  \PHPUnit\Framework\Assert::assertTrue(
38  in_array(
39  $attribute->getFrontendLabel(),
40  $catalogProductView->getAdditionalInformationBlock()->getAttributeLabels()
41  ),
42  'Attribute is not visible on product page in additional info block on frontend.'
43  );
44  }
45 
51  public function toString()
52  {
53  return 'Attribute is visible on product page in additional info block on frontend.';
54  }
55 }
processAssert(InjectableFixture $product, CatalogProductAttribute $attribute, CatalogProductView $catalogProductView, BrowserInterface $browser)