Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Modal.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Block\Block;
10 
14 class Modal extends Block
15 {
21  protected $acceptButtonSelector = '.action-accept';
22 
28  protected $dismissButtonSelector = '.action-dismiss';
29 
35  protected $closeButtonSelector = '.action-close';
36 
42  protected $inputFieldSelector = '[data-role="promptField"]';
43 
49  protected $acceptWarningSelector = '.action-primary';
50 
56  protected $dismissWarningSelector = '.action-secondary';
57 
63  protected $modalOverlay = '.modals-overlay';
64 
70  protected $loadingMask = '[data-role="loader"]';
71 
77  public function acceptAlert()
78  {
80  $this->_rootElement->find($this->acceptButtonSelector)->click();
81  }
82 
88  public function acceptWarning()
89  {
91  $this->_rootElement->find($this->acceptWarningSelector)->click();
92  $this->waitForElementNotVisible($this->loadingMask);
93  }
94 
100  public function dismissWarning()
101  {
103  $this->_rootElement->find($this->dismissWarningSelector)->click();
104  $this->waitForElementNotVisible($this->loadingMask);
105  }
106 
112  public function dismissAlert()
113  {
115  $this->_rootElement->find($this->dismissButtonSelector)->click();
116  }
117 
123  public function closeAlert()
124  {
126  $this->_rootElement->find($this->closeButtonSelector)->click();
127  }
128 
134  public function getAlertText()
135  {
137  return $this->_rootElement->find($this->inputFieldSelector)->getValue();
138  }
139 
146  public function setAlertText($text)
147  {
149  $this->_rootElement->find($this->inputFieldSelector)->setValue($text);
150  }
151 
157  public function waitModalWindowToDisappear()
158  {
159  $this->browser->waitUntil(
160  function () {
161  return $this->browser->find($this->modalOverlay)->isVisible() == false ? true : null;
162  }
163  );
164  }
165 
172  protected function waitModalAnimationFinished()
173  {
174  usleep(500000);
175  }
176 }
endifif( $block->getLastPageNum()>1)( 'Page') ?></strong >< ul class $text
Definition: pager.phtml:43