Expectations Class

The entry point of the web-first assertions, as Assertions.Expect in Playwright. Import it with using static Meziantou.AspNetCore.Testing.Expectations;, then write await Expect(page.GetByRole("status")).ToHaveTextAsync("Saved");.

public static class Expectations

Methods

NameDescription
Expect(Locator)Gets the assertions of a locator.
Expect(TestPage)Gets the assertions of a page.

Expect overloads

Expect(Locator)

Expectations.cs

Gets the assertions of a locator.

public static LocatorAssertions Expect(Locator locator)
Parameters
locator Locator
The locator.
Returns

LocatorAssertions The assertions.

Expect(TestPage)

Expectations.cs

Gets the assertions of a page.

public static PageAssertions Expect(TestPage page)
Parameters
page TestPage
The page.
Returns

PageAssertions The assertions.