pub struct ElementWaiter { /* private fields */ }
Expand description
High-level interface for performing explicit waits using the builder pattern.
§Example:
let elem = driver.query(By::Id("button1")).first().await?;
// Wait until the element is displayed.
elem.wait_until().displayed().await?;
Implementations§
Source§impl ElementWaiter
impl ElementWaiter
Sourcepub fn with_poller(
self,
poller: Box<dyn IntoElementPoller + Send + Sync>,
) -> Self
pub fn with_poller( self, poller: Box<dyn IntoElementPoller + Send + Sync>, ) -> Self
Use the specified ElementPoller for this ElementWaiter. This will not affect the default ElementPoller used for other waits.
Sourcepub fn error(self, message: &str) -> Self
pub fn error(self, message: &str) -> Self
Provide a human-readable error message to be returned in the case of timeout.
Sourcepub fn ignore_errors(self, ignore: bool) -> Self
pub fn ignore_errors(self, ignore: bool) -> Self
By default a waiter will ignore any errors that occur while polling for the desired condition(s). However, this behaviour can be modified so that the waiter will return early if an error is returned from thirtyfour.
Sourcepub fn wait(self, timeout: Duration, interval: Duration) -> Self
pub fn wait(self, timeout: Duration, interval: Duration) -> Self
Force this ElementWaiter to wait for the specified timeout, polling once after each interval. This will override the poller for this ElementWaiter only.
pub async fn condition(self, f: ElementPredicate) -> WebDriverResult<()>
pub async fn conditions( self, conditions: Vec<ElementPredicate>, ) -> WebDriverResult<()>
pub async fn stale(self) -> WebDriverResult<()>
pub async fn displayed(self) -> WebDriverResult<()>
pub async fn not_displayed(self) -> WebDriverResult<()>
pub async fn selected(self) -> WebDriverResult<()>
pub async fn not_selected(self) -> WebDriverResult<()>
pub async fn enabled(self) -> WebDriverResult<()>
pub async fn not_enabled(self) -> WebDriverResult<()>
pub async fn clickable(self) -> WebDriverResult<()>
pub async fn not_clickable(self) -> WebDriverResult<()>
pub async fn has_class<N>(self, class_name: N) -> WebDriverResult<()>
pub async fn lacks_class<N>(self, class_name: N) -> WebDriverResult<()>
pub async fn has_text<N>(self, text: N) -> WebDriverResult<()>
pub async fn lacks_text<N>(self, text: N) -> WebDriverResult<()>
pub async fn has_value<N>(self, value: N) -> WebDriverResult<()>
pub async fn lacks_value<N>(self, value: N) -> WebDriverResult<()>
pub async fn has_attribute<S, N>( self, attribute_name: S, value: N, ) -> WebDriverResult<()>
pub async fn lacks_attribute<S, N>( self, attribute_name: S, value: N, ) -> WebDriverResult<()>
pub async fn has_attributes<S, N>( self, desired_attributes: &[(S, N)], ) -> WebDriverResult<()>
pub async fn lacks_attributes<S, N>( self, desired_attributes: &[(S, N)], ) -> WebDriverResult<()>
pub async fn has_property<S, N>( self, property_name: S, value: N, ) -> WebDriverResult<()>
pub async fn lacks_property<S, N>( self, property_name: S, value: N, ) -> WebDriverResult<()>
pub async fn has_properties<S, N>( self, desired_properties: &[(S, N)], ) -> WebDriverResult<()>
pub async fn lacks_properties<S, N>( self, desired_properties: &[(S, N)], ) -> WebDriverResult<()>
pub async fn has_css_property<S, N>( self, css_property_name: S, value: N, ) -> WebDriverResult<()>
pub async fn lacks_css_property<S, N>( self, css_property_name: S, value: N, ) -> WebDriverResult<()>
pub async fn has_css_properties<S, N>( self, desired_css_properties: &[(S, N)], ) -> WebDriverResult<()>
pub async fn lacks_css_properties<S, N>( self, desired_css_properties: &[(S, N)], ) -> WebDriverResult<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ElementWaiter
impl !RefUnwindSafe for ElementWaiter
impl Send for ElementWaiter
impl Sync for ElementWaiter
impl Unpin for ElementWaiter
impl !UnwindSafe for ElementWaiter
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