* Focus the element. * @returns {Promise }
()
| 282 | * @returns {Promise<void>} |
| 283 | */ |
| 284 | async focus() { |
| 285 | switch (this.helperType) { |
| 286 | case 'playwright': |
| 287 | return this.element.focus() |
| 288 | case 'puppeteer': |
| 289 | if (this.element.focus) return this.element.focus() |
| 290 | return this.element.evaluate(el => el.focus()) |
| 291 | case 'webdriver': |
| 292 | return this.helper.executeScript(el => el.focus(), this.element) |
| 293 | default: |
| 294 | throw new Error(`Unsupported helper type: ${this.helperType}`) |
| 295 | } |
| 296 | } |
| 297 | |
| 298 | /** |
| 299 | * Type characters via the page/browser keyboard into the focused element. |
nothing calls this directly
no test coverage detected