pub struct AutomationSession { /* private fields */ }Expand description
面向 AI Agent 与 Playwright 级 E2E 自动化测试的统一会话控制器。
Implementations§
Source§impl AutomationSession
impl AutomationSession
pub fn new() -> Self
Sourcepub fn collect_nodes(&mut self, engine: &VeloxEngine) -> Vec<AccessKitNodeData>
pub fn collect_nodes(&mut self, engine: &VeloxEngine) -> Vec<AccessKitNodeData>
采集当前 VeloxEngine 的全部无障碍语义节点列表。
Sourcepub fn query_nodes(
&mut self,
engine: &VeloxEngine,
q: &SemanticQuery,
) -> Vec<AccessKitNodeData>
pub fn query_nodes( &mut self, engine: &VeloxEngine, q: &SemanticQuery, ) -> Vec<AccessKitNodeData>
按查询条件检索匹配的语义节点。
Sourcepub fn snapshot_json(&mut self, engine: &VeloxEngine) -> String
pub fn snapshot_json(&mut self, engine: &VeloxEngine) -> String
导出结构化 JSON 语义树快照(可直接喂给 LLM / MCP Client)。
Sourcepub fn execute(
&mut self,
engine: &mut VeloxEngine,
action: SemanticAction,
) -> AutomationResult
pub fn execute( &mut self, engine: &mut VeloxEngine, action: SemanticAction, ) -> AutomationResult
执行结构化语义动作并自动步进引擎帧循环。
Sourcepub fn handle_mcp_request(
&mut self,
engine: &mut VeloxEngine,
req_json: &str,
) -> String
pub fn handle_mcp_request( &mut self, engine: &mut VeloxEngine, req_json: &str, ) -> String
处理标准 MCP (Model Context Protocol) JSON-RPC 2.0 请求并返回 JSON 响应字符串。
内置支持方法:
initializetools/listtools/call(velox_snapshot_tree、velox_click、velox_click_label、velox_fill、velox_scroll、velox_wait_idle)
Trait Implementations§
Auto Trait Implementations§
impl Forget for AutomationSession
impl Freeze for AutomationSession
impl Move for AutomationSession
impl RefUnwindSafe for AutomationSession
impl Send for AutomationSessionwhere
RawVecInner: Send,
impl Sync for AutomationSessionwhere
RawVecInner: Sync,
impl Unpin for AutomationSession
impl UnsafeUnpin for AutomationSession
impl UnwindSafe for AutomationSessionwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FluentBuilder for T
impl<T> FluentBuilder for T
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
当
condition 为 true 时执行闭包修饰自身,否则原样返回。Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Self
fn when_else( self, condition: bool, then: impl FnOnce(Self) -> Self, else_fn: impl FnOnce(Self) -> Self, ) -> Self
根据
condition 在两个修饰分支之间二选一。Source§fn when_some<O>(
self,
option: Option<O>,
then: impl FnOnce(Self, O) -> Self,
) -> Self
fn when_some<O>( self, option: Option<O>, then: impl FnOnce(Self, O) -> Self, ) -> Self
当
option 为 Some(value) 时执行闭包修饰自身,否则原样返回。