Skip to main content

Crate victauri_test

Crate victauri_test 

Source
Expand description

Test assertion helpers for AI-agent and CI testing of Tauri apps via Victauri.

This crate provides a typed HTTP client for the Victauri MCP server, plus assertion helpers for common test patterns: DOM checks, IPC verification, state comparison, accessibility audits, and performance budgets.

§Quick Start

use victauri_test::VictauriClient;

#[tokio::test]
async fn app_loads_correctly() {
    let client = VictauriClient::connect(7373).await.unwrap();

    // Check the page title
    let title = client.eval_js("document.title").await.unwrap();
    assert_eq!(title.as_str(), Some("My App"));

    // Verify no accessibility violations
    let audit = client.audit_accessibility().await.unwrap();
    assert_eq!(audit["summary"]["violations"], 0);

    // Check IPC health
    let integrity = client.check_ipc_integrity().await.unwrap();
    assert_eq!(integrity["healthy"], true);
}

Structs§

VictauriClient
Typed HTTP client for the Victauri MCP server.

Enums§

TestError

Functions§

assert_ipc_healthy
Assert that IPC integrity is healthy (no stale or errored calls).
assert_json_eq
Assert that a JSON value at the given pointer equals the expected value.
assert_json_truthy
Assert that a JSON value at the given pointer is truthy (not null/false/0/“”).
assert_no_a11y_violations
Assert that an accessibility audit has zero violations.
assert_performance_budget
Assert that all performance metrics are within budget.
assert_state_matches
Assert that state verification passed with no divergences.