Skip to content

Test the generated Passport dashboard in a real browser #62

Description

@atdr

Problem

Passport's Python tests verify data reduction, template injection, asset packaging, offline URLs, and HTML escaping, but they never execute the roughly 980 lines of authored JavaScript in the generated dashboard. A broken control, chart, map, dialog, responsive layout, or browser API can therefore ship while the Python suite remains green.

Proposed approach

Add a small end to end suite using the official Python pytest-playwright plugin and Chromium. Each test should render a temporary passport.html from synthetic rows and open that generated artifact, rather than test the source template in isolation.

Keep browser tests outside the default tests/ discovery path and run them in a dedicated CI job so the Python version matrix stays fast and local pytest does not require a browser installation. Install only Chromium and its system dependencies in that job, give the job the repository's standard ten minute timeout, and retain a Playwright trace on failure.

Initial scenarios

  • Load the generated Passport with no page errors or unexpected console errors.
  • Assert that opening and using the page makes no external network requests.
  • Verify that hero totals and summary values match the synthetic fixture.
  • Change the selected year and verify that totals and charts update.
  • Switch between total, distance, and duration metrics.
  • Exercise cabin and reason breakdown controls.
  • Open and close the ranking dialog, including the Escape key path.
  • Cover planned and unpriced flights plus missing date, duration, and airport data.
  • Run the core interactions at fixed desktop and mobile viewports.

Boundaries

  • Use semantic DOM and accessibility assertions first. Do not add screenshot baselines initially.
  • Do not introduce a Node, Vite, or Vitest toolchain solely for this suite.
  • Do not set a JavaScript coverage target yet. Browser behavior is the first objective; extracting and instrumenting the inline script can be considered separately if Passport development becomes frequent.
  • Keep all itinerary fixtures synthetic and prevent every real network call.

Acceptance criteria

  • A documented local command installs Chromium and runs the browser suite.
  • A dedicated blocking CI check runs the suite against Chromium.
  • Failures retain enough diagnostics to investigate console, network, and interaction errors.
  • The existing Python matrix and coverage job remain browser independent.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions