pub struct LocatorAssertions<'a> { /* private fields */ }Expand description
Assertions for locators (elements).
Implementations§
Source§impl<'a> LocatorAssertions<'a>
impl<'a> LocatorAssertions<'a>
Sourcepub fn new(locator: &'a Locator<'a>) -> Self
pub fn new(locator: &'a Locator<'a>) -> Self
Create a new LocatorAssertions for the given locator.
Sourcepub fn negated(self) -> Self
pub fn negated(self) -> Self
Negate the assertion.
This is an alias for the not method to avoid conflict with std::ops::Not.
Sourcepub fn not(self) -> Self
pub fn not(self) -> Self
Negate the assertion.
Note: This method name shadows the Not trait’s method. Use negated() if
you need to avoid this conflict.
Sourcepub async fn to_be_visible(&self) -> Result<(), AssertionError>
pub async fn to_be_visible(&self) -> Result<(), AssertionError>
Assert that the element is visible.
§Errors
Returns an error if the assertion fails or the element cannot be queried.
Assert that the element is hidden.
§Errors
Returns an error if the assertion fails or the element cannot be queried.
Sourcepub async fn to_have_text(&self, expected: &str) -> Result<(), AssertionError>
pub async fn to_have_text(&self, expected: &str) -> Result<(), AssertionError>
Assert that the element has the exact text content.
§Errors
Returns an error if the assertion fails or the element cannot be queried.
Sourcepub async fn to_contain_text(
&self,
expected: &str,
) -> Result<(), AssertionError>
pub async fn to_contain_text( &self, expected: &str, ) -> Result<(), AssertionError>
Assert that the element contains the specified text.
§Errors
Returns an error if the assertion fails or the element cannot be queried.
Sourcepub async fn to_have_attribute(
&self,
name: &str,
value: &str,
) -> Result<(), AssertionError>
pub async fn to_have_attribute( &self, name: &str, value: &str, ) -> Result<(), AssertionError>
Assert that the element has the specified attribute value.
§Errors
Returns an error if the assertion fails or the element cannot be queried.
Sourcepub async fn to_have_class(
&self,
class_name: &str,
) -> Result<(), AssertionError>
pub async fn to_have_class( &self, class_name: &str, ) -> Result<(), AssertionError>
Assert that the element has the specified class.
§Errors
Returns an error if the assertion fails or the element cannot be queried.
Sourcepub async fn to_be_enabled(&self) -> Result<(), AssertionError>
pub async fn to_be_enabled(&self) -> Result<(), AssertionError>
Assert that the element is enabled.
§Errors
Returns an error if the assertion fails or the element cannot be queried.
Sourcepub async fn to_be_disabled(&self) -> Result<(), AssertionError>
pub async fn to_be_disabled(&self) -> Result<(), AssertionError>
Assert that the element is disabled.
§Errors
Returns an error if the assertion fails or the element cannot be queried.
Sourcepub async fn to_be_checked(&self) -> Result<(), AssertionError>
pub async fn to_be_checked(&self) -> Result<(), AssertionError>
Assert that the element is checked (for checkboxes/radios).
§Errors
Returns an error if the assertion fails or the element cannot be queried.