Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
MagentoLoadingMasks.php
Go to the documentation of this file.
1 <?php
8 
9 use Facebook\WebDriver\Exception\NoSuchElementException;
10 use Facebook\WebDriver\Exception\StaleElementReferenceException;
12 use WebDriverBy;
13 
20 {
27  protected function doesMetricPass($value)
28  {
29  return $value === null;
30  }
31 
37  protected function fetchValueFromPage()
38  {
39  foreach (MagentoWebDriver::$loadingMasksLocators as $maskLocator) {
40  $driverLocator = WebDriverBy::xpath($maskLocator);
41  $maskElements = $this->getDriver()->webDriver->findElements($driverLocator);
42  foreach ($maskElements as $element) {
43  try {
44  if ($element->isDisplayed()) {
45  return "$maskLocator : " . $element ->getID();
46  }
47  } catch (NoSuchElementException $e) {
48  } catch (StaleElementReferenceException $e) {
49  }
50  }
51  }
52  return null;
53  }
54 }
$value
Definition: gender.phtml:16
$element
Definition: element.phtml:12