9 use Magento\Catalog\Test\Page\Category\CatalogCategoryView;
10 use Magento\Cms\Test\Page\CmsIndex;
11 use Magento\Mtf\Client\BrowserInterface;
30 private $categoryViewPage;
37 private $cmsIndexPage;
61 CatalogCategoryView $categoryView,
63 Category $initialCategory,
67 $this->categoryViewPage = $categoryView;
68 $this->cmsIndexPage = $cmsIndex;
70 $this->verifyUnavailabilityCategoryOnMainStore(
$category);
71 $this->verifyAvailabilityCategoryOnMainStore($initialCategory);
72 $this->verifyCategoryOnCustomStore(
$category);
81 private function verifyUnavailabilityCategoryOnMainStore(Category
$category)
83 $this->browser->open($_ENV[
'app_frontend_url'] .
$category->getUrlKey() .
'.html');
85 \PHPUnit\Framework\Assert::assertEquals(
86 self::NOT_FOUND_MESSAGE,
87 $this->categoryViewPage->getTitleBlock()->getTitle(),
88 'Category ' .
$category->getName() .
' is available on Main Store, but should not.' 98 private function verifyAvailabilityCategoryOnMainStore(Category
$category)
100 $this->browser->open($_ENV[
'app_frontend_url'] .
$category->getUrlKey() .
'.html');
102 \PHPUnit\Framework\Assert::assertEquals(
104 $this->categoryViewPage->getTitleBlock()->getTitle(),
105 'Category ' .
$category->getName() .
' is not available on Main Store, but should.' 115 private function verifyCategoryOnCustomStore(Category
$category)
117 $this->cmsIndexPage->getStoreSwitcherBlock()->selectStoreView(
$category->getStoreId()[
'source']->getName());
118 $this->cmsIndexPage->getLinksBlock()->waitWelcomeMessage();
120 $this->browser->open($_ENV[
'app_frontend_url'] .
$category->getUrlKey() .
'.html');
122 \PHPUnit\Framework\Assert::assertEquals(
124 $this->categoryViewPage->getTitleBlock()->getTitle(),
125 'Category ' .
$category->getName() .
' is not available on custom store.' 136 return 'Category displayed in appropriate store.';
processAssert(BrowserInterface $browser, CatalogCategoryView $categoryView, Category $category, Category $initialCategory, CmsIndex $cmsIndex)