Skip to main content

Module assertions

Module assertions 

Source
Expand description

Playwright-style expect(locator) / expect(page) assertions.

Each assertion polls its underlying Locator / Page method every ~100ms until the condition holds, or the assertion timeout (default 5s) elapses, in which case Error::Timeout is returned with a message naming the assertion and the actual-vs-expected values.

Negation via LocatorAssertions::not / PageAssertions::not flips the sense: a negated assertion succeeds when the base condition is false within the timeout.

Structs§

LocatorAssertions
Assertions over a Locator, produced by expect.
PageAssertions
Assertions over a Page, produced by expect_page.
ScreenshotAssertOptions
Options for LocatorAssertions::to_have_screenshot.

Functions§

expect
Construct LocatorAssertions for locator, mirroring Playwright’s expect(locator).
expect_page
Construct PageAssertions for page. Mirrors Playwright’s expect(page). (Distinct name from expect because Rust cannot overload expect on the parameter type without a trait.)