Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
WidgetGrid.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Mtf\Client\Locator;
11 
15 class WidgetGrid extends AbstractGrid
16 {
22  private $notEmptyOptionsSelector = 'option:not([value=""])';
23 
29  protected $editLink = 'tbody tr td.col-title';
30 
36  protected $firstRowSelector = '//tbody//tr[@data-role="row"]/td[contains(@class, "col-title")][1]';
37 
43  protected $filters = [
44  'title' => [
45  'selector' => 'input[name="title"]',
46  ],
47  'theme_id' => [
48  'selector' => 'select[name="theme_id"]',
49  'input' => 'select',
50  ],
51  ];
52 
58  public function getThemeIdValues()
59  {
60  $values = [];
61  $themeFilter = $this->filters['theme_id'];
62  $strategy = empty($themeFilter['strategy']) ? Locator::SELECTOR_CSS : $themeFilter['strategy'];
63  $element = $this->_rootElement->find($themeFilter['selector'], $strategy, $themeFilter['input']);
64  $options = $element->getElements($this->notEmptyOptionsSelector);
65  foreach ($options as $option) {
66  $values[] = $option->getText();
67  }
68 
69  return $values;
70  }
71 }
$values
Definition: options.phtml:88
$element
Definition: element.phtml:12