Skip to content

chore: add standalone desktop E2E automation#650

Merged
lefarcen merged 7 commits intomainfrom
chore/desktop-e2e-automation
Mar 30, 2026
Merged

chore: add standalone desktop E2E automation#650
lefarcen merged 7 commits intomainfrom
chore/desktop-e2e-automation

Conversation

@lefarcen
Copy link
Copy Markdown
Collaborator

What

Add a standalone desktop E2E automation suite under e2e/desktop/.

Why

Desktop packaged app testing has been manual and fragile. Need automated verification of DMG install, codesign, cold start, login flow, model switching, and update scenarios — with full diagnostics capture for CI debugging.

How

  • e2e/desktop/ with isolated package.json (not in pnpm workspace, dependencies installed separately via npm install)
  • Bash runner (run-e2e.sh) + Playwright scenarios (packaged-e2e.mjs)
  • 5 test modes: smoke, login, model, update, full
  • Supports testing nightly/beta/stable downloads and local unsigned builds (NEXU_DESKTOP_E2E_SKIP_CODESIGN=true)
  • System screen recording (.mov) + Playwright screenshots + state directory snapshots on failure
  • CI workflow (.github/workflows/desktop-e2e.yml) with download/build source options
  • Async E2E trigger from nightly and release workflows (non-blocking)

Affected areas

  • e2e/desktop/ (new)
  • .github/workflows/desktop-e2e.yml (new)
  • .github/workflows/desktop-nightly.yml (added trigger-e2e job)
  • .github/workflows/desktop-release.yml (added trigger-e2e job)

Checklist

  • Scripts syntax validated (bash -n, node --check)
  • Smoke test verified locally (codesign + spctl + cold start)
  • Model switch scenario verified locally (fake provider + A/B switch)
  • Login scenario verified locally (OAuth + agent ready)
  • README with full documentation
  • Mac mini self-hosted runner setup (pending hardware access)

- e2e/desktop/ with isolated npm dependencies (not in pnpm workspace)
- Test modes: smoke, login, model switch, update, full
- Supports nightly/beta/stable downloads and local unsigned builds
- System screen recording + Playwright screenshots on failure
- State snapshot capture (config, openclaw state, runtime ports)
- CI workflow with download/build source options
- Async E2E trigger from nightly and release workflows (non-blocking)
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

permissions:
contents: write

P1 Badge Grant actions:write before dispatching desktop-e2e workflow

This workflow now calls github.rest.actions.createWorkflowDispatch in trigger-e2e, but the workflow-level permissions only grant contents: write; with explicit permissions, omitted scopes are set to none, so GITHUB_TOKEN lacks Actions write permission and the dispatch call will fail (typically 403), meaning release runs will not actually trigger the follow-up E2E workflow.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/desktop-release.yml
Comment thread e2e/desktop/scripts/run-e2e.sh
5 boundary condition tests:
- Crash recovery: Force Quit simulation → verify launchd services survive → restart
- Orphan cleanup: kill Electron only → verify stale sidecars detected and cleaned
- Port conflict: occupy port 50800 → verify app handles EADDRINUSE
- Stale state: fake runtime-ports.json → verify app ignores and does fresh start
- Double launch: second instance → verify single-instance lock
…e per test

- verify_services(): checks controller API, web server, openclaw health,
  launchd registration, TCP listeners, and electron process after every startup
- resilience_update_residual: kill Electron with launchd services still running,
  verify new app teardowns residual services and starts fresh
- resilience_reset: clean home directory before each resilience scenario
  to avoid stale login/config state leaking between tests
- Main flow: reset home for smoke/login/resilience modes,
  preserve for model/update (test with existing state)
- Remove IPC hook in login scenario that caused premature quit dialog
@lefarcen lefarcen merged commit 85557ae into main Mar 30, 2026
6 checks passed
@lefarcen lefarcen mentioned this pull request Mar 30, 2026
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