public interface PlaywrightAssertions
PlaywrightAssertions class provides convenience methods for creating assertions that will wait until the expected
condition is met.
Consider the following example:
{@code
...
import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;
public class TestExample {
...| Modifier and Type | Method and Description |
|---|---|
static LocatorAssertions |
assertThat(Locator locator)
Creates a
LocatorAssertions object for the given Locator. |
static PageAssertions |
assertThat(Page page)
Creates a
PageAssertions object for the given Page. |
static LocatorAssertions assertThat(Locator locator)
LocatorAssertions object for the given Locator.
PlaywrightAssertions.assertThat(locator).isVisible();
locator - Locator object to use for assertions.static PageAssertions assertThat(Page page)
PageAssertions object for the given Page.
PlaywrightAssertions.assertThat(page).hasTitle("News");
page - Page object to use for assertions.Copyright © 2021. All rights reserved.