* {{> waitForClickable }}
(locator, waitTimeout)
| 2381 | * {{> waitForClickable }} |
| 2382 | */ |
| 2383 | async waitForClickable(locator, waitTimeout) { |
| 2384 | const el = await this._locateElement(locator) |
| 2385 | if (!el) { |
| 2386 | throw new ElementNotFound(locator, 'Element to wait for clickable') |
| 2387 | } |
| 2388 | |
| 2389 | return this.waitForFunction(isElementClickable, [el], waitTimeout).catch(async e => { |
| 2390 | if (/Waiting failed/i.test(e.message) || /failed: timeout/i.test(e.message)) { |
| 2391 | throw new Error(`element ${new Locator(locator).toString()} still not clickable after ${waitTimeout || this.options.waitForTimeout / 1000} sec`) |
| 2392 | } else { |
| 2393 | throw e |
| 2394 | } |
| 2395 | }) |
| 2396 | } |
| 2397 | |
| 2398 | /** |
| 2399 | * {{> waitForElement }} |
no test coverage detected