Skip to content

test: add playwright end-to-end tests - #2

Merged
robertjndw merged 3 commits into
mainfrom
test/e2e-playwright
Oct 10, 2026
Merged

robertjndw merged 3 commits into
mainfrom
test/e2e-playwright

Conversation

@robertjndw

Copy link
Copy Markdown
Owner

Adds a Playwright suite that drives the production build served by the real server, plus two bugs it turned up.

Tests

29 tests in apps/web/e2e/ covering:

  • editing, compiling, diagnostics and renaming the project
  • autocompletion, signature help, hover docs and file path completion (tinymist)
  • files, folders, rename, delete and tabs
  • image uploads (also seen by a second browser) and pasting images, ZIP and PDF export
  • saving, browsing, diffing and restoring versions
  • offline editing, opening without the server, recovering the preview
  • live sync, presence and cursors, view-only links

Run with pnpm build && pnpm test:e2e. CI gets a new e2e job that reuses the web job's build and caches the Playwright browser.

Fixes

  • Sync stuck on "Offline" after a network blip. loro-websocket 0.6.2 closes the socket with code 1001, which browsers reject, so it never reconnects. Patched to 1000 via pnpm patch until the upstream fix (fix(websocket): use browser-valid close codes loro-dev/protocol#65) ships in 0.6.3. See patches/README.md for when to remove it.
  • Preview broken until reload if the renderer failed to download. The failed load was cached. It's now retried, with a resync once the browser is back online, and the renderer starts loading together with the compiler.

loro-websocket 0.6.2 closes its socket with code 1001 on the offline event and on ping timeouts. Browsers reject that code, so the socket never closes and the client never reconnects, leaving the status stuck at Offline. Patch both calls to 1000 until the upstream fix (loro-dev/protocol#65) is released in 0.6.3.
A failed renderer download (typically offline right after the page loaded) was cached, so the preview stayed broken until a reload. Drop failed loads, resync once the browser is back online instead of looping on the same failure, and start loading the renderer together with the compiler.
Covers editing and compiling, autocompletion and hover docs, files and tabs, uploads and export, history, offline use, and collaboration including view-only links. Runs against the production build served by the real server, and in CI as its own job.
@robertjndw
robertjndw merged commit a08a1fd into main Oct 10, 2026
4 checks passed
@robertjndw
robertjndw deleted the test/e2e-playwright branch October 10, 2026 10:31
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