Skip to main content

TestQueryExt

Trait TestQueryExt 

Source
pub trait TestQueryExt {
    // Required methods
    fn elements(&self) -> Vec<ElementSnapshot>;
    fn texts(&self) -> Vec<TextSnapshot>;
    fn find_by_label(&self, label: &str) -> ElementSnapshot;
    fn try_find_by_label(&self, label: &str) -> Option<ElementSnapshot>;
    fn find_all_by_label(&self, label: &str) -> Vec<ElementSnapshot>;
    fn find_all_by_role(&self, role: Role) -> Vec<ElementSnapshot>;
}
Expand description

Accessibility-oriented observation queries over a Window or ScopedWindow.

Required Methods§

Source

fn elements(&self) -> Vec<ElementSnapshot>

Returns all observed elements in the current scope from the last completed frame (including invisible ones), ordered by (y, x, path).

Source

fn texts(&self) -> Vec<TextSnapshot>

Returns observed text runs painted in the current scope during the last frame.

Source

fn find_by_label(&self, label: &str) -> ElementSnapshot

Returns the uniquely matching element whose exact, case-sensitive native accessibility label equals label. Panics on absence or ambiguity.

Source

fn try_find_by_label(&self, label: &str) -> Option<ElementSnapshot>

Returns the uniquely matching element with accessibility label label, or None if absent. Panics on ambiguity.

Source

fn find_all_by_label(&self, label: &str) -> Vec<ElementSnapshot>

Returns all elements with exact accessibility label label, ordered by (y, x, path).

Source

fn find_all_by_role(&self, role: Role) -> Vec<ElementSnapshot>

Returns all elements with native AccessKit Role role, ordered by (y, x, path).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl TestQueryExt for Window

Implementors§