Skip to content

Investigate reliable Playwright webServer via Vite preview #49

@sm17p

Description

@sm17p

Context

We want E2E fixture hosting to use Playwright webServer with Vite preview (pnpm e2e:preview) instead of the custom Node server.

What we know

  • package.json already defines:
    • e2e:preview: vite preview --host localhost --port 51234 --strictPort
  • Local runs passed with the Vite-preview command.
  • CI failed when playwright.config.ts used webServer.command: pnpm e2e:preview.
  • Failure signature in Playwright job:
    • Error: Process from config.webServer was not able to start. Exit code: 1
  • Example failing run:
    • Playwright Tests 23607589365 (head sha 4864566726e6a02b30545bd0c58f93bd2e6bcf2a)
  • Rollback to custom server command fixed CI:
    • webServer.command: node e2e/serve-fixtures.mjs 51234
    • Playwright Tests passing runs include 23607674112 and 23607764181.

Current state

  • playwright.config.ts is intentionally using the custom fixture server command for CI stability.
  • Host alignment remains on localhost:51234 across baseURL, webServer.url, and storage keying.

Goal

Find a CI-stable path to use Vite preview as the default Playwright webServer command.

Suggested next investigation

  1. Reproduce the CI startup failure in a minimal workflow step that runs only pnpm e2e:preview and waits on http://localhost:51234/inspector-playground.html.
  2. Capture full process stderr/stdout for the preview command in Actions logs.
  3. Compare execution contexts between:
    • direct shell pnpm e2e:preview
    • Playwright-managed webServer.command
  4. Validate whether build artifacts and working directory assumptions differ in CI for the Playwright step.
  5. Retry with narrowly scoped command variants only if needed (keep localhost and strictPort):
    • pnpm exec vite preview --host localhost --port 51234 --strictPort
    • explicit cwd wrapper script that logs env/cwd before start.

Definition of done

  • At least one green Playwright CI run using Vite preview as webServer.command.
  • Remove fallback custom server command only after that green run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    infrastructureCI/CD or dependencyquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions