/**
  * Assert that you will be redirected to url from dataset
  *
  * @param CmsIndex $cmsIndex
  * @param BrowserInterface $browser
  * @param CatalogSearchQuery $searchTerm
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, BrowserInterface $browser, CatalogSearchQuery $searchTerm)
 {
     $cmsIndex->open()->getSearchBlock()->search($searchTerm->getSynonymFor());
     $windowUrl = $browser->getUrl();
     $redirectUrl = $searchTerm->getRedirect();
     \PHPUnit_Framework_Assert::assertEquals($windowUrl, $redirectUrl, 'Redirect by synonym was not executed.' . PHP_EOL . "Expected: " . $redirectUrl . PHP_EOL . "Actual: " . $windowUrl);
 }
コード例 #2
0
 /**
  * Assert that after save a term search on edit term search page displays:
  *  - correct Search Query field passed from fixture
  *  - correct Store
  *  - correct Results
  *  - correct Uses
  *  - correct Synonym
  *  - correct Redirect URL
  *  - correct Suggested Terms
  *
  * @param CatalogSearchIndex $indexPage
  * @param CatalogSearchQuery $searchTerm
  * @return void
  */
 public function processAssert(CatalogSearchIndex $indexPage, CatalogSearchQuery $searchTerm)
 {
     $grid = $indexPage->open()->getGrid();
     $filters = ['search_query' => $searchTerm->getQueryText(), 'store_id' => $searchTerm->getStoreId(), 'results_from' => $searchTerm->getNumResults(), 'popularity_from' => $searchTerm->getPopularity(), 'synonym_for' => $searchTerm->getSynonymFor(), 'redirect' => $searchTerm->getRedirect(), 'display_in_terms' => strtolower($searchTerm->getDisplayInTerms())];
     $grid->search($filters);
     unset($filters['store_id']);
     \PHPUnit_Framework_Assert::assertTrue($grid->isRowVisible($filters, false), 'Row terms according to the filters is not found.');
 }
コード例 #3
0
 /**
  * Assert that you will be not redirected to url from dataset
  *
  * @param CmsIndex $cmsIndex
  * @param CatalogSearchQuery $searchTerm
  * @param BrowserInterface $browser
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, BrowserInterface $browser, CatalogSearchQuery $searchTerm)
 {
     $cmsIndex->open()->getSearchBlock()->search($searchTerm->getSynonymFor());
     \PHPUnit_Framework_Assert::assertNotEquals($browser->getUrl(), $searchTerm->getRedirect(), 'Url in the browser corresponds to Url in fixture (redirect has been performed).' . PHP_EOL . 'Search term: "' . $searchTerm->getQueryText() . '"');
 }