Skip to main content

UserInterfaceTestingExtension

Trait UserInterfaceTestingExtension 

Source
pub trait UserInterfaceTestingExtension {
    // Required methods
    fn click(&mut self, position: Vector2<f32>);
    fn click_at(&mut self, uuid: Uuid) -> Handle<UiNode>;
    fn click_at_text(&mut self, uuid: Uuid, text: &str);
    fn find_by_uuid(&self, uuid: Uuid) -> Option<&UiNode>;
    fn find_by_uuid_of<T: Control>(&self, uuid: Uuid) -> Option<&T>;
    fn poll_all_messages(&mut self);
    fn poll_and_count(&mut self, pred: impl FnMut(&UiMessage) -> bool) -> usize;
    fn click_at_count_response<M: MessageData + PartialEq>(
        &mut self,
        name: Uuid,
        response: M,
    ) -> usize;
    fn type_text(&mut self, text: &str);

    // Provided method
    fn is_visible(&self, uuid: Uuid) -> bool { ... }
}

Required Methods§

Source

fn click(&mut self, position: Vector2<f32>)

Clicks at the given position.

Source

fn click_at(&mut self, uuid: Uuid) -> Handle<UiNode>

Tries to find a widget with the given unique id and clicks at its center.

Source

fn click_at_text(&mut self, uuid: Uuid, text: &str)

Source

fn find_by_uuid(&self, uuid: Uuid) -> Option<&UiNode>

Source

fn find_by_uuid_of<T: Control>(&self, uuid: Uuid) -> Option<&T>

Source

fn poll_all_messages(&mut self)

Source

fn poll_and_count(&mut self, pred: impl FnMut(&UiMessage) -> bool) -> usize

Source

fn click_at_count_response<M: MessageData + PartialEq>( &mut self, name: Uuid, response: M, ) -> usize

Source

fn type_text(&mut self, text: &str)

Provided Methods§

Source

fn is_visible(&self, uuid: Uuid) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§