Skip to content

Playwright E2E: stamp running test name into window title#23

Merged
vdavid merged 1 commit into
mainfrom
worktree-e2e-window-title-test-name
May 19, 2026
Merged

Playwright E2E: stamp running test name into window title#23
vdavid merged 1 commit into
mainfrom
worktree-e2e-window-title-test-name

Conversation

@vdavid
Copy link
Copy Markdown
Owner

@vdavid vdavid commented May 18, 2026

Adds beforeEach / afterEach hooks to apps/desktop/test/e2e-playwright/fixtures.ts that update the main Tauri window's OS title with the currently running test name, so you can see which spec is in flight (or stuck) by glancing at the dock / Cmd-Tab / Linux title bar — no log tailing needed.

  • beforeEach: sets title to <base> (Running: Section › test name)
  • afterEach: appends (FINISHED)
  • The base title is captured once per worker on the first hook call, so suffixes don't accumulate across tests
  • Test name is derived from testInfo.titlePath, joining describe block(s) + test title with
  • Failures inside the hooks are swallowed — title decoration is for human eyeballs only and should never break a test
  • Uses the standard plugin:window|set_title (and |title for the initial read), no new Rust command
  • Permissions (core:window:allow-title, core:window:allow-set-title) are added to the auto-generated playwright.json capability that build.rs only emits when the playwright-e2e Cargo feature is on, so release builds are unaffected
  • Each parallel shard owns its own Tauri instance + worker process, so the per-worker title state stays clean across shards
  • apps/desktop/test/e2e-playwright/CLAUDE.md documents the new behavior

Test plan

  • cargo check --features playwright-e2e clean; verified the regenerated playwright.json includes the two new permissions
  • tsc --project test/e2e-playwright/tsconfig.json clean
  • eslint test/e2e-playwright/fixtures.ts clean
  • Manual verification of the title change will happen on the next local ./scripts/check.sh --check desktop-e2e-playwright run; if the set_title invoke ever rejects (e.g., permissions slip out of sync) the hooks swallow the error so tests still pass — failure mode is just "title doesn't update," not a flaky test

beforeEach sets the main window's OS title to `<base> (Running: <test>)`
and afterEach appends `(FINISHED)`, so the dock / Cmd-Tab / Linux title
bar tells you which spec is in flight without tailing the log. Base title
is captured once per worker so suffixes don't accumulate across tests.

Uses the standard `plugin:window|set_title` Tauri command; permissions
are added only to the feature-gated `playwright.json` capability that
`build.rs` generates when `playwright-e2e` is on, so release builds are
unaffected.
@vdavid vdavid merged commit 1181e0c into main May 19, 2026
8 of 10 checks passed
@vdavid vdavid deleted the worktree-e2e-window-title-test-name branch May 19, 2026 07:24
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