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

Function createScriptAndGoToList

e2e/script-management.spec.ts:8–23  ·  view source on GitHub ↗

* Helper: create a script via the editor, then open the options page.

(context: BrowserContext, extensionId: string)

Source from the content-addressed store, hash-verified

6 * Helper: create a script via the editor, then open the options page.
7 */
8async function createScriptAndGoToList(context: BrowserContext, extensionId: string): Promise<Page> {
9 const editorPage = await openEditorPage(context, extensionId);
10
11 // Wait for Monaco editor
12 await expect(editorPage.locator(".monaco-editor")).toBeVisible({ timeout: 10_000 });
13 await expect(editorPage.locator(".view-lines")).toContainText("==UserScript==", {
14 timeout: 10_000,
15 });
16
17 await saveCurrentEditor(context, extensionId, editorPage);
18
19 // Open the options page (script list)
20 const page = await openOptionsPage(context, extensionId);
21
22 return page;
23}
24
25test.describe("Script Management", () => {
26 test("should create a script and see it in the list", async ({ context, extensionId }) => {

Callers 1

Calls 3

openEditorPageFunction · 0.90
saveCurrentEditorFunction · 0.90
openOptionsPageFunction · 0.90

Tested by

no test coverage detected