Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Readiness.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Block\Block;
10 use Magento\Mtf\Client\Locator;
11 use Magento\Setup\Test\Fixture\Extension;
12 
16 class Readiness extends Block
17 {
23  protected $readinessCheck = "[ng-click*='state.go']";
24 
30  protected $next = "[ng-click*='next']";
31 
37  protected $tryAgain = "[ng-click*='forceReload']";
38 
44  protected $removeExtension = '//li[contains(text(), \'%s\')]//button';
45 
51  protected $removeExtensionButtonOnModal = "[ng-click*='removeExtension']";
52 
58  protected $popupRemoveModal = '.modal-popup';
59 
65  protected $completedMessage = '[ng-switch-when="true"]';
66 
72  protected $updaterApplicationCheck = '#updater-application';
73 
79  protected $cronScriptCheck = '#cron-script';
80 
86  protected $dependencyCheck = '#component-dependency';
87 
93  protected $phpVersionCheck = '#php-version';
94 
100  protected $phpSettingsCheck = '#php-settings';
101 
107  protected $phpExtensionCheck = '#php-extensions';
108 
114  public function clickReadinessCheck()
115  {
116  $this->_rootElement->find($this->readinessCheck, Locator::SELECTOR_CSS)->click();
117  $this->waitForElementVisible($this->completedMessage, Locator::SELECTOR_CSS);
118  }
119 
125  public function clickNext()
126  {
127  $this->_rootElement->find($this->next, Locator::SELECTOR_CSS)->click();
128  }
129 
135  public function clickTryAgain()
136  {
137  $this->_rootElement->find($this->tryAgain, Locator::SELECTOR_CSS)->click();
138  $this->waitForElementVisible($this->completedMessage, Locator::SELECTOR_CSS);
139  }
140 
147  public function clickRemoveExtension(Extension $extension)
148  {
149  $removeExtension = sprintf($this->removeExtension, $extension->getExtensionName());
150 
151  $this->_rootElement->find($removeExtension, Locator::SELECTOR_XPATH)->click();
152  }
153 
159  public function clickRemoveExtensionOnModal()
160  {
161  $this->_rootElement->find($this->removeExtensionButtonOnModal, Locator::SELECTOR_CSS)->click();
162  $this->waitForElementNotVisible($this->popupRemoveModal, Locator::SELECTOR_CSS);
163  }
164 
170  public function getUpdaterApplicationCheck()
171  {
172  return $this->_rootElement->find($this->updaterApplicationCheck, Locator::SELECTOR_CSS)->getText();
173  }
174 
180  public function getCronScriptCheck()
181  {
182  return $this->_rootElement->find($this->cronScriptCheck, Locator::SELECTOR_CSS)->getText();
183  }
184 
190  public function getDependencyCheck()
191  {
192  return $this->_rootElement->find($this->dependencyCheck, Locator::SELECTOR_CSS)->getText();
193  }
194 
198  public function isPhpVersionCheckVisible() : bool
199  {
200  return $this->_rootElement->find($this->phpVersionCheck)->isVisible();
201  }
202 
208  public function getPhpVersionCheck()
209  {
210  return $this->_rootElement->find($this->phpVersionCheck, Locator::SELECTOR_CSS)->getText();
211  }
212 
218  public function getSettingsCheck()
219  {
220  return $this->_rootElement->find($this->phpSettingsCheck, Locator::SELECTOR_CSS)->getText();
221  }
222 
228  public function getPhpExtensionsCheck()
229  {
230  return $this->_rootElement->find($this->phpExtensionCheck, Locator::SELECTOR_CSS)->getText();
231  }
232 }
clickRemoveExtension(Extension $extension)
Definition: Readiness.php:147