chore(test): replace nightwatch with playwright as the end-to-end framework #244
Inga granskare
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-web!244
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "work/174"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
The end-to-end suite was one Nightwatch spec with three assertions, driving whatever Firefox happened to be on the developer's machine. It never ran in CI. Replaced with Playwright.
Two commits, deletion last, so a reviewer can stop after the first with both frameworks working. The issue's middle step (new specs) is deferred to its own issue, so it has no content here.
playwright.config.ts: port fromE2E_PORT, default 4331 sopnpm devcan keep running.127.0.0.1, notlocalhost, because on macOSlocalhostcan resolve to ::1 while the server binds IPv4.locale: "sv-SE"andtimezoneId: "Europe/Stockholm"pinned on the default context. ThewebServerblock replaces the 77 lines of hand-rolled build, spawn, wait and teardown inscripts/e2e.mjs.chromium,webkitandmobile-safarion every run.mobile-safarireuses the WebKit binary and costs no extra download, which matters because on iOS every browser is WebKit and #158 reproduced there only.firefoxopts in viaE2E_FULL_MATRIX=true.homepage.spec.tsports the old spec and doubles it across sv and en, using role locators rather than theh1CSS selector.nightwatch.conf.js,scripts/e2e.mjs,src/test/e2e/homepage.js. Droppednightwatchandgeckodriver.eslint.config.mjs,pnpm-workspace.yamlallowBuilds(both entries removed, noplaywrightentry added, since@playwright/testhas no postinstall browser download), the three ignore files, and added ansrc/test/e2e/**exclude tovitest.config.tsso the two runners cannot collide over a filename.pre-pushis narrowed to--project=chromiumso the hook stays fast.Acceptance, all run:
pnpm test:e2e: 12 passed across chromium, webkit and mobile-safari.E2E_FULL_MATRIX=true pnpm test:e2e: 16 passed, firefox included.pnpm lint,pnpm check(0 errors, 0 warnings),pnpm test(361 passed).grep -ril nightwatchover the working tree: no matches at all, lockfile included.pnpm install --prod --frozen-lockfilein a scratch copy: no selenium, nightwatch or geckodriver anywhere undernode_modules.Two notes for the reviewer:
dependenciesversusdevDependencieshalf of the motivation was already fixed on main before this branch started. The--prodcheck above is fresh evidence, not a claim inherited from the issue.@axe-core/playwrightis added per the issue's scope but nothing imports it yet. The accessibility specs that will are a separate issue. Drop it here if you would rather it arrived with its first consumer.Out of scope and not done: wiring e2e into CI, baking browsers into the runner image, new specs.
Closes #174
62fe3d246a6c252c8b06