Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertBackendPageIsAvailable.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 
15 class AssertBackendPageIsAvailable extends AbstractConstraint
16 {
17  const ERROR_TEXT = '404 Error';
18 
26  public function processAssert(Dashboard $dashboard, $pageTitle)
27  {
28  \PHPUnit\Framework\Assert::assertEquals(
29  $pageTitle,
30  $dashboard->getTitleBlock()->getTitle(),
31  'Invalid page title is displayed.'
32  );
33  \PHPUnit\Framework\Assert::assertNotContains(
34  self::ERROR_TEXT,
35  $dashboard->getErrorBlock()->getContent(),
36  "404 Error is displayed on '$pageTitle' page."
37  );
38  }
39 
45  public function toString()
46  {
47  return 'Backend has correct title and 404 page content is absent.';
48  }
49 }