/**
  * Delete Widget Entity test.
  *
  * @param Widget $widget
  * @return void
  */
 public function test(Widget $widget)
 {
     // Precondition
     $widget->persist();
     // Steps
     $filter = ['title' => $widget->getTitle()];
     $this->widgetInstanceIndex->open();
     $this->widgetInstanceIndex->getWidgetGrid()->searchAndOpen($filter);
     $this->widgetInstanceEdit->getPageActionsBlock()->delete();
 }
 /**
  * Delete Widget on backend
  *
  * @return array
  */
 public function run()
 {
     $this->widgetInstanceIndex->open();
     $this->widgetInstanceIndex->getWidgetGrid()->resetFilter();
     while ($this->widgetInstanceIndex->getWidgetGrid()->isFirstRowVisible()) {
         $this->widgetInstanceIndex->getWidgetGrid()->openFirstRow();
         $this->widgetInstanceEdit->getTemplateBlock()->waitLoader();
         $this->widgetInstanceEdit->getPageActionsBlock()->delete();
         $this->widgetInstanceIndex->getSystemMessageDialog()->closePopup();
     }
 }
 /**
  * Assert widget availability in widget grid
  *
  * @param Widget $widget
  * @param WidgetInstanceIndex $widgetInstanceIndex
  * @return void
  */
 public function processAssert(Widget $widget, WidgetInstanceIndex $widgetInstanceIndex)
 {
     $filter = ['title' => $widget->getTitle()];
     $widgetInstanceIndex->open();
     \PHPUnit_Framework_Assert::assertTrue($widgetInstanceIndex->getWidgetGrid()->isRowVisible($filter), 'Widget with title \'' . $widget->getTitle() . '\' is absent in Widget grid.');
 }