Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCustomVariableInGrid.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Variable\Test\Fixture\SystemVariable;
10 use Magento\Variable\Test\Page\Adminhtml\SystemVariableIndex;
11 use Magento\Mtf\Constraint\AbstractConstraint;
12 
17 class AssertCustomVariableInGrid extends AbstractConstraint
18 {
19  /* tags */
20  const SEVERITY = 'low';
21  /* end tags */
22 
30  public function processAssert(
31  SystemVariableIndex $systemVariableIndexNew,
32  SystemVariable $customVariable
33  ) {
34  $filter = [
35  'code' => $customVariable->getCode(),
36  'name' => $customVariable->getName(),
37  ];
38 
39  $systemVariableIndexNew->open();
40  \PHPUnit\Framework\Assert::assertTrue(
41  $systemVariableIndexNew->getSystemVariableGrid()->isRowVisible($filter),
42  'Custom Variable with code \'' . $filter['code'] . '\' is absent in Custom Variable grid.'
43  );
44  }
45 
51  public function toString()
52  {
53  return 'Custom System Variable is present in grid.';
54  }
55 }
processAssert(SystemVariableIndex $systemVariableIndexNew, SystemVariable $customVariable)