thirtyfour::extensions::query

Struct ElementWaiter

Source
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

Source

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.

Source

pub fn error(self, message: &str) -> Self

Provide a human-readable error message to be returned in the case of timeout.

Source

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.

Source

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.

Source

pub async fn condition(self, f: ElementPredicate) -> WebDriverResult<()>

Source

pub async fn conditions( self, conditions: Vec<ElementPredicate>, ) -> WebDriverResult<()>

Source

pub async fn stale(self) -> WebDriverResult<()>

Source

pub async fn displayed(self) -> WebDriverResult<()>

Source

pub async fn not_displayed(self) -> WebDriverResult<()>

Source

pub async fn selected(self) -> WebDriverResult<()>

Source

pub async fn not_selected(self) -> WebDriverResult<()>

Source

pub async fn enabled(self) -> WebDriverResult<()>

Source

pub async fn not_enabled(self) -> WebDriverResult<()>

Source

pub async fn clickable(self) -> WebDriverResult<()>

Source

pub async fn not_clickable(self) -> WebDriverResult<()>

Source

pub async fn has_class<N>(self, class_name: N) -> WebDriverResult<()>
where N: Needle + Clone + Send + Sync + 'static,

Source

pub async fn lacks_class<N>(self, class_name: N) -> WebDriverResult<()>
where N: Needle + Clone + Send + Sync + 'static,

Source

pub async fn has_text<N>(self, text: N) -> WebDriverResult<()>
where N: Needle + Clone + Send + Sync + 'static,

Source

pub async fn lacks_text<N>(self, text: N) -> WebDriverResult<()>
where N: Needle + Clone + Send + Sync + 'static,

Source

pub async fn has_value<N>(self, value: N) -> WebDriverResult<()>
where N: Needle + Clone + Send + Sync + 'static,

Source

pub async fn lacks_value<N>(self, value: N) -> WebDriverResult<()>
where N: Needle + Clone + Send + Sync + 'static,

Source

pub async fn has_attribute<S, N>( self, attribute_name: S, value: N, ) -> WebDriverResult<()>
where S: Into<String>, N: Needle + Clone + Send + Sync + 'static,

Source

pub async fn lacks_attribute<S, N>( self, attribute_name: S, value: N, ) -> WebDriverResult<()>
where S: Into<String>, N: Needle + Clone + Send + Sync + 'static,

Source

pub async fn has_attributes<S, N>( self, desired_attributes: &[(S, N)], ) -> WebDriverResult<()>
where S: Into<String> + Clone, N: Needle + Clone + Send + Sync + 'static,

Source

pub async fn lacks_attributes<S, N>( self, desired_attributes: &[(S, N)], ) -> WebDriverResult<()>
where S: Into<String> + Clone, N: Needle + Clone + Send + Sync + 'static,

Source

pub async fn has_property<S, N>( self, property_name: S, value: N, ) -> WebDriverResult<()>
where S: Into<String>, N: Needle + Clone + Send + Sync + 'static,

Source

pub async fn lacks_property<S, N>( self, property_name: S, value: N, ) -> WebDriverResult<()>
where S: Into<String>, N: Needle + Clone + Send + Sync + 'static,

Source

pub async fn has_properties<S, N>( self, desired_properties: &[(S, N)], ) -> WebDriverResult<()>
where S: Into<String> + Clone, N: Needle + Clone + Send + Sync + 'static,

Source

pub async fn lacks_properties<S, N>( self, desired_properties: &[(S, N)], ) -> WebDriverResult<()>
where S: Into<String> + Clone, N: Needle + Clone + Send + Sync + 'static,

Source

pub async fn has_css_property<S, N>( self, css_property_name: S, value: N, ) -> WebDriverResult<()>
where S: Into<String>, N: Needle + Clone + Send + Sync + 'static,

Source

pub async fn lacks_css_property<S, N>( self, css_property_name: S, value: N, ) -> WebDriverResult<()>
where S: Into<String>, N: Needle + Clone + Send + Sync + 'static,

Source

pub async fn has_css_properties<S, N>( self, desired_css_properties: &[(S, N)], ) -> WebDriverResult<()>
where S: Into<String> + Clone, N: Needle + Clone + Send + Sync + 'static,

Source

pub async fn lacks_css_properties<S, N>( self, desired_css_properties: &[(S, N)], ) -> WebDriverResult<()>
where S: Into<String> + Clone, N: Needle + Clone + Send + Sync + 'static,

Trait Implementations§

Source§

impl Debug for ElementWaiter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more