victauri-test
Playwright-style testing for Tauri apps via Victauri.
What It Does
Typed HTTP client for the Victauri MCP server with high-level convenience methods:
- Playwright-style API —
click_by_text,fill_by_id,expect_text,select_by_id - Locator API — composable element queries:
Locator::role("button").and_text("Save") - IPC verification — call logs, checkpoints, ghost command detection, coverage tracking
- Visual regression — pixel-level screenshot comparison with baseline snapshots
- Fluent assertions — chain DOM, IPC, network, and coverage checks in one report
- State comparison — cross-boundary frontend/backend verification
- Accessibility audits — WCAG violation assertions
- Performance budgets — load time and heap size guards
- Smoke test suite — 11 built-in checks with pass/fail reporting
Quick Start
[]
= "0.2"
= { = "1", = ["rt-multi-thread", "macros"] }
use ;
e2e_test!;
Locator API
Composable element queries with factory methods, refinement, actions, and auto-waiting expectations:
use Locator;
// Factory → refinement → action
role.and_text.click.await?;
test_id.fill.await?;
placeholder.fill.await?;
// Expectations with auto-wait
test_id
.expect
.to_be_visible
.await?;
css
.expect
.to_have_text
.await?;
Factory methods
| Method | Finds by |
|---|---|
Locator::role("button") |
ARIA role |
Locator::text("Submit") |
Visible text (substring) |
Locator::text_exact("OK") |
Visible text (exact) |
Locator::test_id("save-btn") |
data-testid attribute |
Locator::css("#my-id") |
CSS selector |
Locator::label("Email") |
Associated <label> text |
Locator::placeholder("Search") |
Placeholder text |
Locator::alt_text("Logo") |
Image alt text |
Locator::title("Close") |
Title attribute |
Refinement
Chain .and_text(), .and_role(), .and_tag(), .nth(), .first(), .last() to narrow results.
Expectations
locator.expect(&mut client) returns an expectation builder with:
to_be_visible(), to_be_hidden(), to_be_enabled(), to_be_disabled(),
to_have_text("..."), to_contain_text("..."), to_have_value("..."),
to_have_role("..."), to_have_attribute("name", "value"),
to_have_count(n), to_have_bounds_near(...), not() (negate any).
Fluent Verification
let report = client.verify
.has_text
.has_no_text
.ipc_was_called
.ipc_was_called_with
.ipc_was_not_called
.no_console_errors
.coverage_above
.run.await?;
report.assert_all_passed;
Visual Regression
use VisualOptions;
let opts = VisualOptions ;
let diff = client.screenshot_visual.await?;
assert!;
IPC Coverage
use coverage_report;
let report = coverage_report.await?;
assert!;
Smoke Test
let report = client.smoke_test.await?;
report.assert_all_passed;
Runs 11 checks: health, DOM snapshot, eval, IPC integrity, registry, window state, screenshot, memory, console errors, performance, ghost commands.
Documentation
Full API docs: docs.rs/victauri-test
License
Apache-2.0 -- see LICENSE
Part of Victauri. Built by 4DA Systems.