* Creates a condition that will wait for the given element's * webdriver.WebDriver#getText visible text to match a regular * expression. * * @param {!./webdriver.WebElement} element The element to test. * @param {!RegExp} regex The regular expression to test against. * @return {!WebEle
(element, regex)
| 400 | * @see webdriver.WebDriver#getText |
| 401 | */ |
| 402 | function elementTextMatches(element, regex) { |
| 403 | return new WebElementCondition('until element text matches', function () { |
| 404 | return element.getText().then((t) => (regex.test(t) ? element : null)) |
| 405 | }) |
| 406 | } |
| 407 | |
| 408 | // PUBLIC API |
| 409 |