Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ActionsToolbar.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Block\Block;
10 use Magento\Mtf\Client\Locator;
11 
15 class ActionsToolbar extends Block
16 {
22  protected $linkSelector = './/a[contains(@class, "action")]//span[contains(text(), "%s")]';
23 
30  public function clickLink($linkName)
31  {
32  $link = $this->_rootElement->find(sprintf($this->linkSelector, $linkName), Locator::SELECTOR_XPATH);
33  if (!$link->isVisible()) {
34  throw new \Exception(sprintf('"%s" link is not visible', $linkName));
35  }
36  $link->click();
37  }
38 }