test(desktop): Playwright electron e2e harness

Launches the built app (out/main/index.js) via Playwright's _electron
API — no browser project, no chromium download. Adds a launch fixture
(electronApp/window/app), an AppPage page object with a screenshot
helper for autonomous visual review, and a boot smoke suite (shell
renders, @commitea/core label-parse runs in the renderer, preload API
exposed). Scripts: e2e (build+run), e2e:only, e2e:report. Artifacts
gitignored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Croissant Le Doux
2026-07-08 11:38:59 -04:00
parent d6f531eb6d
commit 96c2b8b1c2
9 changed files with 223 additions and 1 deletions

View File

@@ -25,6 +25,20 @@ yarn test # unit tests (vitest)
yarn typecheck
```
### End-to-end (Electron + Playwright)
```sh
yarn workspace @commitea/desktop e2e # build, then drive the built app
yarn workspace @commitea/desktop e2e:only # reuse existing out/ build (tight loop)
yarn workspace @commitea/desktop e2e:report # open the last HTML report
```
Tests launch the built app (`out/main/index.js`) through Playwright's
`_electron` API — no browser project, no chromium download. Fixtures and page
objects live in `apps/desktop/e2e/`; screenshots land in
`e2e/.artifacts/screens/` for visual review. Page objects use user-facing
locators (`getByRole`/`getByText`), never CSS/DOM structure.
## Conventions
- Yarn 4 workspaces; ESM everywhere; `.js` extensions on relative imports