Enum ElementState
pub enum ElementState {
Attached,
Detached,
Visible,
Hidden,
Enabled,
Disabled,
Focused,
Unfocused,
}Expand description
Desired element state for wait_for operations.
Basic variants (Attached, Detached, Visible, Hidden, Enabled,
Disabled, Focused, Unfocused) cover common cases. For arbitrary
conditions, use [Locator::wait_until] with a closure.
Variants§
Attached
Wait until an element matching the selector exists in the tree.
Detached
Wait until no element matches the selector.
Visible
Wait until a matching element exists and is visible.
Hidden
Wait until a matching element is hidden or doesn’t exist.
Enabled
Wait until a matching element is enabled.
Disabled
Wait until a matching element is disabled (exists but not enabled).
Focused
Wait until a matching element has keyboard focus.
Unfocused
Wait until a matching element does not have keyboard focus.
Implementations§
§impl ElementState
impl ElementState
pub fn is_met(self, node: Option<&Node>) -> bool
pub fn is_met(self, node: Option<&Node>) -> bool
Evaluate whether the condition is met for the given node.
node is None when no element matched the selector.
pub fn is_absence_state(self) -> bool
pub fn is_absence_state(self) -> bool
Whether this state represents an “absent” condition where the node may not exist in the tree when the condition is met.
Trait Implementations§
§impl Clone for ElementState
impl Clone for ElementState
§fn clone(&self) -> ElementState
fn clone(&self) -> ElementState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more