Skip to content

test: assert durable state instead of self-dismissing toasts in desktop E2E - #187

Merged
Azganoth merged 3 commits into
mainfrom
chore/durable-e2e-assertions
Aug 10, 2026
Merged

test: assert durable state instead of self-dismissing toasts in desktop E2E#187
Azganoth merged 3 commits into
mainfrom
chore/durable-e2e-assertions

Conversation

@Azganoth

Copy link
Copy Markdown
Owner

Summary

  • document-lifecycle no longer asserts the save-success toast. The on-disk contents wait and the Save menu item returning to disabled, both already in the spec, prove the save crossed the native boundary.
  • The desktop E2E build disables toast auto-dismissal (timeout={0} on the provider). missing-document-error reports its outcome through the toast and has no durable user-visible substitute, so it keeps that assertion against a settled affordance instead of racing the 5s timer.
  • Audited the other six specs. Toasts were the only self-dismissing affordance; every other assertion reads state that stays true once true.
  • Recorded the rule in docs/architecture.md under Verification Strategy.

Toast presence is the only non-monotone condition in the suite: it becomes true, then false. WebdriverIO's polling assumes the opposite, so waiting longer makes success less likely rather than more, and a missed window fails hard after burning the full waitforTimeout.

Related Issue

Closes #185

Verification

The assembled desktop suite passes from a clean baseline, all seven scenarios.

To confirm the provider override actually takes effect rather than the assertion passing for the old reason, missing-document-error was run with a temporary 8s wait inserted before the toast assertion; it passed, which the 5s default would not allow. The wait was removed before commit.

Manually verified in the forced-failure path on Windows 11:

  1. $env:LEAFDOWN_E2E_FORCE_FAILURE=1; pnpm test:e2e:desktop
  2. The Diagnostics scenario fails and returns a nonzero exit code.
  3. failure.png, failure.json, semantic-state.json, diagnostics.json, and fixture-manifest.json are retained under the run's artifact directory.

pnpm check:frontend passes.

Not verified: behavior on CI, which is where the original flake was measured. The suite has no CI job yet.

Notes

missing-document-error also gained a post-condition that no editor opened, checked after the diagnostic record confirms the operation finished.

The E2E build now carries two mode-gated divergences from the shipped app: the WebDriver plugin import and this toast timeout. Both are timing or harness concerns rather than behavior. A third that changes behavior would be the signal to make notifications observable through the diagnostic channel and drop the override.

Out of scope per the issue: WebdriverIO retries, new scenarios, and the CI job.

Base UI toasts dismiss after 5s, so a slow run loses the affordance before
the assertion resolves. The on-disk contents, the Save menu item state, and
the frontend's operationFailed diagnostic already prove the same crossings
of the native boundary and outlive the operation.

missing-document-error no longer covers the rendered error text; the
errorKind-to-message mapping is unit-tested in documentErrors.test.ts.
Base UI dismisses toasts after 5s, and a slow run loses the affordance
before the assertion resolves. The missing-file scenario reports its
outcome through the toast, so the E2E build disables auto-dismissal
rather than the scenario dropping that coverage.
@Azganoth
Azganoth merged commit 3f44325 into main Aug 10, 2026
2 checks passed
@Azganoth
Azganoth deleted the chore/durable-e2e-assertions branch August 10, 2026 04:56
@Azganoth Azganoth self-assigned this Aug 10, 2026
@Azganoth Azganoth added the Maintenance Chore, refactor, dependency, or test work without user-facing change label Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintenance Chore, refactor, dependency, or test work without user-facing change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assert durable state instead of self-dismissing toasts in the desktop E2E suite

1 participant