/** * Assert that banner presents on specific category page. * * @param CatalogProductSimple $product * @param CmsIndex $cmsIndex * @param Banner $banner * @param CatalogCategoryView $catalogCategoryView * @param Customer $customer[optional] * @param Cache $adminCache * @return void */ public function processAssert(CatalogProductSimple $product, CmsIndex $cmsIndex, Banner $banner, CatalogCategoryView $catalogCategoryView, Customer $customer = null, Cache $adminCache) { // Flush cache $adminCache->open(); $adminCache->getPageActions()->flushCacheStorage(); $adminCache->getMessagesBlock()->waitSuccessMessage(); if ($customer !== null) { $this->objectManager->create('Mage\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run(); } else { $cmsIndex->open(); } $cmsIndex->getTopmenu()->selectCategory($product->getCategoryIds()[0]); \PHPUnit_Framework_Assert::assertTrue($catalogCategoryView->getBannerViewBlock()->checkWidgetBanners($banner), 'Banner is absent on Category page.'); }