MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / waitForBackgroundComplete

Function waitForBackgroundComplete

e2e/background-script.spec.ts:73–86  ·  view source on GitHub ↗
(page: Page)

Source from the content-addressed store, hash-verified

71}
72
73async 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
88async function setBackgroundScriptEnabled(page: Page, enabled: boolean): Promise<void> {
89 const scriptSwitch = page.locator(".arco-switch").first();

Callers 1

Calls 1

Tested by

no test coverage detected