Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertProductAttributeInGrid.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Catalog\Test\Fixture\CatalogProductAttribute;
10 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductAttributeIndex;
11 use Magento\Mtf\Constraint\AbstractConstraint;
12 
16 class AssertProductAttributeInGrid extends AbstractConstraint
17 {
25  public function processAssert(CatalogProductAttribute $attribute, CatalogProductAttributeIndex $attributeIndexPage)
26  {
27  $attributeIndexPage->open();
28  $code = $attribute->getAttributeCode();
29  \PHPUnit\Framework\Assert::assertTrue(
30  $attributeIndexPage->getGrid()->isRowVisible(['attribute_code' => $code]),
31  'Attribute with attribute code "' . $code . '" is absent in attribute grid.'
32  );
33  }
34 
40  public function toString()
41  {
42  return 'Product attribute is present in attribute grid.';
43  }
44 }
processAssert(CatalogProductAttribute $attribute, CatalogProductAttributeIndex $attributeIndexPage)
$code
Definition: info.phtml:12