( el: string | ElementHandle | Locator, )
| 119 | } |
| 120 | |
| 121 | export async function getBg( |
| 122 | el: string | ElementHandle | Locator, |
| 123 | ): Promise<string> { |
| 124 | el = await toEl(el) |
| 125 | return el.evaluate((el) => getComputedStyle(el as Element).backgroundImage) |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * Unlike `getBg`, this function returns the raw value of the `background-image` CSS property. |