Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CartEmpty.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 CartEmpty extends Block
16 {
22  private $linkToMainPage = 'p a';
23 
29  private $messageText = 'p';
30 
36  public function getText()
37  {
38  $result = [];
39  foreach ($this->_rootElement->getElements($this->messageText) as $item) {
40  $result[] = str_replace("\n", ' ', $item->getText());
41  }
42 
43  return implode(' ', $result);
44  }
45 
51  public function clickLinkToMainPage()
52  {
53  $this->_rootElement->find($this->linkToMainPage)->click();
54  }
55 }