Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
All Data Structures Namespaces Files Functions Variables Pages
AssertGlobalSearchNoRecordsFound.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Backend\Test\Page\Adminhtml\Dashboard;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
16 class AssertGlobalSearchNoRecordsFound extends AbstractConstraint
17 {
21  const EXPECTED_RESULT = 'No records found.';
22 
29  public function processAssert(Dashboard $dashboard)
30  {
31  $isVisibleInResult = $dashboard->getAdminPanelHeader()->isSearchResultVisible(self::EXPECTED_RESULT);
32  \PHPUnit\Framework\Assert::assertTrue(
33  $isVisibleInResult,
34  'Expected text ' . self::EXPECTED_RESULT . ' is absent in search results'
35  );
36  }
37 
43  public function toString()
44  {
45  return '"No records found." is present in search results';
46  }
47 }