test(e2e): build export file-write suite (5.E2E-002/003)#4
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Builds the export E2E suite (
P1-E2E-004ine2e/run.mjs) — the last unbuilt path of epic-6 retro item-1. Covers5.E2E-002(markdown file-write) and5.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__— itsinvoke/postMessagearewritable:false, configurable:false(verified on the running debug binary viaObject.getOwnPropertyDescriptor). So there is no JS seam to fake the picker; assignment silently no-ops anddefinePropertythrows.The suite therefore uses direct-command-invoke — the epic-5 test-design fallback — driving the real
export_markdown/export_jsoncommands with a harness-chosen temp path and asserting the real on-disk output:.mdfiles on disk, YAML frontmatter + body, safe (separator-free) filenames, our marker note present in the body.The picker cancel/
nullbranch stays covered by the existing export frontend unit tests.Notes
executeAsyncScripttodriver.mjsso the command's resolved value is awaited correctly across driver versions (not relying on a particular WebKitWebDriver's sync-await-of-thenables).sprint-status.yamlepic-6 item-1 and marks5.E2E-002/003done intest-design-epic-5.md.Verification
Local: 19/19 E2E green under xvfb (the 16 prior checks + 3 new export tests).
🤖 Generated with Claude Code