Skip to content

Commit 97eaf63

Browse files
committed
test(e2e): confirm the Save name prompt before awaiting the download
#458 made Save prompt for a file name (via a dialog) in browsers without the File System Access picker — which these specs delete in addInitScript. The save-and-reopen specs clicked Project → Save and waited for a download that never fired, because the name-prompt dialog now intercepts the save, so both tests hit the 60s timeout (failing on main too). Accept the pre-filled default name and confirm the dialog so the download proceeds.
1 parent 115e8dd commit 97eaf63

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

e2e/layer-groups.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ test("groups a layer and persists the folder across save and reopen", async ({
8181
const downloadPromise = page.waitForEvent("download");
8282
await page.getByRole("button", { name: "Project" }).click();
8383
await page.getByRole("menuitem", { name: "Save", exact: true }).click();
84+
// Browsers without the File System Access picker (deleted above) prompt for a
85+
// file name before downloading; accept the pre-filled default and confirm.
86+
await page
87+
.getByRole("dialog")
88+
.getByRole("button", { name: "Save", exact: true })
89+
.click();
8490
const download = await downloadPromise;
8591
const stream = await download.createReadStream();
8692
const chunks: Buffer[] = [];

e2e/storymap.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ test("persists a story map across save and reopen", async ({ page }) => {
5151
const downloadPromise = page.waitForEvent("download");
5252
await page.getByRole("button", { name: "Project" }).click();
5353
await page.getByRole("menuitem", { name: "Save", exact: true }).click();
54+
// Browsers without the File System Access picker (deleted above) prompt for a
55+
// file name before downloading; accept the pre-filled default and confirm.
56+
await page
57+
.getByRole("dialog")
58+
.getByRole("button", { name: "Save", exact: true })
59+
.click();
5460
const download = await downloadPromise;
5561
const downloadPath = await download.path();
5662
expect(downloadPath).toBeTruthy();

0 commit comments

Comments
 (0)