/**
  * Assert that created CMS Page URL Rewrite lead to appropriate page in frontend.
  *
  * @param UrlRewrite $urlRewrite
  * @param CmsPage $cmsPage
  * @param SystemVariableNew $systemVariableNew
  * @param BrowserInterface $browser
  * @return void
  */
 public function processAssert(UrlRewrite $urlRewrite, CmsPage $cmsPage, SystemVariableNew $systemVariableNew, BrowserInterface $browser)
 {
     $browser->open($_ENV['app_frontend_url'] . $urlRewrite->getRequestPath());
     if ($urlRewrite->hasData('store_id')) {
         $store = explode('/', $urlRewrite->getStoreId());
         $systemVariableNew->getFormPageActions()->selectStoreView($store[2]);
     }
     $url = $urlRewrite->getRedirectType() == 'No' ? $urlRewrite->getRequestPath() : $cmsPage->getTitle();
     \PHPUnit_Framework_Assert::assertEquals($_ENV['app_frontend_url'] . $url, $browser->getUrl(), 'URL rewrite CMS Page redirect false.');
 }
 /**
  * Update CMS page rewrites.
  *
  * @param UrlRewrite $urlRewrite
  * @param UrlRewrite $cmsPageRewrite
  * @return array
  */
 public function test(UrlRewrite $urlRewrite, UrlRewrite $cmsPageRewrite)
 {
     // Preconditions
     $cmsPageRewrite->persist();
     // Steps
     $this->urlRewriteIndex->open();
     $this->storeName = $urlRewrite->getStoreId();
     $filter = ['request_path' => $cmsPageRewrite->getRequestPath()];
     $this->urlRewriteIndex->getUrlRedirectGrid()->searchAndOpen($filter);
     $this->urlRewriteEdit->getFormBlock()->fill($urlRewrite);
     $this->urlRewriteEdit->getPageMainActions()->save();
     return ['cmsPage' => $cmsPageRewrite->getDataFieldConfig('target_path')['source']->getEntity()];
 }