/**
  * Assert that created banner is found by name and has correct banner types, visibility, status.
  *
  * @param Banner $banner
  * @param BannerIndex $bannerIndex
  * @return void
  */
 public function processAssert(Banner $banner, BannerIndex $bannerIndex)
 {
     $bannerIndex->open();
     $filter = ['name' => $banner->getName(), 'active' => $banner->getIsEnabled()];
     $isStoreContents = $banner->getStoreContents();
     if (isset($isStoreContents['store_views'])) {
         $filter['visibility'] = $banner->getDataFieldConfig('store_contents')['source']->getStore();
     }
     $bannerIndex->getGrid()->search($filter);
     if ($banner->hasData('types')) {
         $filter['types'] = implode(', ', $banner->getTypes());
     }
     unset($filter['visibility']);
     \PHPUnit_Framework_Assert::assertTrue($bannerIndex->getGrid()->isRowVisible($filter, false), 'Banner is absent in grid.');
 }