/**
  * Assert that created CMS page with 'Status' - Disabled displays with '404 Not Found' message on Frontend.
  *
  * @param CmsPage $cms
  * @param FrontCmsIndex $frontCmsIndex
  * @param CmsPageIndex $cmsIndex
  * @param BrowserInterface $browser
  * @return void
  */
 public function processAssert(CmsPage $cms, FrontCmsIndex $frontCmsIndex, CmsPageIndex $cmsIndex, BrowserInterface $browser)
 {
     $cmsIndex->open();
     $filter = ['title' => $cms->getTitle()];
     $cmsIndex->getCmsPageGridBlock()->searchAndPreview($filter);
     $browser->selectWindow();
     \PHPUnit_Framework_Assert::assertEquals(self::NOT_FOUND_MESSAGE, $frontCmsIndex->getTitleBlock()->getTitle(), 'Wrong page is displayed.');
 }
 /**
  * Assert that content of created cms page displayed in section 'maincontent' and equals passed from fixture.
  *
  * @param CmsPageIndex $cmsIndex
  * @param FrontCmsIndex $frontCmsIndex
  * @param FrontCmsPage $frontCmsPage
  * @param CmsPage $cms
  * @param BrowserInterface $browser
  * @return void
  */
 public function processAssert(CmsPageIndex $cmsIndex, FrontCmsIndex $frontCmsIndex, FrontCmsPage $frontCmsPage, CmsPage $cms, BrowserInterface $browser)
 {
     $cmsIndex->open();
     $filter = ['title' => $cms->getTitle()];
     $cmsIndex->getCmsPageGridBlock()->searchAndPreview($filter);
     $browser->selectWindow();
     $fixtureContent = $cms->getContent();
     \PHPUnit_Framework_Assert::assertContains($fixtureContent['content'], $frontCmsPage->getCmsPageBlock()->getPageContent(), 'Wrong content is displayed.');
     if (isset($fixtureContent['widget'])) {
         foreach ($fixtureContent['widget']['preset'] as $widget) {
             \PHPUnit_Framework_Assert::assertTrue($frontCmsPage->getCmsPageBlock()->isWidgetVisible($widget['widget_type'], $widget['anchor_text']), 'Widget \'' . $widget['widget_type'] . '\' is not displayed.');
         }
     }
     if ($cms->getContentHeading()) {
         \PHPUnit_Framework_Assert::assertEquals($cms->getContentHeading(), $frontCmsIndex->getTitleBlock()->getTitle(), 'Wrong title is displayed.');
     }
 }
 /**
  * Click on "Print Order" button.
  *
  * @return void
  */
 public function run()
 {
     $this->salesGuestView->getActionsToolbar()->clickLink('Print Order');
     $this->browser->selectWindow();
 }
 /**
  * Assert that newsletter preview opened in new window and template content correct
  *
  * @param BrowserInterface $browser
  * @param TemplatePreview $templatePreview
  * @param Template $newsletter
  * @return void
  */
 public function processAssert(BrowserInterface $browser, TemplatePreview $templatePreview, Template $newsletter)
 {
     $browser->selectWindow();
     $content = $templatePreview->getContent()->getPageContent();
     $browser->closeWindow();
     \PHPUnit_Framework_Assert::assertEquals($newsletter->getText(), $content, 'Template content not correct information.');
 }