How to use the WebElementCondition function from selenium-webdriver

Find comprehensive JavaScript selenium-webdriver.WebElementCondition code examples handpicked from public code repositorys.

34
35
36
37
38
39
40
41
42

/* eslint-disable no-unused-vars */
function waitForVisibleElement (locator, t) {
  var timeout = t || 3000;
  var element = driver.wait(until.elementLocated(locator), timeout);
  return driver.wait(new webdriver.WebElementCondition('for element to be visible ' + locator, function () {
    return element.isDisplayed().then(x => x ? element : null);
  }), timeout);
}
fork icon395
star icon0
watch icon2

-3
fork icon17
star icon66
watch icon2

+ 3 other calls in file

72
73
74
75
76
77
78
79
80
    .then(res => res.every(Boolean))
  );
};

Query.prototype.untilOne = function (scope) {
  return new webdriver.WebElementCondition(`for ${this}`,
    driver => this.findOne(scope || driver).catch(() => null)
  );
};
fork icon0
star icon2
watch icon2