import { test, expect } from "@playwright/test"; test("Microban actual WASM simplified PD stands, walks and turns without reset", async ({ page, }, testInfo) => { await page.goto("/e2e/fixtures/microban-probe.html"); await page.waitForFunction(() => window.probe || window.probeError); expect(await page.evaluate(() => window.probeError)).toBeUndefined(); const result = await page.evaluate(async () => { const p = window.probe, segments = []; for (const [name, seconds, vx, wz] of [ ["stand", 10, 0, 0], ["forward", 20, 0.15, 0], ["rest", 3, 0, 0], ["backward", 10, -0.1, 0], ["rest", 3, 0, 0], ["left", 10, 0, 0.6], ["rest", 3, 0, 0], ["right", 10, 0, -0.6], ]) { const before = p.state(); p.command.set([vx, 0, wz]); await p.step(seconds * 50); segments.push({ name, before, after: p.state() }); } return segments; }); await testInfo.attach("microban-probe.json", { body: JSON.stringify(result, null, 2), contentType: "application/json", }); const forward = result.find((s) => s.name === "forward"); expect(forward.after.pos[0] - forward.before.pos[0]).toBeGreaterThan(0.5); const backward = result.find((s) => s.name === "backward"); expect(backward.after.pos[0] - backward.before.pos[0]).toBeLessThan(-0.2); console.log(JSON.stringify(result)); });