Skip to content

test: add real macOS Tauri integration coverage - #69

Open
Ryanb58 wants to merge 12 commits into
mainfrom
tbrazelton/tauri-integration-tests
Open

test: add real macOS Tauri integration coverage#69
Ryanb58 wants to merge 12 commits into
mainfrom
tbrazelton/tauri-integration-tests

Conversation

@Ryanb58

@Ryanb58 Ryanb58 commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a production-isolated macOS Tauri integration build using a feature-gated WebdriverIO guest and embedded driver
  • exercise the real WKWebView and production IPC for app boot, filesystem access, vault scope rejection, recent folders, and external watcher events
  • reset only isolated test app state, retain failure logs/screenshots, and run the suite in a macOS pull-request workflow
  • document the browser-only and real-desktop test boundaries

Verification

  • pnpm test:tauri — 3 spec files and 6 checks passed on macOS
  • pnpm test — 794 tests passed
  • pnpm build — passed
  • pnpm test:e2e — 2 browser smoke tests passed
  • cargo test --manifest-path src-tauri/Cargo.toml --lib — 125 tests passed
  • cargo check --manifest-path src-tauri/Cargo.toml --features tauri-integration-tests — passed
  • ordinary production frontend assets exclude the test guest
  • default production Cargo dependencies exclude the WebdriverIO Tauri plugins

Isolation

  • uses the dedicated dev.mdwriter.editor.e2e identifier
  • runs one app instance at a time with guarded temporary vault cleanup
  • leaves production capabilities, updater configuration, and release workflow unchanged

Copilot AI lite review requested due to automatic review settings August 11, 2026 07:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a macOS-only “real desktop” integration test lane that builds an isolated Tauri .app (feature-gated Rust plugins + test-only Tauri config) and drives the actual WKWebView + IPC using WebdriverIO, with CI wiring and documentation to clarify the browser-only vs real-app test boundaries.

Changes:

  • Introduces an isolated Tauri integration-test build flavor (tauri.e2e.conf.json, new Cargo feature, optional WebdriverIO plugins).
  • Adds a frontend integration-test bootstrap gate (VITE_TAURI_INTEGRATION_TEST) and suppresses the automatic silent update check in that mode.
  • Adds a WebdriverIO-based macOS integration suite (boot/filesystem/scope/recents/watcher), CI workflow, and testing docs.

Reviewed changes

Copilot reviewed 26 out of 31 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
vitest.config.ts Excludes WebdriverIO spec directory from Vitest discovery.
src/vite-env.d.ts Adds typing for VITE_TAURI_INTEGRATION_TEST.
src/main.tsx Bootstraps the app after conditionally loading the WebdriverIO Tauri guest.
src/lib/tauriIntegrationMode.ts Centralizes integration-test mode flag + guest loader helpers.
src/lib/tests/tauriIntegrationMode.test.ts Unit tests for guest loading and update-check scheduling gates.
src/lib/tests/tauriE2eConfig.test.ts Contract test asserting isolation and test-only permissions vs production.
src/features/updates/useUpdates.ts Skips scheduling the silent update timer in integration-test builds.
src-tauri/tauri.e2e.conf.json Adds isolated Tauri config override for the integration-test app.
src-tauri/src/lib.rs Feature-gates WebdriverIO plugins behind tauri-integration-tests.
src-tauri/Cargo.toml Adds tauri-integration-tests feature + optional plugin deps.
src-tauri/Cargo.lock Locks additional optional dependencies for the integration-test feature.
pnpm-workspace.yaml Adds pnpm build allowlist configuration (workspace manifest).
package.json Adds test:tauri build/run scripts and WebdriverIO dev dependencies.
e2e-tauri/wdio.d.ts Declares WebdriverIO/Tauri globals used by integration specs.
e2e-tauri/wdio.conf.ts WebdriverIO config: serial run, embedded driver, logs, failure screenshots, state reset.
e2e-tauri/specs/boot.spec.ts Verifies the real .app boots and the Tauri test API is available.
e2e-tauri/specs/filesystem.spec.ts Exercises real IPC: tree listing, read/write, vault scope enforcement, recents.
e2e-tauri/specs/watcher.spec.ts Verifies external host writes surface via real watcher + vault-changed events.
e2e-tauri/helpers/tempVault.ts Creates and safely cleans up per-test temporary vaults.
e2e-tauri/helpers/paths.ts Resolves app binary path and safely resets isolated Application Support state.
e2e-tauri/helpers/ipc.ts Helper for invoking real Tauri IPC commands via the embedded driver.
e2e-tauri/helpers/artifacts.ts Captures failure screenshots with sanitized filenames.
e2e-tauri/helpers/tests/paths.test.ts Unit tests for safe Application Support cleanup guardrails.
e2e-tauri/helpers/tests/artifacts.test.ts Unit tests for failure screenshot capture behavior.
docs/TESTING.md Documents the three suites and boundaries + troubleshooting guidance.
docs/superpowers/specs/2026-08-10-tauri-integration-tests-design.md Adds a design spec for the integration-test architecture and acceptance criteria.
docs/superpowers/plans/2026-08-10-tauri-integration-tests.md Adds a detailed implementation plan for the integration suite and CI.
AGENTS.md Documents the new pnpm test:tauri* commands and test-scope boundaries.
.gitignore Ignores test artifacts (adds a redundant subpath entry).
.github/workflows/tauri-integration.yml Adds macOS PR workflow to build and run the real Tauri integration suite.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/main.tsx
)
}

void bootstrap()
Comment on lines +6 to +10
export async function loadTauriIntegrationGuest(
enabled: boolean,
loader: GuestLoader = () => import("@wdio/tauri-plugin"),
): Promise<void> {
if (enabled) await loader()
Comment thread pnpm-workspace.yaml
Comment on lines +1 to +4
allowBuilds:
edgedriver: false
esbuild: true
geckodriver: false
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