A FitNesse fixture for writing browser tests using the Playwright Java API. Based on and inspired by the HSAC fixtures.
Only a subset of the available Playwright commands is currently implemented in this fixture.
This fixture requires Java 11 or newer
- Make sure the HSAC fixtures are present in your project
- Add the fixture as Maven dependency to your FitNesse project.
<dependency>
<groupId>nl.praegus</groupId>
<artifactId>toolchain-playwright-fixture</artifactId>
<version>1.8.1</version>
</dependency>
- Add the fixture to the project imports. For example:
|Import |
|nl.hsac.fitnesse.fixture |
|nl.hsac.fitnesse.fixture.slim |
|nl.praegus.fitnesse.slim.fixtures.playwright|
- To configure and start a browser, use the
playwright setup
fixture.
|script |playwright setup |
|set headless |false |
|set viewport width|1920|and height|1080|
|start browser |chromium |
- Start writing tests using the
playwright fixture
^|script| playwright fixture |
|navigate to |https://praegus.nl/ |
|click |text=Plan een proof of concept |
|assert that page has url|https://praegus.nl/proof-of-concept-aanvraagformulier/|
|ensure |is visible |text=Proof of Concept Aanvraagformulier |
The first time the fixture is used Playwright will download the Chromium, Firefox and Webkit browsers from the Microsoft CDN. This may take some time. If you are behind a firewall or proxy downloading the browsers might be blocked. The Playwright documentation offers the following solution: Install behind a firewall or a proxy