/** * Fill store view. * * @param Widget $widget * @return void */ protected function fillStoreView(Widget $widget) { $this->openTab('frontend_properties'); $storeViewField = $this->_rootElement->find($this->storeView, Locator::SELECTOR_CSS, 'multiselectgrouplist'); if ($storeViewField->isVisible() && !$widget->hasData('store_ids')) { $storeViewField->setValue('All Store Views'); } }
/** * Click to widget selector. * * @param Widget $widget * @param string $widgetText * @return void * @throws \Exception */ public function clickToWidget(Widget $widget, $widgetText) { $widgetType = $widget->getWidgetOptions()['type_id']; if ($this->hasRender($widgetType)) { $this->callRender($widgetType, 'clickToWidget', ['widget' => $widget, 'widgetText' => $widgetText]); } else { if (isset($this->widgetSelectors[$widgetType])) { $this->_rootElement->find(sprintf($this->widgetSelectors[$widgetType], $widgetText), Locator::SELECTOR_XPATH)->click(); } else { throw new \Exception('Determine how to find the widget on the page.'); } } }
/** * Assert widget availability in widget grid. * * @param Widget $widget * @param WidgetInstanceIndex $widgetInstanceIndex * @return void */ public function processAssert(Widget $widget, WidgetInstanceIndex $widgetInstanceIndex) { $widgetInstanceIndex->open(); $widgetTitle = $widget->getTitle(); \PHPUnit_Framework_Assert::assertTrue($widgetInstanceIndex->getWidgetGrid()->isRowVisible(['title' => $widgetTitle]), "Widget with title {$widgetTitle} is absent in Widget grid."); }