Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
TrackingInfoTable.php
Go to the documentation of this file.
1 <?php
7 
8 use Magento\Mtf\Block\Block;
9 use Magento\Mtf\Client\Locator;
11 
15 class TrackingInfoTable extends Block
16 {
22  private $item = './/tfoot/tr[not(contains(@class,"no-display"))]';
23 
29  private $addButton = '[data-ui-id="shipment-tracking-save-button"]';
30 
36  public function addTrackingNumber(array $data)
37  {
38  $trackingItemBlock = $this->getTrackingNumberItem();
39  $trackingItemBlock->fillRow($data);
40 
41  $this->_rootElement->find($this->addButton)->click();
42  }
43 
49  private function getTrackingNumberItem()
50  {
51  return $this->blockFactory->create(
52  Item::class,
53  ['element' => $this->_rootElement->find($this->item, Locator::SELECTOR_XPATH)]
54  );
55  }
56 }