コード例 #1
0
 /**
  * @return bool
  * @throws WebDriverException
  */
 public function isDisplayed()
 {
     try {
         return $this->element->isDisplayed();
     } catch (WebDriverException $exception) {
         $this->dispatchOnException($exception);
     }
 }
コード例 #2
0
ファイル: ExpectedCondition.php プロジェクト: magium/magium
 public static function elementRemoved(WebDriverElement $element)
 {
     return new WebDriverExpectedCondition(function () use($element) {
         try {
             $element->isDisplayed();
             return false;
         } catch (\Exception $e) {
             return true;
         }
     });
 }
コード例 #3
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;
     });
 }
コード例 #4
0
ファイル: WebDriver.php プロジェクト: magium/magium
 public function elementAttached(WebDriverElement $element)
 {
     try {
         $element->isDisplayed();
         return true;
     } catch (\Exception $e) {
         return false;
     }
 }