Luigit
repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by admin

extensions/canvas/__e2e__/README.md

Raw
Rendered preview

Canvas browser verification

Run the documented canvas e2e Mise task on a host supported by the installed Playwright build. The current upstream Playwright build rejects Android before executing tests; this is a runner limitation, not a passing suite. Do not patch dependencies or spoof the platform to hide that limitation.

The canvas browser-fixture Mise task serves an isolated real-Pi session for direct Chrome CDP or Firefox BiDi verification, with a ten-minute lifetime. Its ready JSON record provides the ephemeral URL; closed reports provider calls and extension errors. It uses scripted provider responses, not a comprehension evaluation. Normal mode acknowledges finished observations after a brief simulated model delay.

Set CANVAS_FIXTURE_NATIVE_EDITS=1 for native-edit verification using the same task. Draw one standalone, auto-sizing text shape, preferably center-aligned. The first completed observation drives real canvas inspect and canvas draw tool calls to move it by (120, 40). Undo and redo that move through the native editor; the next observation relabels it to Clear shared idea without changing position or alignment. Undo and redo the relabel; the next observation deletes the text. Undo must restore it and redo must remove it again. After those three operations the fixture performs no further drawing changes. The mode is test-fixture-only and does not change extension configuration.

The layout-proof Mise task runs native Chromium proofs without Playwright and owns all temporary processes and profiles. These browser-launching tests are opt-in through the task, not part of ordinary test execution. The task uses one worker, disables file parallelism, and keeps browser instances sequential to bound memory. It verifies native text and Mermaid generation with zero editor connections, persisted commits, stale-revision rejection during worker startup, and branch cancellation. It also freezes a real viewer, commits two agent transactions while that viewer cannot run, resumes it, and verifies two separate native Undo/Redo steps. A second interleaving holds an unsent local edit while another writer changes shared state; the resumed viewer must preserve its draft, show a conflict, and download the local drawing rather than the foreign update. These tests use the generated canvas package and direct CDP with foreground emulation, not a dependency patch or platform spoof. They do not prove every Android browser's lifecycle-event behavior.

Set CANVAS_FIXTURE_CATCHUP=1 with browser-fixture for manual catch-up investigation. After drawing one standalone text shape, freeze the viewer before the observation is processed. The scripted Pi provider makes two server-owned moves and reports Catch-up commits ready. without waiting for the viewer. Resume the viewer with visible/focused lifecycle state, verify automatic resync, then verify each move can be undone and redone separately. If using headless Chrome, explicit focus emulation may be needed because a thawed page can still report document.visibilityState === "hidden".

There is no browser commit HTTP response to delay anymore. Do not interpret server state alone as proof that the editor applied a drawing. Verify rendered pixels and native Undo/Redo, then stop the fixture explicitly.

Additional contracts cover active typing persisting without agent replies, final text plus same-revision imagery after blur, full-scene exports including off-screen elements without viewport changes, save conflicts, stale revisions, recovery, sharing retries, and multi-tab safety. A focused direct-browser check does not replace the full Playwright suite; report their results separately.

# Canvas browser verification

Run the documented canvas `e2e` Mise task on a host supported by the installed Playwright build.
The current upstream Playwright build rejects Android before executing tests; this is a runner limitation, not a passing suite.
Do not patch dependencies or spoof the platform to hide that limitation.

The canvas `browser-fixture` Mise task serves an isolated real-Pi session for direct Chrome CDP or Firefox BiDi verification, with a ten-minute lifetime.
Its `ready` JSON record provides the ephemeral URL; `closed` reports provider calls and extension errors.
It uses scripted provider responses, not a comprehension evaluation.
Normal mode acknowledges finished observations after a brief simulated model delay.

Set `CANVAS_FIXTURE_NATIVE_EDITS=1` for native-edit verification using the same task.
Draw one standalone, auto-sizing text shape, preferably center-aligned.
The first completed observation drives real `canvas inspect` and `canvas draw` tool calls to move it by `(120, 40)`.
Undo and redo that move through the native editor; the next observation relabels it to `Clear shared idea` without changing position or alignment.
Undo and redo the relabel; the next observation deletes the text.
Undo must restore it and redo must remove it again.
After those three operations the fixture performs no further drawing changes.
The mode is test-fixture-only and does not change extension configuration.

The `layout-proof` Mise task runs native Chromium proofs without Playwright and owns all temporary processes and profiles.
These browser-launching tests are opt-in through the task, not part of ordinary test execution.
The task uses one worker, disables file parallelism, and keeps browser instances sequential to bound memory.
It verifies native text and Mermaid generation with zero editor connections, persisted commits, stale-revision rejection during worker startup, and branch cancellation.
It also freezes a real viewer, commits two agent transactions while that viewer cannot run, resumes it, and verifies two separate native Undo/Redo steps.
A second interleaving holds an unsent local edit while another writer changes shared state; the resumed viewer must preserve its draft, show a conflict, and download the local drawing rather than the foreign update.
These tests use the generated canvas package and direct CDP with foreground emulation, not a dependency patch or platform spoof.
They do not prove every Android browser's lifecycle-event behavior.

Set `CANVAS_FIXTURE_CATCHUP=1` with `browser-fixture` for manual catch-up investigation.
After drawing one standalone text shape, freeze the viewer before the observation is processed.
The scripted Pi provider makes two server-owned moves and reports `Catch-up commits ready.` without waiting for the viewer.
Resume the viewer with visible/focused lifecycle state, verify automatic resync, then verify each move can be undone and redone separately.
If using headless Chrome, explicit focus emulation may be needed because a thawed page can still report `document.visibilityState === "hidden"`.

There is no browser commit HTTP response to delay anymore.
Do not interpret server state alone as proof that the editor applied a drawing.
Verify rendered pixels and native Undo/Redo, then stop the fixture explicitly.

Additional contracts cover active typing persisting without agent replies, final text plus same-revision imagery after blur, full-scene exports including off-screen elements without viewport changes, save conflicts, stale revisions, recovery, sharing retries, and multi-tab safety.
A focused direct-browser check does not replace the full Playwright suite; report their results separately.