Skip to main content

Module expect

Module expect 

Source
Expand description

Assertion API for browser automation tests.

The expect function creates assertion builders for locators and pages, enabling fluent async assertions.

§Example

use viewpoint_test::{expect, expect_page};

// Assert element is visible
let locator = page.locator("h1");
expect(&locator).to_be_visible().await.unwrap();

// Assert text content
expect(&locator).to_have_text("Example Domain").await.unwrap();

// Assert page URL
expect_page(&page).to_have_url("https://example.com/").await.unwrap();

Structs§

LocatorAssertions
Assertions for locators (elements).
PageAssertions
Assertions for pages.
SoftAssertionError
Collection of soft assertion errors.
SoftAssertions
A context for collecting soft assertions.
SoftLocatorAssertions
Soft assertions for locators.
SoftPageAssertions
Soft assertions for pages.

Traits§

Expectable
Trait for creating assertions from different types.

Functions§

expect
Create assertions for a locator.
expect_page
Create assertions for a page.