* Creates a condition that will wait for the given element's * webdriver.WebDriver#getText visible text to contain the given * substring. * * @param {!./webdriver.WebElement} element The element to test. * @param {string} substr The substring to search for. * @return {!WebElementCondit
(element, substr)
| 384 | * @see webdriver.WebDriver#getText |
| 385 | */ |
| 386 | function elementTextContains(element, substr) { |
| 387 | return new WebElementCondition('until element text contains', function () { |
| 388 | return element.getText().then((t) => (t.indexOf(substr) != -1 ? element : null)) |
| 389 | }) |
| 390 | } |
| 391 | |
| 392 | /** |
| 393 | * Creates a condition that will wait for the given element's |