Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
BottomToolbar.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Block\Block;
10 use Magento\Mtf\Client\Locator;
11 
16 class BottomToolbar extends Block
17 {
23  private $nextPageSelector = '.item.current + .item a';
24 
30  private $firstPageSelector = '.item>.page';
31 
37  private $optionSelector = './/option';
38 
44  public function nextPage()
45  {
46  $nextPageItem = $this->_rootElement->find($this->nextPageSelector);
47  if ($nextPageItem->isVisible()) {
48  $nextPageItem->click();
49  return true;
50  }
51  return false;
52  }
53 
59  public function firstPage()
60  {
61  $firstPageItem = $this->_rootElement->find($this->firstPageSelector);
62  if ($firstPageItem->isVisible()) {
63  $firstPageItem->click();
64  return true;
65  }
66  return false;
67  }
68 
75  public function setLimiterValueByIndex($index)
76  {
77  $options = $this->_rootElement->getElements($this->optionSelector, Locator::SELECTOR_XPATH);
78  if (isset($options[$index])) {
79  $options[$index]->click();
80  }
81  return $this;
82  }
83 
90  public function getLimitedValueByIndex($index)
91  {
92  $options = $this->_rootElement->getElements($this->optionSelector, Locator::SELECTOR_XPATH);
93  if (isset($options[$index])) {
94  return $options[$index]->getValue();
95  }
96  return null;
97  }
98 }
$index
Definition: list.phtml:44