pub struct ElementFinder<'a, R>where
R: Renderer,{ /* private fields */ }Expand description
A finder for locating and interacting with UI elements.
Finders are created by calling methods on RobotTestRule like
find_by_text() or find_at_position().
Implementations§
Source§impl<'a, R> ElementFinder<'a, R>
impl<'a, R> ElementFinder<'a, R>
Sourcepub fn bounds(&mut self) -> Option<Rect>
pub fn bounds(&mut self) -> Option<Rect>
Get the bounds of the found element.
Returns None if the element doesn’t exist or doesn’t have bounds.
Sourcepub fn click(&mut self) -> bool
pub fn click(&mut self) -> bool
Click on this element at its center.
Returns true if the element was found and clicked.
Sourcepub fn long_press(&mut self) -> bool
pub fn long_press(&mut self) -> bool
Perform a long press on this element.
This holds the pointer down for a duration before releasing.
Sourcepub fn assert_exists(&mut self)
pub fn assert_exists(&mut self)
Assert that this element exists.
Panics if the element is not found.
Sourcepub fn assert_not_exists(&mut self)
pub fn assert_not_exists(&mut self)
Assert that this element does not exist.
Panics if the element is found.
Auto Trait Implementations§
impl<'a, R> Freeze for ElementFinder<'a, R>
impl<'a, R> !RefUnwindSafe for ElementFinder<'a, R>
impl<'a, R> !Send for ElementFinder<'a, R>
impl<'a, R> !Sync for ElementFinder<'a, R>
impl<'a, R> Unpin for ElementFinder<'a, R>
impl<'a, R> !UnwindSafe for ElementFinder<'a, R>
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