Repository navigation
test: add deterministic browser characterization suite - #4
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a deterministic, fully offline end-to-end (E2E) browser characterization harness for Parallax Maker by introducing a test-only server that installs model-boundary fakes and a Playwright suite that exercises real Dash UI workflows (upload/slicing, segmentation, inpainting/undo, restore, glTF export, and animation artifacts). This strengthens regression detection around UI + persistence + exporters without paying inference/network cost.
Changes:
- Introduces
parallax_maker.e2e_serverandparallax_maker.e2e_supportfakes/fixtures to run deterministic offline workflows and block external traffic. - Adds Playwright test suite + config + helpers under
e2e/, plus npm scripts and lockfile tracking. - Extends CI workflow to run Chromium Playwright tests and upload diagnostics artifacts on failure; updates Python packaging include pattern to ship E2E support.
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
pyproject.toml |
Expands setuptools package discovery to include subpackages (e.g., E2E support). |
parallax_maker/test_e2e_support.py |
Unit tests covering deterministic fakes + fixture state + mask metadata. |
parallax_maker/e2e_support/fixtures.py |
Deterministic image/state fixture creation for browser workflows. |
parallax_maker/e2e_support/fakes.py |
Fake depth/segmentation/inpainting/upscaling plus offline/network blocking + Dash monkeypatch install. |
parallax_maker/e2e_support/__init__.py |
Exposes E2E support helpers for the test server. |
parallax_maker/e2e_server.py |
Test-only Dash/Flask server wiring fakes, isolated state, and artifact/state inspection endpoints. |
package.json |
Adds Playwright E2E scripts and dev dependency. |
package-lock.json |
Locks Playwright dependency tree for reproducible CI/local runs. |
e2e/README.md |
Documents how to run and what the characterization suite asserts/contracts. |
e2e/playwright.config.ts |
Single-worker Playwright configuration with optional embedded server command and diagnostics output. |
e2e/parallax-maker.spec.ts |
High-fidelity UI characterization scenarios covering main workflows and artifact assertions. |
e2e/helpers/app.ts |
Centralized selectors and UI interaction helpers for Dash UI automation and assertions. |
e2e/fixtures.ts |
Playwright fixture that captures and soft-fails on browser console/page/network issues, attaching diagnostics. |
.gitignore |
Ignores Playwright outputs (test results / report) and stops ignoring package-lock.json. |
.github/workflows/python-app.yml |
Runs Playwright Chromium E2E in CI (Node 24), installs browsers, uploads diagnostics on failure. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 15 changed files in this pull request and generated no new comments.
Suppressed comments (2)
parallax_maker/e2e_support/fakes.py:282
- The monkeypatched
serve_main_image_with_unique_urlwrapper hard-codes the currentserve_main_image(self, image)signature. IfAppState.serve_main_imagegains parameters, this patch will break at runtime. Use*args/**kwargswhen forwarding to the original method to keep the monkeypatch resilient.
def serve_main_image_with_unique_url(state, image):
url = original_serve_main_image(state, image)
path = url.split("?", maxsplit=1)[0]
return f"{path}?e2e-v={next(image_versions)}"
parallax_maker/e2e_support/fakes.py:164
_load_inpainting_base()is called immediately in theFakeInpaintingModelbase class list, so it doesn’t actually defer importingparallax_maker.inpainting(and it adds indirection that makes static analysis/type checking harder). Prefer a direct import + explicit base class, or (if the goal is truly lazy import) switch to composition instead of dynamic inheritance.
def _load_inpainting_base():
from parallax_maker.inpainting import InpaintingModel
return InpaintingModel
class FakeInpaintingModel(_load_inpainting_base()):
"""Use the real inpainting composition around a checkerboard generator."""
Summary
Verification
python -m pytest: 110 passednpm run test:e2e: 5 passedpython -m parallax_maker.e2e_server --help: passedCharacterized existing behavior
Animation export currently writes numbered PNG frames server-side and does not start a browser download. The test records that contract without changing production behavior.