Ejemplo n.º 1
0
 /**
  * An expectation for checking that an element, not known to be present on the DOM
  *
  * @param WebDriverBy $by The element to be checked.
  * @param WebDriverElement $parentElement The element to be under.
  * @return CustomExpectedCondition<bool> true when element not 
  *         present in DOM.
  */
 public static function elementDestroyed(WebDriverBy $by, RemoteWebElement $parentElement = null)
 {
     return new CustomExpectedCondition(function ($driver) use($element) {
         $els = $parentElement ? $parentElement->findElements($by) : $driver->findElements($by);
         return count($els) === 0;
     });
 }
Ejemplo n.º 2
0
 /**
  * Shorter version of webDriver->findElement
  */
 static function find($cssSelector, \RemoteWebElement $parentElement = null)
 {
     return $parentElement ? $parentElement->findElement(\WebDriverBy::cssSelector($cssSelector)) : WebDriver::instance()->findElement(\WebDriverBy::cssSelector($cssSelector));
 }
Ejemplo n.º 3
0
 /**
  * Simulate typing ENTER into an element
  * @param RemoteWebElement $remoteWebElement the element or the element Id
  */
 public function sendEnter($remoteWebElement)
 {
     if ($remoteWebElement instanceof RemoteWebElement) {
         $remoteWebElement->sendKeys("");
     } elseif (is_string($remoteWebElement)) {
         $this->sendEnter($this->getElementById($remoteWebElement));
     }
 }
 /**
  * переход на страницу продукта
  * @param  RemoteWebElement $product
  * @return Page_Product
  */
 public function click_product(RemoteWebElement $product)
 {
     $product->click();
     return new Page_Product($this->web_driver);
 }