pub struct Expect { /* private fields */ }Expand description
Smart assertion builder for locators (Playwright’s expect())
Per spec: expect(score_display).to_have_text("10").await?;
Implementations§
Source§impl Expect
impl Expect
Sourcepub fn to_have_text(&self, expected: impl Into<String>) -> ExpectAssertion
pub fn to_have_text(&self, expected: impl Into<String>) -> ExpectAssertion
Assert the element has specific text
Sourcepub fn to_be_visible(&self) -> ExpectAssertion
pub fn to_be_visible(&self) -> ExpectAssertion
Assert the element is visible
Assert the element is hidden
Sourcepub fn to_have_count(&self, count: usize) -> ExpectAssertion
pub fn to_have_count(&self, count: usize) -> ExpectAssertion
Assert the element count
Sourcepub fn to_contain_text(&self, text: impl Into<String>) -> ExpectAssertion
pub fn to_contain_text(&self, text: impl Into<String>) -> ExpectAssertion
Assert the element contains text
Sourcepub fn to_be_enabled(&self) -> ExpectAssertion
pub fn to_be_enabled(&self) -> ExpectAssertion
Assert the element is enabled (not disabled)
Sourcepub fn to_be_disabled(&self) -> ExpectAssertion
pub fn to_be_disabled(&self) -> ExpectAssertion
Assert the element is disabled
Sourcepub fn to_be_checked(&self) -> ExpectAssertion
pub fn to_be_checked(&self) -> ExpectAssertion
Assert the element is checked (checkbox/radio)
Sourcepub fn to_be_editable(&self) -> ExpectAssertion
pub fn to_be_editable(&self) -> ExpectAssertion
Assert the element is editable
Sourcepub fn to_be_focused(&self) -> ExpectAssertion
pub fn to_be_focused(&self) -> ExpectAssertion
Assert the element is focused
Sourcepub fn to_be_empty(&self) -> ExpectAssertion
pub fn to_be_empty(&self) -> ExpectAssertion
Assert the element is empty
Sourcepub fn to_have_value(&self, value: impl Into<String>) -> ExpectAssertion
pub fn to_have_value(&self, value: impl Into<String>) -> ExpectAssertion
Assert the element has specific value
Sourcepub fn to_have_css(
&self,
property: impl Into<String>,
value: impl Into<String>,
) -> ExpectAssertion
pub fn to_have_css( &self, property: impl Into<String>, value: impl Into<String>, ) -> ExpectAssertion
Assert the element has specific CSS property value
Sourcepub fn to_have_class(&self, class: impl Into<String>) -> ExpectAssertion
pub fn to_have_class(&self, class: impl Into<String>) -> ExpectAssertion
Assert the element has specific class
Sourcepub fn to_have_id(&self, id: impl Into<String>) -> ExpectAssertion
pub fn to_have_id(&self, id: impl Into<String>) -> ExpectAssertion
Assert the element has specific ID
Sourcepub fn to_have_attribute(
&self,
name: impl Into<String>,
value: impl Into<String>,
) -> ExpectAssertion
pub fn to_have_attribute( &self, name: impl Into<String>, value: impl Into<String>, ) -> ExpectAssertion
Assert the element has specific attribute value
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Expect
impl RefUnwindSafe for Expect
impl Send for Expect
impl Sync for Expect
impl Unpin for Expect
impl UnsafeUnpin for Expect
impl UnwindSafe for Expect
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