Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CompareLink.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Block\Block;
10 
14 class CompareLink extends Block
15 {
21  protected $qtyCompareProducts = '.compare .counter.qty';
22 
28  protected $linkCompareProducts = '[data-role="compare-products-link"] a.compare';
29 
35  public function getQtyInCompareList()
36  {
37  $this->waitForElementVisible($this->qtyCompareProducts);
38  $compareProductLink = $this->_rootElement->find($this->qtyCompareProducts);
39  preg_match_all('/^\d+/', $compareProductLink->getText(), $matches);
40  return $matches[0][0];
41  }
42 
48  public function waitForCompareProductsLinks()
49  {
50  $this->waitForElementVisible($this->linkCompareProducts);
51  }
52 }