Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertSearchTermsInGrid.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Reports\Test\Page\Adminhtml\SearchIndex;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
16 class AssertSearchTermsInGrid extends AbstractConstraint
17 {
27  public function processAssert(SearchIndex $searchIndex, $productName, $countProducts, $countSearch)
28  {
29  $filter = [
30  'query_text' => $productName,
31  'num_results' => $countProducts,
32  'popularity' => $countSearch,
33  ];
34  \PHPUnit\Framework\Assert::assertTrue(
35  $searchIndex->getSearchGrid()->isRowVisible($filter),
36  'Search terms report is absent in Search Terms grid.'
37  );
38  }
39 
45  public function toString()
46  {
47  return 'Search terms report is present in Search Terms grid.';
48  }
49 }
processAssert(SearchIndex $searchIndex, $productName, $countProducts, $countSearch)