Skip to content

test: add dedicated native Electron Playwright harness - #531

Merged
khaira777 merged 5 commits into
mainfrom
fm/flocafe-525-dedicated-electron-harness
Aug 27, 2026
Merged

test: add dedicated native Electron Playwright harness#531
khaira777 merged 5 commits into
mainfrom
fm/flocafe-525-dedicated-electron-harness

Conversation

@khaira777

@khaira777 khaira777 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Intent

Validate native Electron E2E test harness fixes on PR 531

What Changed

  • Added a dedicated native Electron Playwright harness (playwright.electron.config.ts, native-harness.ts, native-e2e-fixture.cjs, and title-bar.electron.spec.ts) with isolated database profiles and credential seeding.
  • Split browser and native Electron E2E test runs across npm scripts, configuration files, and GitHub Actions CI workflow jobs with Xvfb display support.
  • Completed the browser mock electronAPI fixture contract and added test-mode environment guards in main/index.ts, main/db.ts, and tests/e2e-server.cjs.

Risk Assessment

✅ Low: The changes cleanly isolate the native Electron E2E harness into a dedicated Playwright configuration and CI job with robust port management, disposable sandboxed profiles, and reliable process lifecycle teardown.

Testing

Executed the targeted native Electron Playwright E2E suite (title-bar.electron.spec.ts), browser platform Playwright suite (title-bar-platform.spec.ts), real Electron runtime probe (platform-titlebar-runtime-probe.cjs), and window lifecycle unit suites (titlebar-window-options, electron-api-contract, window-readiness, window-load-retry). Captured visual evidence screenshots of the native Electron application in both unauthenticated login and authenticated POS dashboard states in ~/.no-mistakes/evidence/01M1211RSKP5WYF9DSM6RBKME5/. All checks passed.

  • Evidence: Native Electron Login Drag Surface (local file: ~/.no-mistakes/evidence/01M1211RSKP5WYF9DSM6RBKME5/01-native-electron-login-screen.png)
  • Evidence: Native Electron Authenticated Dashboard (local file: ~/.no-mistakes/evidence/01M1211RSKP5WYF9DSM6RBKME5/02-native-electron-authenticated-dashboard.png)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • cd frontend && FLO_E2E_EVIDENCE_DIR=~/.no-mistakes/evidence/01M1211RSKP5WYF9DSM6RBKME5 npx playwright test --config=playwright.electron.config.ts --project=electron-desktop
  • cd frontend && npx playwright test e2e/title-bar-platform.spec.ts --config=playwright.config.ts --project=chromium
  • npm run test:titlebar-window-options
  • npm run test:electron-api-contract
  • npm run test:window-readiness
  • npm run test:window-load-retry
  • npx electron tests/platform-titlebar-runtime-probe.cjs
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown

Greptile Summary

The PR separates browser Playwright coverage from a dedicated native Electron harness while preserving both suites in CI.

  • Makes the default test:e2e command browser-only and runs native Electron tests in a separate Xvfb-backed CI job.
  • Adds isolated native profile, database, credentials, ports, readiness barriers, authenticated navigation, and bounded teardown.
  • Expands the browser Electron fixture to implement the renderer-facing API contract.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the prior headless-launch path is now browser-only by default with native CI running under Xvfb, and the native harness no longer commits or duplicates static fixture credentials.

Important Files Changed

Filename Overview
package.json Separates browser and native E2E scripts and makes the default E2E command browser-only, resolving the prior headless aggregate-launch failure.
.github/workflows/ci.yml Runs Chromium explicitly in the browser job and supplies Xvfb for the isolated native Electron job.
frontend/e2e/desktop/native-harness.ts Implements randomized fixture credentials, isolated runtime state, readiness checks, authenticated navigation, and bounded teardown.
tests/native-e2e-fixture.cjs Seeds the isolated native database exclusively from runtime-provided profile and credential values.
frontend/e2e/helpers/electron-fixture.ts Provides a complete browser-side Electron API fixture with an explicit initial-focus contract.
frontend/playwright.config.ts Restricts the standard Playwright configuration to browser tests and adds an all-services-ready web-server barrier.
frontend/playwright.electron.config.ts Defines the dedicated serial Electron desktop test project independently of the browser server lifecycle.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[CI changes detected] --> B[Browser Playwright job]
  A --> C[Native Electron job]
  B --> D[Chromium project]
  D --> E[Browser E2E server]
  C --> F[Xvfb display]
  F --> G[Dedicated Electron harness]
  G --> H[Temporary profile and database]
  G --> I[Seeded authentication]
  G --> J[Service and renderer readiness]
  G --> K[Graceful teardown verification]
Loading

Reviews (2): Last reviewed commit: "no-mistakes(document): verify docs and l..." | Re-trigger Greptile

Comment thread package.json Outdated
Comment thread frontend/e2e/desktop/native-harness.ts
@khaira777
khaira777 force-pushed the fm/flocafe-525-dedicated-electron-harness branch from b4ccb7f to caf1ace Compare August 27, 2026 16:38
@khaira777 khaira777 changed the title test: separate browser and dedicated native Electron test harnesses test: add dedicated native Electron Playwright harness Aug 27, 2026
@khaira777
khaira777 merged commit 9ca674b into main Aug 27, 2026
15 checks passed
@khaira777
khaira777 deleted the fm/flocafe-525-dedicated-electron-harness branch August 27, 2026 16:43
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