/**
  * Assert that after save a term search on edit term search page displays:
  *  - correct Search Query field passed from fixture
  *  - correct Synonym
  *  - correct Redirect URL
  *  - correct Suggested Terms
  *
  * @param CatalogSearchIndex $indexPage
  * @param CatalogSearchQuery $searchTerm
  * @return void
  */
 public function processAssert(CatalogSearchIndex $indexPage, CatalogSearchQuery $searchTerm)
 {
     $indexPage->open();
     $filters = ['search_query' => $searchTerm->getQueryText(), 'synonym_for' => $searchTerm->getSynonymFor(), 'redirect' => $searchTerm->getRedirect(), 'display_in_terms' => $searchTerm->getDisplayInTerms()];
     $indexPage->getGrid()->search($filters);
     \PHPUnit_Framework_Assert::assertTrue($indexPage->getGrid()->isRowVisible($filters, false), 'Row terms according to the filters is not found.');
 }
 /**
  * Assert that after save a search term:
  *  - it displays in the Search field at the top of the page if type set of characters passed from fixture
  *  - after click 'Go' of Search field opens a results page if it was not specified Redirect URL
  *  - after click 'Go' of Search field a customer search redirects to a specific page (passed from fixture)
  *    if it was specified Redirect URL
  *
  * @param CmsIndex $cmsIndex
  * @param CatalogSearchQuery $searchTerm
  * @param Browser $browser
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, CatalogSearchQuery $searchTerm, Browser $browser)
 {
     $errors = [];
     $this->searchBlock = $cmsIndex->open()->getSearchBlock();
     if ($searchTerm->hasData('display_in_terms') && $searchTerm->getDisplayInTerms() === 'Yes') {
         $errors = !$this->isSugestSearchisVisible($searchTerm) ? '- block "Suggest Search" when searching was not found' : [];
     }
     $this->searchBlock->search($searchTerm->getQueryText());
     $windowUrl = $browser->getUrl();
     $redirectUrl = $searchTerm->getRedirect();
     if ($windowUrl !== $redirectUrl) {
         $errors[] = '- url window (' . $windowUrl . ') does not match the url redirect(' . $redirectUrl . ')';
     }
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }