Skip to main content

VictauriClient

Struct VictauriClient 

Source
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

Source

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.

Source

pub async fn connect_with_token( port: u16, token: Option<&str>, ) -> Result<Self, TestError>

Connect with an optional Bearer auth token.

Source

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.

Source

pub async fn eval_js(&mut self, code: &str) -> Result<Value, TestError>

Evaluate JavaScript in the webview and return the result.

Source

pub async fn dom_snapshot(&mut self) -> Result<Value, TestError>

Get a DOM snapshot of the current page.

Source

pub async fn click(&mut self, ref_id: &str) -> Result<Value, TestError>

Click an element by ref handle ID.

Source

pub async fn fill( &mut self, ref_id: &str, value: &str, ) -> Result<Value, TestError>

Fill an input element with a value.

Source

pub async fn type_text( &mut self, ref_id: &str, text: &str, ) -> Result<Value, TestError>

Type text into an element character by character.

Source

pub async fn list_windows(&mut self) -> Result<Value, TestError>

List all window labels.

Source

pub async fn get_window_state( &mut self, label: Option<&str>, ) -> Result<Value, TestError>

Get the state of a specific window (or all windows).

Source

pub async fn screenshot(&mut self) -> Result<Value, TestError>

Take a screenshot and return base64-encoded PNG.

Source

pub async fn invoke_command( &mut self, command: &str, args: Option<Value>, ) -> Result<Value, TestError>

Invoke a Tauri command by name with optional arguments.

Source

pub async fn get_ipc_log( &mut self, limit: Option<usize>, ) -> Result<Value, TestError>

Get the IPC call log.

Source

pub async fn verify_state( &mut self, frontend_expr: &str, backend_state: Value, ) -> Result<Value, TestError>

Verify frontend state against backend state.

Source

pub async fn detect_ghost_commands(&mut self) -> Result<Value, TestError>

Detect ghost commands (registered but never called, or called but not registered).

Source

pub async fn check_ipc_integrity(&mut self) -> Result<Value, TestError>

Check IPC call health (pending, stale, errored).

Source

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.

Source

pub async fn audit_accessibility(&mut self) -> Result<Value, TestError>

Run an accessibility audit.

Source

pub async fn get_performance_metrics(&mut self) -> Result<Value, TestError>

Get performance metrics (timing, heap, resources).

Source

pub async fn get_registry(&mut self) -> Result<Value, TestError>

Get the command registry.

Source

pub async fn get_memory_stats(&mut self) -> Result<Value, TestError>

Get process memory statistics.

Source

pub async fn get_plugin_info(&mut self) -> Result<Value, TestError>

Read plugin info (version, uptime, tool count).

Source

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.

Source

pub async fn start_recording( &mut self, session_id: Option<&str>, ) -> Result<Value, TestError>

Start a time-travel recording session.

Source

pub async fn stop_recording(&mut self) -> Result<Value, TestError>

Stop the recording and return the session.

Source

pub async fn export_session(&mut self) -> Result<Value, TestError>

Export the current recording session as JSON.

Source

pub fn base_url(&self) -> &str

Get the server base URL.

Source

pub fn session_id(&self) -> &str

Get the MCP session ID.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more