Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

8 Commits

Repository files navigation

playwright-java-soft-assertions

playwright-java-soft-assertions gives you the ability to use Playwright's built in web-first assertions with soft assertions.

Installation

<dependency>
<groupId>io.github.uchagani</groupId>
<artifactId>playwright-java-soft-assertions</artifactId>
<version>1.0.1</version>
</dependency>

Usage

Using playwright-java-soft-assertions is similar to other soft assertion implementations:

  1. Create an instance of the SoftAssertions object
  2. Use the soft assertions object to make calls to Playwright's assertions
  3. Call the assertAll() method when you're done.
importio.github.uchagani.playwright.assertions.SoftAssertions;
publicclassFooTest {
@Testpublicvoidtest() {
LocatorsomeButton = page.locator("#some-id");
LocatorsomeLabel = page.locator(".my-label");
SoftAssertionssoftly = SoftAssertions.create();
softly.assertThat(someButton).isEnabled();
softly.assertThat(someLabel).hasText("foo");
softly.assertAll();
}
}

All Playwright assertions are supported by playwright-java-soft-assertions including Page, Locator, and APIResponse.

About

playwright-java-soft-assertions gives you soft assertions to use with Playwright!

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages