Skip to content

Feat: add Tier 2 E2E tests and isolate E2E electron-store#201

Merged
pcolt merged 7 commits into
mainfrom
e2e-tests
Jul 13, 2026
Merged

Feat: add Tier 2 E2E tests and isolate E2E electron-store#201
pcolt merged 7 commits into
mainfrom
e2e-tests

Conversation

@pcolt

@pcolt pcolt commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

It completes Tier 2 from #193

  • Update CHANGELOG

Overview

Adds a Tier 2 Playwright E2E test suite that verifies the interaction between the DealiiX Platform Electron client and coral-remote-server — a Go REST API that provides project sharing and multi-user authentication for the platform. Tests cover authentication flows and project persistence: creating, renaming, deleting, and loading projects back onto the canvas.

The suite runs against a real coral-remote-server instance started via Docker Compose reusing the existing docker-compose.yml. Everything runs in a separate CI workflow (e2e-remote.yml) rather than alongside Tier 1 in ci.yml — primarily because building Docker images adds significant overhead in terms of time, especially in future Tier 3.
The workflow checks out the coral-remote-server submodule — a private repository — using a read-only SSH deploy key stored as the CORAL_REMOTE_SERVER_DEPLOY_KEY Actions secret.

The PR also introduces isolated electron-store handling for both test tiers (including Tier 1 PR #200) so the developer's real settings and registered nodes are never touched during test runs.
This works because both tiers launch Electron with ELECTRON_USERDATA set to a fresh temp directory (e2e/fixtures.ts and e2e-remote/fixtures.ts), and electron/main.ts calls app.setPath('userData', process.env.ELECTRON_USERDATA) before ipcHandlers is ever imported. That ordering only holds because ipcHandlers is imported dynamically inside app.whenReady() instead of statically at the top of the file — a static import would be hoisted by ESM and evaluated first, before app.setPath runs. ipcHandlers pulls in the electron-store singleton via storage.ts, which reads app.getPath('userData') the moment it's constructed, so a static import would permanently lock the store onto the wrong data directory.

Summary

  • feat: Tier 2 Playwright suite in e2e-remote/ — login, logout, project create/rename/delete/load
  • feat: e2e-remote.yml CI workflow runs Tier 2 on every push/PR to main; uses a deploy key to check out only the coral-remote-server submodule (other private submodules are not needed)
  • feat: authedPage fixture logs in fresh for every test and keeps the fixtures self-contained; remotePage renamed to unauthedPage for symmetry with authedPage
  • feat: both E2E tiers redirect Electron userData to a temp dir via ELECTRON_USERDATA so the developer's real settings and registered nodes are never touched during test runs
  • fix: ipcHandlers now imported dynamically inside app.whenReady() so app.setPath('userData', …) takes effect before electron-store is constructed (static ESM imports were hoisted, defeating the redirect)
  • fix: settingsStore no longer shows an error toast when the settings key is absent — absent key (first launch / empty test store) silently falls back to createDefaultSettings(); toast fires only when the key exists but fails schema validation
  • feat: urlRemoteServer (http://localhost:8080) and urlVisualizer (http://localhost:8008) pre-filled as defaults in createDefaultSettings()
  • refactor: clearCanvas and waitForToasts extracted from inline fixture code into e2e/helpers.ts and e2e-remote/helpers.ts

Test plan

  • docker compose up -d coral-remote-server
  • npm run test:e2e:remote:build — all 7 Tier 2 tests pass
  • npm run test:e2e:build — all Tier 1 tests still pass
  • Switch app settings to backendKind: executable, then run npm run test:e2e:build — Tier 1 still passes (isolated store, not affected by real settings)
  • Fresh install (no existing electron-store) — no error toast on first launch
  • Verify urlRemoteServer and urlVisualizer are pre-filled in Settings on first launch

pcolt added 5 commits June 23, 2026 17:53
- feat: Tier 2 Playwright suite in e2e-remote/ covering login, logout, project CRUD
- feat: e2e-remote.yml CI workflow runs Tier 2 on every push/PR to main
- feat: both E2E tiers redirect Electron userData to a temp dir via ELECTRON_USERDATA so the real store is never touched
- fix: ipcHandlers imported dynamically so app.setPath('userData') takes effect before electron-store is constructed
- fix: settingsStore no longer shows error toast when settings key is absent (first launch / empty test store)
- feat: default urlRemoteServer and urlVisualizer pre-filled in createDefaultSettings()
- refactor: clearCanvas and waitForToasts extracted to e2e/helpers.ts and e2e-remote/helpers.ts
- fix: replace recursive submodule checkout (fails on private repos) with ssh-agent + targeted submodule init for coral-remote-server only
- refactor: authedPage now logs in fresh per test instead of caching a JWT in electronApp; keeps fixtures self-contained and more readable, with no shared state between fixtures
- refactor: rename remotePage to unauthedPage for symmetry with authedPage
- docs: add a README section explaining ELECTRON_USERDATA store isolation and why ipcHandlers is imported dynamically
@pcolt
pcolt merged commit 7c93f2a into main Jul 13, 2026
2 checks passed
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.

2 participants