pub trait TestTextExt: IntoElement + Sized {
// Provided methods
fn test_text(
self,
text: impl Into<SharedString>,
) -> ObservedTextElement<Self::Element> { ... }
fn test_alt_text(
self,
text: impl Into<SharedString>,
) -> ObservedTextElement<Self::Element> { ... }
}Expand description
Records the text an element displays, for text queries in UI tests. Text components call it with the text they render, so plain text needs no element id.
Provided Methods§
Sourcefn test_text(
self,
text: impl Into<SharedString>,
) -> ObservedTextElement<Self::Element>
fn test_text( self, text: impl Into<SharedString>, ) -> ObservedTextElement<Self::Element>
With test-support, records text each time the element paints.
Otherwise returns the element it builds.
Sourcefn test_alt_text(
self,
text: impl Into<SharedString>,
) -> ObservedTextElement<Self::Element>
fn test_alt_text( self, text: impl Into<SharedString>, ) -> ObservedTextElement<Self::Element>
Like Self::test_text for an image’s alternative text, which
stands in for what the element draws.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".