/**
  * Check whether attribute is displayed in the advanced search form on the frontend.
  *
  * @param CatalogProductAttribute $attribute
  * @param AdvancedSearch $advancedSearch
  * @return void
  */
 public function processAssert(CatalogProductAttribute $attribute, AdvancedSearch $advancedSearch)
 {
     $advancedSearch->open();
     $formLabels = $advancedSearch->getForm()->getFormlabels();
     $label = $attribute->hasData('manage_frontend_label') ? $attribute->getManageFrontendLabel() : $attribute->getFrontendLabel();
     \PHPUnit_Framework_Assert::assertTrue(in_array($label, $formLabels), 'Attribute is absent on advanced search form.');
 }
 /**
  * Run test creation for advanced search entity.
  *
  * @param CatalogProductSimple $productSearch
  * @param CmsIndex $cmsIndex
  * @param AdvancedSearch $searchPage
  * @return void
  */
 public function test(CatalogProductSimple $productSearch, CmsIndex $cmsIndex, AdvancedSearch $searchPage)
 {
     $cmsIndex->open();
     $cmsIndex->getFooterBlock()->openAdvancedSearch();
     $searchForm = $searchPage->getForm();
     $searchForm->fill($productSearch);
     $searchForm->submit();
 }
 /**
  * Run test creation for advanced search entity
  *
  * @param array $products
  * @param CatalogProductSimple $productSearch
  * @param CmsIndex $cmsIndex
  * @param AdvancedSearch $searchPage
  * @return void
  *
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function testSearch(array $products, CatalogProductSimple $productSearch, CmsIndex $cmsIndex, AdvancedSearch $searchPage)
 {
     $cmsIndex->open();
     $cmsIndex->getSearchBlock()->clickAdvancedSearchButton();
     $searchForm = $searchPage->getForm();
     $searchForm->fill($productSearch);
     $searchForm->submit();
 }
 /**
  * Assert that product attribute is searchable on Frontend.
  *
  * @param CmsIndex $cmsIndex
  * @param InjectableFixture $product
  * @param AdvancedSearch $searchPage
  * @param CatalogsearchResult $catalogSearchResult
  * @param FixtureFactory $fixtureFactory
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, InjectableFixture $product, AdvancedSearch $searchPage, CatalogsearchResult $catalogSearchResult, FixtureFactory $fixtureFactory)
 {
     $this->fixtureFactory = $fixtureFactory;
     $cmsIndex->open();
     $cmsIndex->getFooterBlock()->openAdvancedSearch();
     $searchForm = $searchPage->getForm();
     $productSearch = $this->prepareFixture($product);
     $searchForm->fill($productSearch);
     $searchForm->submit();
     $isVisible = $catalogSearchResult->getListProductBlock()->getProductItem($product)->isVisible();
     while (!$isVisible && $catalogSearchResult->getBottomToolbar()->nextPage()) {
         $isVisible = $catalogSearchResult->getListProductBlock()->getProductItem($product)->isVisible();
     }
     \PHPUnit_Framework_Assert::assertTrue($isVisible, 'Product attribute is not searchable on Frontend.');
 }