pub struct Expectation { /* private fields */ }Implementations§
Source§impl Expectation
impl Expectation
pub fn with_timeout(self, timeout: f64) -> Self
Sourcepub fn to_be_visible(&self) -> Result<()>
pub fn to_be_visible(&self) -> Result<()>
Examples found in repository?
examples/basic.rs (line 34)
14fn main() -> Result<()> {
15 let app = TestApp::new(|| {
16 let state = Rc::new(RefCell::new(AppState::default()));
17 Application::new().window(
18 WindowBuilder::new()
19 .title("SUI Testing Example")
20 .root(ExampleRoot::new(state)),
21 )
22 })?;
23
24 let window = app.main_window()?;
25
26 window
27 .get_by_role(SemanticsRole::TextInput)
28 .with_name("Name")
29 .fill("Ada")?;
30 window
31 .get_by_role(SemanticsRole::Button)
32 .with_name("Save")
33 .click()?;
34 window.get_by_text("Saved").expect().to_be_visible()?;
35
36 println!("Example passed: filled the name field and observed the Saved status.");
37 Ok(())
38}pub fn to_be_focused(&self) -> Result<()>
pub fn to_have_text(&self, expected: impl AsRef<str>) -> Result<()>
pub fn to_have_value(&self, expected: impl AsRef<str>) -> Result<()>
pub fn to_have_count(&self, expected: usize) -> Result<()>
pub fn to_match_screenshot(&self, path: impl AsRef<Path>) -> Result<()>
Trait Implementations§
Source§impl Clone for Expectation
impl Clone for Expectation
Source§fn clone(&self) -> Expectation
fn clone(&self) -> Expectation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for Expectation
impl !Send for Expectation
impl !Sync for Expectation
impl !UnwindSafe for Expectation
impl Freeze for Expectation
impl Unpin for Expectation
impl UnsafeUnpin for Expectation
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more