* Creates a condition that will wait for the given element to become stale. An * element is considered stale once it is removed from the DOM, or a new page * has loaded. * * @param {!./webdriver.WebElement} element The element that should become stale. * @return {!Condition } The new co
(element)
| 264 | * @return {!Condition<boolean>} The new condition. |
| 265 | */ |
| 266 | function stalenessOf(element) { |
| 267 | return new Condition('element to become stale', function () { |
| 268 | return element.getTagName().then( |
| 269 | function () { |
| 270 | return false |
| 271 | }, |
| 272 | function (e) { |
| 273 | if (e instanceof error.StaleElementReferenceError) { |
| 274 | return true |
| 275 | } |
| 276 | throw e |
| 277 | }, |
| 278 | ) |
| 279 | }) |
| 280 | } |
| 281 | |
| 282 | /** |
| 283 | * Creates a condition that will wait for the given element to become visible. |
nothing calls this directly
no test coverage detected