10 use Magento\Catalog\Test\Page\Category\CatalogCategoryView;
11 use Magento\Mtf\Client\BrowserInterface;
12 use Magento\Mtf\Constraint\AbstractConstraint;
32 CatalogCategoryView $categoryView,
33 BrowserInterface $browser
36 \PHPUnit\Framework\Assert::assertFalse(
37 $categoryView->getTopmenu()->isCategoryVisible(
$category->getName()),
38 'Category can be accessed from the navigation bar in the frontend.' 40 \PHPUnit\Framework\Assert::assertEquals(
41 self::NOT_FOUND_MESSAGE,
42 $categoryView->getTitleBlock()->getTitle(),
43 'Wrong page is displayed.' 57 $categoryUrlKey[] =
$category->hasData(
'url_key')
59 : trim(strtolower(preg_replace(
'#[^0-9a-z%]+#i',
'-',
$category->getName())),
'-');
67 return $_ENV[
'app_frontend_url'] . implode(
'/', array_reverse($categoryUrlKey)) .
'.html';
77 return 'Category cannot be accessed from the navigation bar.';
getCategoryUrl(Category $category)
processAssert(Category $category, CatalogCategoryView $categoryView, BrowserInterface $browser)