Skip to content

test(e2e): build export file-write suite (5.E2E-002/003)#4

Merged
pbean merged 1 commit into
mainfrom
test/e2e-export-file-write
Jun 16, 2026
Merged

test(e2e): build export file-write suite (5.E2E-002/003)#4
pbean merged 1 commit into
mainfrom
test/e2e-export-file-write

Conversation

@pbean

@pbean pbean commented Jun 16, 2026

Copy link
Copy Markdown
Owner

What

Builds the export E2E suite (P1-E2E-004 in e2e/run.mjs) — the last unbuilt path of epic-6 retro item-1. Covers 5.E2E-002 (markdown file-write) and 5.E2E-003 (JSON file-write).

Why the approach

The export flow opens a native OS file picker, which WebDriver cannot drive. The originally-planned in-page dialog stub also turned out to be impossible: Tauri v2 freezes __TAURI_INTERNALS__ — its invoke/postMessage are writable:false, configurable:false (verified on the running debug binary via Object.getOwnPropertyDescriptor). So there is no JS seam to fake the picker; assignment silently no-ops and defineProperty throws.

The suite therefore uses direct-command-invoke — the epic-5 test-design fallback — driving the real export_markdown/export_json commands with a harness-chosen temp path and asserting the real on-disk output:

  • Markdown: per-note .md files on disk, YAML frontmatter + body, safe (separator-free) filenames, our marker note present in the body.
  • JSON: single file re-parses to an array, 2-space indented, our marker note carries all 7 fields.

The picker cancel/null branch stays covered by the existing export frontend unit tests.

Notes

  • Adds a W3C-standard executeAsyncScript to driver.mjs so the command's resolved value is awaited correctly across driver versions (not relying on a particular WebKitWebDriver's sync-await-of-thenables).
  • Tracking: flips sprint-status.yaml epic-6 item-1 and marks 5.E2E-002/003 done in test-design-epic-5.md.

Verification

Local: 19/19 E2E green under xvfb (the 16 prior checks + 3 new export tests).

🤖 Generated with Claude Code

Adds P1-E2E-004 to e2e/run.mjs covering markdown and JSON export — the
last unbuilt path of epic-6 retro item-1.

The export flow opens a native OS file picker, which WebDriver cannot
drive. The planned in-page dialog stub also proved impossible: Tauri v2
freezes __TAURI_INTERNALS__ (its invoke/postMessage are non-writable and
non-configurable, verified on the running binary), so there is no JS seam
to fake the picker. The suite therefore uses direct-command-invoke — the
epic-5 test-design fallback — driving the real export_markdown/export_json
commands with a harness-chosen temp path and asserting the real on-disk
output (markdown: per-note files, frontmatter+body, safe filenames;
json: re-parsed array, 7 fields, 2-space indent). The picker cancel/null
branch stays covered by the export frontend unit tests.

Adds a W3C-standard executeAsyncScript to driver.mjs so the command's
resolved value is awaited correctly across driver versions, rather than
relying on a particular WebKitWebDriver's sync-await-of-thenables.

Verified locally: 19/19 E2E green under xvfb.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@pbean pbean merged commit 0d3392a into main Jun 16, 2026
3 checks passed
@pbean pbean deleted the test/e2e-export-file-write branch June 16, 2026 21:57
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