( el: string | ElementHandle | Locator, )
| 95 | } |
| 96 | |
| 97 | async function toEl( |
| 98 | el: string | ElementHandle | Locator, |
| 99 | ): Promise<ElementHandle> { |
| 100 | if (typeof el === 'string') { |
| 101 | const realEl = await page.$(el) |
| 102 | if (realEl == null) { |
| 103 | throw new Error(`Cannot find element: "${el}"`) |
| 104 | } |
| 105 | return realEl |
| 106 | } |
| 107 | if ('elementHandle' in el) { |
| 108 | return el.elementHandle() |
| 109 | } |
| 110 | return el |
| 111 | } |
| 112 | |
| 113 | export async function getColor( |
| 114 | el: string | ElementHandle | Locator, |
no outgoing calls
no test coverage detected