Skip to content

Deduplicate the site-e2e test harness (serve + browser setup) #115

Description

@padamson

Surfaced by the pre-0.15.0 code review (cleanup, not a bug).

crates/site-e2e/tests/landing_page.rs has some avoidable duplication:

  • The version-switcher test re-inlines the TcpListener::bind / local_addr / tokio::spawn(axum::serve(...)) body that the existing serve() helper already owns, only because it needs to overlay a /versions.json route before the ServeDir fallback. Parameterizing serve() over an optional Router to merge (keeping the ServeDir fallback as the default) would let both call sites share it.
  • The dist-exists skip guard and the Playwright::launch / chromium().launch / new_page / goto setup quartet are repeated across all three tests. A small setup(dist) -> (Page, Browser, JoinHandle) helper would collapse them.

Low urgency — the tests pass and this is purely maintainability. Worth doing when the harness is next touched (e.g. if a launch option or headless toggle needs adding, which would otherwise have to change in every copy).

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