Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions e2e/gallery-drafts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ test("gallery retains complete unsaved projects and new scripts and offers confl
await page.getByRole("textbox", { name: "Project dependencies" }).fill("{}");
await page.getByRole("button", { name: "More actions", exact: true }).click();
await page.getByRole("menuitem", { name: "Versions", exact: true }).click();
await page.getByRole("menuitem", { name: /^Revision 1 ·/ }).click();
await page.getByRole("menuitemradio", { name: /^Revision 1 ·/ }).click();
await page.getByRole("button", { name: "Restore and deploy", exact: true }).waitFor();
expect(await client.innerText()).toBe("historical client");
expect(await page.locator(".live-data-note").innerText()).toContain("Historical code uses the current database and files and can change them");
await page.getByRole("button", { name: "More actions", exact: true }).click();
await page.getByRole("menuitem", { name: "Versions", exact: true }).click();
await page.getByRole("menuitem", { name: "Working copy", exact: true }).click();
await page.getByRole("menuitemradio", { name: "Working copy", exact: true }).click();
expect(await client.innerText()).toBe("unsaved client");
await page.getByRole("button", { name: "Save and deploy", exact: true }).click();
await page.getByRole("button", { name: "Compare saved project" }).waitFor();
Expand Down
12 changes: 10 additions & 2 deletions e2e/gallery-navigation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,24 @@ test("gallery filters, previews revisions, and preserves mobile library navigati
await screenshot(desktop, "gallery-desktop-source");
await desktop.getByRole("button", { name: "More actions", exact: true }).click();
await desktop.getByRole("menuitem", { name: "Versions", exact: true }).click();
await desktop.getByRole("menuitem", { name: /^Revision 1 ·/ }).click();
expect(await desktop.getByRole("menuitemradio", { name: "Working copy", exact: true }).getAttribute("aria-checked")).toBe("true");
await desktop.getByRole("menuitemradio", { name: /^Revision 1 ·/ }).click();
await desktop.getByRole("button", { name: "Restore and deploy", exact: true }).waitFor();
expect(await desktop.locator(".detail-header .revision-chip").innerText()).toStartWith("Revision 1");
await desktop.waitForFunction(() => document.querySelector('[role="textbox"][aria-label="Campaign overview.artifact.tsx"]')?.textContent?.includes("Campaign revision 1"));
expect(await source.getAttribute("aria-readonly")).toBe("true");
await desktop.getByRole("tablist", { name: "Artifact view" }).getByRole("tab", { name: "Preview", exact: true }).click();
await desktop.frameLocator('iframe[title="Preview of Campaign overview"]').getByRole("heading", { name: "Campaign revision 1" }).waitFor();
expect(new URL(await desktop.getByTitle("Preview of Campaign overview").getAttribute("src") ?? "", server.url).searchParams.get("version")).toBe("campaign-revision-1");
await screenshot(desktop, "gallery-desktop-revision");
await desktop.getByRole("button", { name: "More actions", exact: true }).click();
await desktop.getByRole("menuitem", { name: "Versions", exact: true }).click();
await desktop.getByRole("menuitem", { name: "Working copy", exact: true }).click();
expect(await desktop.getByRole("menuitemradio", { name: /^Revision 1 ·/ }).getAttribute("aria-checked")).toBe("true");
await desktop.getByRole("menuitemradio", { name: /^Revision 1 ·/ }).click();
await desktop.getByRole("menuitemradio", { name: /^Revision 1 ·/ }).waitFor({ state: "hidden" });
await desktop.getByRole("button", { name: "Return to working copy", exact: true }).click();
await desktop.frameLocator('iframe[title="Preview of Campaign overview"]').getByRole("heading", { name: "Campaign performance" }).waitFor();
expect(await desktop.locator(".detail-header .revision-chip").count()).toBe(0);
await desktop.getByRole("button", { name: "Share", exact: true }).click();
await desktop.getByRole("textbox", { name: "URL slug", exact: true }).fill("campaign-report");
expect(calls).toEqual([]);
Expand Down Expand Up @@ -234,6 +241,7 @@ test("gallery filters, previews revisions, and preserves mobile library navigati
await desktop.getByRole("button", { name: "More actions", exact: true }).click();
await desktop.getByRole("menuitem", { name: "Schedule", exact: true }).click();
await desktop.getByRole("status").filter({ hasText: /^Enabled$/ }).waitFor();
expect(await desktop.getByRole("tablist", { name: "Artifact view" }).getByRole("tab", { name: "Schedule", exact: true }).getAttribute("aria-selected")).toBe("true");
await desktop.getByText("Last result: succeeded", { exact: false }).waitFor();
expect(await desktop.getByLabel("Schedule headers").isVisible()).toBe(false);
expect(await desktop.getByLabel("Schedule path").inputValue()).toBe("/tick");
Expand Down
2 changes: 2 additions & 0 deletions e2e/gallery-secrets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ test("gallery exposes server secret names and writes for artifacts and scripts w
expect(calls.at(-1)).toEqual({ name: `${kind}_secrets`, arguments: { name, secrets: { TOKEN: "typed-fixture-value" } } });
if (kind === "artifact" && process.env.GALLERY_SCREENSHOT_DIR) await page.screenshot({ path: `${process.env.GALLERY_SCREENSHOT_DIR}/artifact-secrets.png`, fullPage: true });
await page.getByRole("button", { name: "Remove secret", exact: true }).click();
expect(calls.at(-1)!.arguments).toEqual({ name, secrets: { TOKEN: "typed-fixture-value" } });
await page.getByRole("button", { name: "Remove", exact: true }).click();
await page.getByText("Secret removed", { exact: true }).waitFor();
expect(calls.at(-1)).toEqual({ name: `${kind}_secrets`, arguments: { name, secrets: { TOKEN: null } } });
}
Expand Down
12 changes: 7 additions & 5 deletions e2e/gallery-transfer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ test("gallery imports a fresh complete project and exports its saved snapshot th
await page.getByRole("menuitem", { name: "Import project", exact: true }).click();
await page.getByLabel("Project archive", { exact: true }).setInputFiles({ name: "portable.artifact-project.json", mimeType: "application/json", buffer: Buffer.from(JSON.stringify(archive)) });
await page.waitForFunction(() => (document.querySelector('[aria-label="Imported project name"]') as HTMLInputElement)?.value === "portable-import");
expect(await page.getByText("Includes backend source", { exact: false }).innerText()).toContain("1 helper files");
await page.getByRole("button", { name: "Import as new project", exact: true }).click();
await page.getByRole("status").filter({ hasText: "Project imported." }).waitFor();
expect(await page.getByText("Includes backend source", { exact: false }).innerText()).toContain("1 helper file · 0 dependencies");
expect(await page.getByRole("heading", { level: 1 }).innerText()).toBe("Import project");
expect(await page.getByRole("tab").count()).toBe(0);
await page.getByRole("button", { name: "Import as new project", exact: true }).hover();
expect(await page.getByRole("button", { name: "Import as new project", exact: true }).evaluate(element => getComputedStyle(element).backgroundColor)).toBe("rgb(42, 39, 35)");
expect(await page.getByRole("heading", { level: 1 }).innerText()).toBe("portable-import");
if (process.env.GALLERY_SCREENSHOT_DIR) { await mkdir(process.env.GALLERY_SCREENSHOT_DIR, { recursive: true }); await page.screenshot({ path: join(process.env.GALLERY_SCREENSHOT_DIR, "gallery-project-import.png"), fullPage: true }); }
await page.getByRole("button", { name: "Close import", exact: true }).click();
await page.getByRole("button", { name: "Import as new project", exact: true }).click();
await page.getByRole("status").filter({ hasText: "Project imported." }).waitFor();
expect(await page.getByRole("heading", { level: 1 }).innerText()).toBe("portable-import");
expect(await page.getByRole("button", { name: "Import as new project", exact: true }).count()).toBe(0);
await page.getByRole("button", { name: "More actions", exact: true }).click();
const [download] = await Promise.all([page.waitForEvent("download"), page.getByRole("menuitem", { name: "Download", exact: true }).click()]);
expect(download.suggestedFilename()).toBe("portable-import.artifact-project.json");
Expand Down
Loading
Loading