Skip to content

Wire Playwright end-to-end tests into the CI pipeline #250

Description

@james2177

Description: playwright.config.ts and e2e/swap-happy-path.spec.ts exist and are clearly functional (they mock Freighter and the backend relay), but .github/workflows/ci.yml's frontend job never runs npx playwright test — the e2e suite currently only runs if a contributor remembers to run it manually.

Problem Statement & Context: A fully-built, well-mocked e2e happy-path test exists and provides zero continuous protection today, since CI never executes it. Any regression to the actual end-to-end swap flow (wallet connect → quote → sign → submit → success toast) would currently ship undetected by automation.

Scope & Acceptance Criteria:

  • Add a CI job (or step within the existing frontend job) that installs Playwright browsers (npx playwright install --with-deps chromium, matching the single chromium project already configured) and runs npx playwright test.
  • Playwright's HTML report (already configured via reporter: [["html", { open: "never" }]]) is uploaded as a CI artifact on failure (and ideally always, for visibility) via actions/upload-artifact, mirroring the existing coverage-report artifact pattern already in ci.yml.
  • The job must not flake spuriously due to the webServer boot time — confirm reuseExistingServer: !process.env.CI and the NEXT_PUBLIC_API_URL override already configured in playwright.config.ts are correctly exercised in the CI environment.
  • Out of scope: adding new e2e test specs (tracked separately in issue My Intents: link rows to the existing intent detail page #33) — this issue is purely about running the one that already exists.

Implementation Guidelines:

  1. Key files: .github/workflows/ci.yml, playwright.config.ts, e2e/swap-happy-path.spec.ts.
  2. Consider whether Playwright should run as a separate parallel job from the existing frontend job (faster overall CI wall-clock time) or a sequential step — a separate job is likely cleaner since it needs a built/running Next.js server, distinct from the lint/typecheck/vitest/build steps.
  3. Edge cases: caching Playwright's browser binaries across CI runs (via actions/cache keyed on the Playwright version) to avoid a slow browser download on every run; ensure the job runs on PRs, not just main pushes, per the existing on: triggers.
  4. Testing: verify by opening a draft PR and confirming the new CI job actually runs and passes/fails appropriately (include a link or screenshot of a green run in this PR's description); intentionally break something trivial in a scratch branch to confirm the job actually catches a real e2e regression, then revert before merging.

Definition of Done:

  • CI workflow updated, verified green on a real PR run.
  • Playwright HTML report uploaded as an artifact on the workflow run.
  • PR passes CI (including the new Playwright step).
  • Reviewed and approved.

Resources: .github/workflows/ci.yml, playwright.config.ts, e2e/swap-happy-path.spec.ts

Complexity: High (200 points)

Activity

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions