Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertProductAttributeAbsenceInGrid.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 
17 class AssertProductAttributeAbsenceInGrid extends AbstractConstraint
18 {
19  /* tags */
20  const SEVERITY = 'high';
21  /* end tags */
22 
30  public function processAssert(
31  CatalogProductAttributeIndex $attributeIndex,
32  CatalogProductAttribute $attribute
33  ) {
34  $filter = [
35  'attribute_code' => $attribute->getAttributeCode(),
36  ];
37 
38  $attributeIndex->open();
39  \PHPUnit\Framework\Assert::assertFalse(
40  $attributeIndex->getGrid()->isRowVisible($filter),
41  'Attribute \'' . $attribute->getFrontendLabel() . '\' is present in Attribute grid.'
42  );
43  }
44 
50  public function toString()
51  {
52  return 'Product Attribute is absent in Attribute grid.';
53  }
54 }
processAssert(CatalogProductAttributeIndex $attributeIndex, CatalogProductAttribute $attribute)