test(web): record physics manifest playback evidence
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -75,6 +75,24 @@ try {
|
||||
await page.waitForTimeout(1500);
|
||||
log("mass", JSON.stringify(await physicsState()));
|
||||
}
|
||||
const manifest = page.locator('[data-testid="physics-simulation-manifest"]').first();
|
||||
await manifest.waitFor({ timeout: 30_000 });
|
||||
const manifestInfo = async () => page.evaluate(() => {
|
||||
const fieldset = document.querySelector('[data-testid="physics-simulation-manifest"]');
|
||||
return {
|
||||
output: fieldset?.querySelector('output')?.textContent ?? null,
|
||||
buttons: Array.from(fieldset?.querySelectorAll('button') ?? []).map((button) => ({ text: button.textContent, disabled: button.hasAttribute('disabled') })),
|
||||
frame: document.querySelector('input[aria-label="当前帧"]')?.value ?? null,
|
||||
status: document.querySelector('[data-testid="engine-status"]')?.textContent ?? "",
|
||||
};
|
||||
});
|
||||
log("manifest", JSON.stringify(await manifestInfo()));
|
||||
await manifest.getByRole("button", { name: "播放", exact: true }).evaluate((element) => element.click());
|
||||
await page.waitForTimeout(2500);
|
||||
log("playing", JSON.stringify(await manifestInfo()));
|
||||
await manifest.getByRole("button", { name: "暂停", exact: true }).evaluate((element) => element.click());
|
||||
await page.waitForTimeout(1000);
|
||||
log("paused", JSON.stringify(await manifestInfo()));
|
||||
} catch (error) {
|
||||
log("probe error", error instanceof Error ? error.message : String(error));
|
||||
log("state", JSON.stringify(await physicsState().catch(() => null)));
|
||||
|
||||
Reference in New Issue
Block a user