(page: Page, enabled: boolean)
| 86 | } |
| 87 | |
| 88 | async function setBackgroundScriptEnabled(page: Page, enabled: boolean): Promise<void> { |
| 89 | const scriptSwitch = page.locator(".arco-switch").first(); |
| 90 | await expect(scriptSwitch).toBeVisible({ timeout: 10_000 }); |
| 91 | if ((await scriptSwitch.getAttribute("aria-checked")) === String(enabled)) return; |
| 92 | |
| 93 | await scriptSwitch.click(); |
| 94 | await expect(scriptSwitch).toHaveAttribute("aria-checked", String(enabled), { timeout: 10_000 }); |
| 95 | } |
| 96 | |
| 97 | async function readBackgroundDiagnostics(page: Page): Promise<any> { |
| 98 | return page.evaluate(() => { |
no test coverage detected