Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertProductAttributeIsHtmlAllowed.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 AssertProductAttributeIsHtmlAllowed extends AbstractConstraint
19 {
20  /* tags */
21  const SEVERITY = 'low';
22  /* end tags */
23 
35  public function processAssert(
36  InjectableFixture $product,
37  CatalogProductAttribute $attribute,
38  CatalogProductView $catalogProductView,
39  BrowserInterface $browser
40  ) {
41  $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
42 
43  \PHPUnit\Framework\Assert::assertTrue(
44  $catalogProductView->getAdditionalInformationBlock()->hasHtmlTagInAttributeValue($attribute),
45  'Attribute is not visible with HTML tags on frontend.'
46  );
47  }
48 
54  public function toString()
55  {
56  return 'Attribute is visible with HTML tags on frontend.';
57  }
58 }
processAssert(InjectableFixture $product, CatalogProductAttribute $attribute, CatalogProductView $catalogProductView, BrowserInterface $browser)