Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertAdvancedSearchNoResult.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Constraint\AbstractConstraint;
10 use Magento\CatalogSearch\Test\Page\AdvancedResult;
11 
15 class AssertAdvancedSearchNoResult extends AbstractConstraint
16 {
20  const ERROR_MESSAGE = 'We can\'t find any items matching these search criteria. Modify your search.';
21 
28  public function processAssert(AdvancedResult $resultPage)
29  {
30  \PHPUnit\Framework\Assert::assertTrue(
31  $resultPage->getSearchResultBlock()->isVisibleMessages(self::ERROR_MESSAGE),
32  "The error message '" . self::ERROR_MESSAGE . "' is not visible."
33  );
34  }
35 
41  public function toString()
42  {
43  return 'Error message is visible.';
44  }
45 }