Files
VibemakerSandbox/app/e2e/deployment.spec.js
T
chenlin fc5ee4f2c6 feat: release v0.2 multi-robot simulator
Add declarative robot packages, shared simulation lifecycle and Microban ONNX/PD walking with independent head control.

Unify comic UI and chase camera; default robot packages to a 4.5m arena with real collision walls. Include regression tests, asset provenance/licenses and verification evidence.
2026-10-28 14:00:26 +08:00

43 lines
1.6 KiB
JavaScript

import { test, expect } from "@playwright/test";
test.use({ video: { mode: "on", size: { width: 1280, height: 800 } } });
test("deployed assets respect the base path and both Robot Packages boot", async ({
page,
}, info) => {
const failures = [],
errors = [],
requests = [];
page.on("pageerror", (e) => errors.push(e.message));
page.on("response", (r) => {
if (
r.status() >= 400 &&
new URL(r.url()).origin === new URL(page.url()).origin
)
failures.push(`${r.status()} ${r.url()}`);
});
page.on("request", (r) => requests.push(r.url()));
const prefix = process.env.DEPLOY_PATH || "/";
await page.goto(prefix);
await expect(
page.getByRole("button", { name: "Pause", exact: true }),
).toBeEnabled();
await page.waitForTimeout(500); // capture after the ball's existing appear FX
await page.screenshot({ path: info.outputPath("microduck.png") });
await page.getByLabel("Robot", { exact: true }).selectOption("microban");
await expect
.poll(() => page.evaluate(() => window.__store.getState().robotId))
.toBe("microban");
await expect(page.getByRole("status")).toContainText("Simplified actuation");
await page.waitForTimeout(500);
await page.screenshot({ path: info.outputPath("microban.png") });
expect(errors).toEqual([]);
expect(failures).toEqual([]);
const origin = new URL(page.url()).origin;
expect(requests.filter((url) => new URL(url).origin !== origin)).toEqual([]);
expect(
requests.filter(
(url) =>
url.startsWith(origin) && !new URL(url).pathname.startsWith(prefix),
),
).toEqual([]);
});