コード例 #1
0
 /**
  * @return bool
  * @throws WebDriverException
  */
 public function isDisplayed() {
   try {
     return $this->element->isDisplayed();
   } catch (WebDriverException $exception) {
     $this->dispatchOnException($exception);
   }
 }
コード例 #2
0
 /**
  * An expectation for checking that an element, known to be present on the DOM
  * of a page, is visible. Visibility means that the element is not only
  * displayed but also has a height and width that is greater than 0.
  *
  * @param WebDriverElement $element The element to be checked.
  * @return WebDriverExpectedCondition<WebDriverElement> The same
  *         WebDriverElement once it is visible.
  */
 public static function visibilityOf(WebDriverElement $element)
 {
     return new WebDriverExpectedCondition(function ($driver) use($element) {
         return $element->isDisplayed() ? $element : null;
     });
 }