Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields
AssertWidgetCatalogCategoryLink Class Reference
Inheritance diagram for AssertWidgetCatalogCategoryLink:

Public Member Functions

 processAssert (CmsIndex $cmsIndex, CatalogCategoryView $categoryView, Widget $widget, Cache $cache)
 
 toString ()
 

Data Fields

const SEVERITY = 'low'
 

Detailed Description

Check that created widget displayed on frontend on Home page and on Advanced Search and after click on widget link on frontend system redirects you to catalog page.

Definition at line 19 of file AssertWidgetCatalogCategoryLink.php.

Member Function Documentation

◆ processAssert()

processAssert ( CmsIndex  $cmsIndex,
CatalogCategoryView  $categoryView,
Widget  $widget,
Cache  $cache 
)

Assert that created widget displayed on frontend on Home page and on Advanced Search and after click on widget link on frontend system redirects you to catalog page.

Parameters
CmsIndex$cmsIndex
CatalogCategoryView$categoryView
Widget$widget
Cache$cache
Returns
void

Definition at line 35 of file AssertWidgetCatalogCategoryLink.php.

40  {
41  // Flush cache
42  $cache->flush();
43 
44  $cmsIndex->open();
45  $widgetText = $widget->getParameters()['anchor_text'];
46 
47  \PHPUnit\Framework\Assert::assertTrue(
48  $cmsIndex->getWidgetView()->isWidgetVisible($widget, $widgetText),
49  'Widget with type catalog category link is absent on Home page.'
50  );
51 
52  $cmsIndex->getWidgetView()->clickToWidget($widget, $widgetText);
53  $title = $categoryView->getTitleBlock()->getTitle();
54  \PHPUnit\Framework\Assert::assertEquals(
55  $widget->getParameters()['entities'][0]->getName(),
56  $title,
57  'Wrong category title.'
58  );
59 
60  $cmsIndex->getFooterBlock()->openAdvancedSearch();
61  \PHPUnit\Framework\Assert::assertTrue(
62  $cmsIndex->getWidgetView()->isWidgetVisible($widget, $widgetText),
63  'Widget with type catalog category link is absent on Advanced Search page.'
64  );
65  }
$title
Definition: default.phtml:14

◆ toString()

toString ( )

Returns a string representation of the object.

Returns
string

Definition at line 72 of file AssertWidgetCatalogCategoryLink.php.

73  {
74  return "Created widget displayed on frontend on Home and Advanced Search pages.";
75  }

Field Documentation

◆ SEVERITY

const SEVERITY = 'low'

Definition at line 22 of file AssertWidgetCatalogCategoryLink.php.


The documentation for this class was generated from the following file: