From 1ecf4bbe78f2ee85c2404c3343b3d66a24dd2a8e Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Fri, 10 Apr 2026 12:26:04 +0200 Subject: [PATCH] Replace Save Draft button with reload in e2e tests --- tests/e2e/box-brush-authoring.e2e.ts | 2 +- tests/e2e/face-material-authoring.e2e.ts | 4 ++-- tests/e2e/first-room-workflow.e2e.ts | 11 +++-------- tests/e2e/import-draco-model-asset.e2e.ts | 3 +-- tests/e2e/import-model-asset.e2e.ts | 3 +-- tests/e2e/local-lights-and-background.e2e.ts | 3 +-- tests/e2e/world-environment.e2e.ts | 10 ++-------- 7 files changed, 11 insertions(+), 25 deletions(-) diff --git a/tests/e2e/box-brush-authoring.e2e.ts b/tests/e2e/box-brush-authoring.e2e.ts index b0853c99..9d44ec47 100644 --- a/tests/e2e/box-brush-authoring.e2e.ts +++ b/tests/e2e/box-brush-authoring.e2e.ts @@ -76,7 +76,7 @@ test("user can create a whitebox box with float transforms and keep it through r await page.getByTestId("selected-brush-name").press("Tab"); await expect(page.getByTestId("selected-brush-name")).toHaveValue("Entry Room"); - await page.getByRole("button", { name: "Save Draft" }).click(); + await page.waitForTimeout(400); await page.reload(); await expect(page.getByRole("button", { name: /^Entry Room$/ })).toBeVisible(); diff --git a/tests/e2e/face-material-authoring.e2e.ts b/tests/e2e/face-material-authoring.e2e.ts index 4c00f43a..3c8c8042 100644 --- a/tests/e2e/face-material-authoring.e2e.ts +++ b/tests/e2e/face-material-authoring.e2e.ts @@ -2,7 +2,7 @@ import { expect, test } from "@playwright/test"; import { beginBoxCreation, clickViewport } from "./viewport-test-helpers"; -test("user can assign a face material through the UI and keep it through a draft reload", async ({ page }) => { +test("user can assign a face material through the UI and keep it through an autosave reload", async ({ page }) => { const pageErrors: string[] = []; const consoleErrors: string[] = []; @@ -29,7 +29,7 @@ test("user can assign a face material through the UI and keep it through a draft await expect(page.getByTestId("selected-face-material-name")).toContainText("Amber Grid"); - await page.getByRole("button", { name: "Save Draft" }).click(); + await page.waitForTimeout(400); await page.reload(); await page.getByRole("button", { name: /Whitebox Box 1/ }).click(); diff --git a/tests/e2e/first-room-workflow.e2e.ts b/tests/e2e/first-room-workflow.e2e.ts index e6a248ca..db5be5a5 100644 --- a/tests/e2e/first-room-workflow.e2e.ts +++ b/tests/e2e/first-room-workflow.e2e.ts @@ -2,7 +2,7 @@ import { expect, test } from "@playwright/test"; import { beginBoxCreation, clickViewport, setViewportCreationPreview } from "./viewport-test-helpers"; -test("first-room workflow covers create, texture, save/load, and run", async ({ page }) => { +test("first-room workflow covers create, texture, autosave recovery, and run", async ({ page }) => { const pageErrors: string[] = []; const consoleErrors: string[] = []; @@ -45,13 +45,8 @@ test("first-room workflow covers create, texture, save/load, and run", async ({ await expect(page.getByTestId("status-run-preflight")).toContainText("Ready for First Person"); - await page.getByRole("button", { name: "Save Draft" }).click(); - await beginBoxCreation(page); - await clickViewport(page); - await expect(page.getByRole("button", { name: /Whitebox Box 2/ })).toBeVisible(); - - await page.getByRole("button", { name: "Load Draft" }).click(); - await expect(page.getByRole("button", { name: /Whitebox Box 2/ })).toHaveCount(0); + await page.waitForTimeout(400); + await page.reload(); await page.getByRole("button", { name: /Whitebox Box 1/ }).click(); await page.getByTestId("face-button-posZ").click(); diff --git a/tests/e2e/import-draco-model-asset.e2e.ts b/tests/e2e/import-draco-model-asset.e2e.ts index 157416c0..81a73f51 100644 --- a/tests/e2e/import-draco-model-asset.e2e.ts +++ b/tests/e2e/import-draco-model-asset.e2e.ts @@ -70,8 +70,7 @@ test("imports a draco-compressed glb asset, places an instance, and survives rel z: -88 }); - await page.getByRole("button", { name: "Save Draft" }).dispatchEvent("click"); - await expect(page.getByTestId("status-message")).toContainText("Local draft saved."); + await page.waitForTimeout(400); await page.reload(); diff --git a/tests/e2e/import-model-asset.e2e.ts b/tests/e2e/import-model-asset.e2e.ts index ac2dad75..ccd09ee6 100644 --- a/tests/e2e/import-model-asset.e2e.ts +++ b/tests/e2e/import-model-asset.e2e.ts @@ -108,8 +108,7 @@ test("imports a model asset, places an instance, and survives reload", async ({ z: -76 }); - await page.getByRole("button", { name: "Save Draft" }).dispatchEvent("click"); - await expect(page.getByTestId("status-message")).toContainText("Local draft saved."); + await page.waitForTimeout(400); await page.reload(); diff --git a/tests/e2e/local-lights-and-background.e2e.ts b/tests/e2e/local-lights-and-background.e2e.ts index 6c6fcf9b..dfc99c6c 100644 --- a/tests/e2e/local-lights-and-background.e2e.ts +++ b/tests/e2e/local-lights-and-background.e2e.ts @@ -65,8 +65,7 @@ test("local lights and background images persist through editor and runner flows await expect(page.locator('[data-testid^="outliner-entity-"]')).toHaveCount(2); - await page.getByRole("button", { name: "Save Draft" }).click(); - await expect(page.getByTestId("status-message")).toContainText("Local draft saved."); + await page.waitForTimeout(400); await page.reload(); diff --git a/tests/e2e/world-environment.e2e.ts b/tests/e2e/world-environment.e2e.ts index 41dff903..9a3924e4 100644 --- a/tests/e2e/world-environment.e2e.ts +++ b/tests/e2e/world-environment.e2e.ts @@ -44,14 +44,8 @@ test("world environment settings persist and carry into the runner", async ({ pa await expect(page.getByTestId("world-background-mode-value")).toContainText("Vertical Gradient"); await expect(page.getByTestId("viewport-canvas-topLeft")).toHaveCSS("background-image", /linear-gradient/); - await page.getByRole("button", { name: "Save Draft" }).click(); - - await page.getByTestId("world-background-mode-solid").click(); - await setColorInput(page.getByTestId("world-background-solid-color"), "#223344"); - await page.getByTestId("world-ambient-intensity").fill("0.9"); - await page.getByTestId("world-ambient-intensity").press("Tab"); - - await page.getByRole("button", { name: "Load Draft" }).click(); + await page.waitForTimeout(400); + await page.reload(); await expect(page.getByTestId("world-background-mode-value")).toContainText("Vertical Gradient"); await expect(page.getByTestId("world-ambient-intensity")).toHaveValue("0.45");