(page: Page)
| 71 | } |
| 72 | |
| 73 | async function waitForBackgroundComplete(page: Page): Promise<BackgroundScriptState | null> { |
| 74 | const matched = await expect |
| 75 | .poll(() => readBackgroundScriptState(page), { |
| 76 | timeout: 20_000, |
| 77 | intervals: [100, 250, 500, 1_000], |
| 78 | }) |
| 79 | .toMatchObject({ |
| 80 | status: 1, |
| 81 | runStatus: "complete", |
| 82 | }) |
| 83 | .then(() => true) |
| 84 | .catch(() => false); |
| 85 | return matched ? readBackgroundScriptState(page) : null; |
| 86 | } |
| 87 | |
| 88 | async function setBackgroundScriptEnabled(page: Page, enabled: boolean): Promise<void> { |
| 89 | const scriptSwitch = page.locator(".arco-switch").first(); |
no test coverage detected