test: open drive settings for volume and pause in browser specs

This commit is contained in:
2026-10-10 23:57:15 +03:00
parent 6ac5e6f02e
commit 014d1c12dd
5 changed files with 23 additions and 10 deletions

View File

@@ -96,14 +96,15 @@ test("starts Web Audio synchronously from the visitor gesture and exposes access
await expect(page.getByRole("button", { name: "Mute sound" })).toBeVisible();
await expect(
page.getByRole("button", { name: "Sound volume" }),
page.getByRole("button", { name: "Drive settings" }),
).toBeVisible();
// Volume and Pause motion live inside the settings panel since round 5.
await page.getByRole("button", { name: "Drive settings" }).click();
await expect(page.getByLabel("Sound volume level")).toBeVisible();
await expect(
page.getByRole("button", { name: "Pause motion" }),
).toBeVisible();
await expect(
page.getByRole("button", { name: "Drive settings" }),
).toBeVisible();
await page.keyboard.press("Escape");
await expect
.poll(() =>
page.evaluate(
@@ -194,7 +195,7 @@ test("persists native volume and keeps sound independent from Static motion", as
await page.goto(distUrl, { waitUntil: "domcontentloaded" });
await page.getByRole("button", { name: "Play soundtrack" }).click();
await page.getByRole("button", { name: "Sound volume" }).click();
await page.getByRole("button", { name: "Drive settings" }).click();
const volume = page.getByLabel("Sound volume level");
await volume.fill("0.65");
await expect(volume).toHaveValue("0.65");
@@ -204,15 +205,14 @@ test("persists native volume and keeps sound independent from Static motion", as
)
.toBe("0.65");
await page.getByRole("button", { name: "Drive settings" }).click();
await page.getByLabel("Quality control").selectOption("static");
await expect(page.getByRole("button", { name: "Unmute sound" })).toHaveCount(
0,
);
await expect(page.getByRole("button", { name: "Mute sound" })).toBeVisible();
await expect(volume).toHaveCount(0);
await page.getByRole("button", { name: "Sound volume" }).click();
// The volume slider shares the open settings panel with Quality.
await expect(volume).toBeVisible();
await expect(volume).toHaveValue("0.65");
});
test("requires a direct visitor action after browser interruption without creating another graph", async ({
@@ -235,6 +235,13 @@ test("requires a direct visitor action after browser interruption without creati
await expect(
page.getByRole("button", { name: "Resume sound" }),
).toBeVisible();
// Resume and Mute share one bay slot, so Mute returns only once the context
// reports running again: lift the synthetic "interrupted" state first.
await page.evaluate(() => {
const context = (window as unknown as { __audioContexts: AudioContext[] })
.__audioContexts[0];
if (context) delete (context as unknown as { state?: string }).state;
});
await page.getByRole("button", { name: "Resume sound" }).click();
await expect(page.getByRole("button", { name: "Mute sound" })).toBeVisible();
await expect

View File

@@ -58,7 +58,9 @@ test("persisted lifecycle events preserve paused and Static states without dupli
);
await page.getByRole("button", { name: "Play soundtrack" }).click();
await page.getByRole("button", { name: "Drive settings" }).click();
await page.getByRole("button", { name: "Pause motion" }).click();
await page.keyboard.press("Escape");
await dispatchPersistedPageTransition(page, "pagehide");
await dispatchPersistedPageTransition(page, "pageshow");
await expect(page.locator(".journey-canvas")).toHaveCount(1);

View File

@@ -151,6 +151,7 @@ test("provides native motion and quality controls with visible state", async ({
await expect(page.getByRole("status")).toHaveCount(0);
await page.keyboard.press("Escape");
await page.getByRole("button", { name: "Play soundtrack" }).click();
await page.getByRole("button", { name: "Drive settings" }).click();
await expect(
page.getByRole("button", { name: "Pause motion" }),
).toBeVisible();
@@ -161,6 +162,7 @@ test("provides native motion and quality controls with visible state", async ({
.getAttribute("data-scene-generation");
await page.getByRole("button", { name: "Pause motion" }).click();
await page.keyboard.press("Escape");
await expect(
page.getByRole("button", { name: "Resume motion" }),
).toBeVisible();
@@ -174,9 +176,11 @@ test("provides native motion and quality controls with visible state", async ({
);
await page.getByRole("button", { name: "Resume motion" }).click();
await page.getByRole("button", { name: "Drive settings" }).click();
await expect(
page.getByRole("button", { name: "Pause motion" }),
).toBeVisible();
await page.keyboard.press("Escape");
await expect(canvas).toHaveCount(1);
await expect(page.locator(".journey-world")).toHaveAttribute(
"data-scene-generation",

View File

@@ -410,7 +410,7 @@ test.describe("production visual composition", () => {
await expect(
page.getByRole("button", { name: "Mute sound" }),
).toBeVisible();
await page.getByRole("button", { name: "Sound volume" }).click();
await page.getByRole("button", { name: "Drive settings" }).click();
await expect(page.getByLabel("Sound volume level")).toHaveValue("0.4");
await captureViewport(page, testInfo, "visual-audio-running");
});