9 use Magento\Catalog\Test\Page\Category\CatalogCategoryView;
10 use Magento\Cms\Test\Page\CmsIndex;
12 use Magento\Mtf\Constraint\AbstractConstraint;
31 CatalogCategoryView $catalogCategoryView,
39 if (isset($widget->getWidgetInstance()[0][
'entities'])) {
40 $categoryName = $widget->getWidgetInstance()[0][
'entities']->getName();
42 $categoryName = $widget->getParameters()[
'entities']->getCategoyId()[0];
44 if ($widget->getCode() ==
'CMS Static Block') {
45 $widgetText = $widget->getParameters()[
'entities'][0]->getContent();
47 $widgetText = $widget->getParameters()[
'anchor_text'];
49 $cmsIndex->getTopmenu()->selectCategoryByName($categoryName);
50 \PHPUnit\Framework\Assert::assertTrue(
51 $catalogCategoryView->getWidgetView()->isWidgetVisible($widget, $widgetText),
52 'Widget is absent on Category page.' 63 return "Widget is present on Category page.";