pub struct VictauriClient { /* private fields */ }Expand description
Typed HTTP client for the Victauri MCP server.
Manages session lifecycle (initialize → tool calls → cleanup) and provides convenient methods for common test operations.
Implementations§
Source§impl VictauriClient
impl VictauriClient
Sourcepub async fn connect(port: u16) -> Result<Self, TestError>
pub async fn connect(port: u16) -> Result<Self, TestError>
Connect to a Victauri MCP server on the given port.
Sends initialize and notifications/initialized automatically.
Sourcepub async fn connect_with_token(
port: u16,
token: Option<&str>,
) -> Result<Self, TestError>
pub async fn connect_with_token( port: u16, token: Option<&str>, ) -> Result<Self, TestError>
Connect with an optional Bearer auth token.
Sourcepub async fn call_tool(
&mut self,
name: &str,
arguments: Value,
) -> Result<Value, TestError>
pub async fn call_tool( &mut self, name: &str, arguments: Value, ) -> Result<Value, TestError>
Call an MCP tool by name and return the result content as JSON.
Sourcepub async fn eval_js(&mut self, code: &str) -> Result<Value, TestError>
pub async fn eval_js(&mut self, code: &str) -> Result<Value, TestError>
Evaluate JavaScript in the webview and return the result.
Sourcepub async fn dom_snapshot(&mut self) -> Result<Value, TestError>
pub async fn dom_snapshot(&mut self) -> Result<Value, TestError>
Get a DOM snapshot of the current page.
Sourcepub async fn click(&mut self, ref_id: &str) -> Result<Value, TestError>
pub async fn click(&mut self, ref_id: &str) -> Result<Value, TestError>
Click an element by ref handle ID.
Sourcepub async fn fill(
&mut self,
ref_id: &str,
value: &str,
) -> Result<Value, TestError>
pub async fn fill( &mut self, ref_id: &str, value: &str, ) -> Result<Value, TestError>
Fill an input element with a value.
Sourcepub async fn type_text(
&mut self,
ref_id: &str,
text: &str,
) -> Result<Value, TestError>
pub async fn type_text( &mut self, ref_id: &str, text: &str, ) -> Result<Value, TestError>
Type text into an element character by character.
Sourcepub async fn list_windows(&mut self) -> Result<Value, TestError>
pub async fn list_windows(&mut self) -> Result<Value, TestError>
List all window labels.
Sourcepub async fn get_window_state(
&mut self,
label: Option<&str>,
) -> Result<Value, TestError>
pub async fn get_window_state( &mut self, label: Option<&str>, ) -> Result<Value, TestError>
Get the state of a specific window (or all windows).
Sourcepub async fn screenshot(&mut self) -> Result<Value, TestError>
pub async fn screenshot(&mut self) -> Result<Value, TestError>
Take a screenshot and return base64-encoded PNG.
Sourcepub async fn invoke_command(
&mut self,
command: &str,
args: Option<Value>,
) -> Result<Value, TestError>
pub async fn invoke_command( &mut self, command: &str, args: Option<Value>, ) -> Result<Value, TestError>
Invoke a Tauri command by name with optional arguments.
Sourcepub async fn get_ipc_log(
&mut self,
limit: Option<usize>,
) -> Result<Value, TestError>
pub async fn get_ipc_log( &mut self, limit: Option<usize>, ) -> Result<Value, TestError>
Get the IPC call log.
Sourcepub async fn verify_state(
&mut self,
frontend_expr: &str,
backend_state: Value,
) -> Result<Value, TestError>
pub async fn verify_state( &mut self, frontend_expr: &str, backend_state: Value, ) -> Result<Value, TestError>
Verify frontend state against backend state.
Sourcepub async fn detect_ghost_commands(&mut self) -> Result<Value, TestError>
pub async fn detect_ghost_commands(&mut self) -> Result<Value, TestError>
Detect ghost commands (registered but never called, or called but not registered).
Sourcepub async fn check_ipc_integrity(&mut self) -> Result<Value, TestError>
pub async fn check_ipc_integrity(&mut self) -> Result<Value, TestError>
Check IPC call health (pending, stale, errored).
Sourcepub async fn assert_semantic(
&mut self,
expression: &str,
label: &str,
condition: &str,
expected: Value,
) -> Result<Value, TestError>
pub async fn assert_semantic( &mut self, expression: &str, label: &str, condition: &str, expected: Value, ) -> Result<Value, TestError>
Run a semantic assertion against a JS expression.
Sourcepub async fn audit_accessibility(&mut self) -> Result<Value, TestError>
pub async fn audit_accessibility(&mut self) -> Result<Value, TestError>
Run an accessibility audit.
Sourcepub async fn get_performance_metrics(&mut self) -> Result<Value, TestError>
pub async fn get_performance_metrics(&mut self) -> Result<Value, TestError>
Get performance metrics (timing, heap, resources).
Sourcepub async fn get_registry(&mut self) -> Result<Value, TestError>
pub async fn get_registry(&mut self) -> Result<Value, TestError>
Get the command registry.
Sourcepub async fn get_memory_stats(&mut self) -> Result<Value, TestError>
pub async fn get_memory_stats(&mut self) -> Result<Value, TestError>
Get process memory statistics.
Sourcepub async fn get_plugin_info(&mut self) -> Result<Value, TestError>
pub async fn get_plugin_info(&mut self) -> Result<Value, TestError>
Read plugin info (version, uptime, tool count).
Sourcepub async fn wait_for(
&mut self,
condition: &str,
timeout_ms: Option<u64>,
interval_ms: Option<u64>,
) -> Result<Value, TestError>
pub async fn wait_for( &mut self, condition: &str, timeout_ms: Option<u64>, interval_ms: Option<u64>, ) -> Result<Value, TestError>
Wait for a JS condition to become truthy, polling at an interval.
Sourcepub async fn start_recording(
&mut self,
session_id: Option<&str>,
) -> Result<Value, TestError>
pub async fn start_recording( &mut self, session_id: Option<&str>, ) -> Result<Value, TestError>
Start a time-travel recording session.
Sourcepub async fn stop_recording(&mut self) -> Result<Value, TestError>
pub async fn stop_recording(&mut self) -> Result<Value, TestError>
Stop the recording and return the session.
Sourcepub async fn export_session(&mut self) -> Result<Value, TestError>
pub async fn export_session(&mut self) -> Result<Value, TestError>
Export the current recording session as JSON.
Sourcepub fn session_id(&self) -> &str
pub fn session_id(&self) -> &str
Get the MCP session ID.