Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCmsPageDisabledOnFrontend.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Cms\Test\Page\Adminhtml\CmsPageIndex;
11 use Magento\Cms\Test\Page\CmsIndex as FrontCmsIndex;
12 use Magento\Mtf\Client\BrowserInterface;
13 use Magento\Mtf\Constraint\AbstractConstraint;
14 
18 class AssertCmsPageDisabledOnFrontend extends AbstractConstraint
19 {
20  const NOT_FOUND_MESSAGE = 'Whoops, our bad...';
21 
31  public function processAssert(
32  CmsPage $cms,
33  FrontCmsIndex $frontCmsIndex,
34  CmsPageIndex $cmsIndex,
35  BrowserInterface $browser
36  ) {
37  $cmsIndex->open();
38  $filter = ['title' => $cms->getTitle()];
39  $cmsIndex->getCmsPageGridBlock()->searchAndPreview($filter);
40  $browser->selectWindow();
41  \PHPUnit\Framework\Assert::assertEquals(
42  self::NOT_FOUND_MESSAGE,
43  $frontCmsIndex->getTitleBlock()->getTitle(),
44  'Wrong page is displayed.'
45  );
46  }
47 
53  public function toString()
54  {
55  return 'Not found page is display.';
56  }
57 }
processAssert(CmsPage $cms, FrontCmsIndex $frontCmsIndex, CmsPageIndex $cmsIndex, BrowserInterface $browser)