Skip to content

Comments

Add MSW mock layer and Playwright e2e tests#2067

Open
testower wants to merge 7 commits intomasterfrom
msw-and-e2e-tests
Open

Add MSW mock layer and Playwright e2e tests#2067
testower wants to merge 7 commits intomasterfrom
msw-and-e2e-tests

Conversation

@testower
Copy link
Collaborator

Summary

  • Expand the minimal MSW mock setup into a full mock layer with realistic Norwegian transit data (providers, lines, flexible lines, networks, brandings, day types, exports, stop places, organisations)
  • Enable running the app without a backend via VITE_ENABLE_MOCKS=true npm start
  • Add 34 Playwright e2e tests covering: app loading, provider selection, lines listing, flexible line editor, day types, exports, networks, and stop places
  • Add @playwright/test dev dependency and Playwright config

Test plan

  • All 1196 existing unit tests pass
  • All 34 new Playwright e2e tests pass against the @entur design system UI
  • App starts and functions correctly with VITE_ENABLE_MOCKS=true npm start
  • CI pipeline passes

Expand the minimal MSW mock setup into a full mock layer with realistic
Norwegian transit data, enabling the app to run without a backend via
VITE_ENABLE_MOCKS=true. Add 34 Playwright e2e tests covering app loading,
provider selection, lines, flexible lines, day types, exports, networks,
and stop places.
@github-actions
Copy link

github-actions bot commented Feb 10, 2026

Visit the preview URL for this PR (updated for commit d49d19f):

https://ent-enki-dev--pr2067-msw-and-e2e-tests-ojym7lf8.web.app

(expires Sat, 14 Feb 2026 07:22:35 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 50f71a028b1cba336bad43cc33ce2755ca3f1855

Comprehensive Playwright tests covering:
- Line editor: all 3 steps (General, Journey Patterns, Service Journeys),
  step navigation, form fields, dropdowns, notices, stop points, passing times
- Brandings: listing, create form, edit form with populated data
- Providers: listing, create form, edit form with populated data
- Fix flaky app-loads test for provider selection redirect
The lines listing tests are already covered more thoroughly
in line-editor.spec.ts.
New workflow tests that actually submit forms and verify results:
- Line editor: edit+save on all 3 steps, delete with confirmation,
  cancel deletion
- Brandings: create new, edit+save, delete with confirmation
- Networks: edit+save, delete with confirmation, verify success toast
- Day types: edit+save, verify delete disabled for in-use types

Also reduce parallel workers to 4 and increase test timeout to 60s
to avoid flaky failures under load.
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
25.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant