Version: 1.3.0
Test Runners
With a few lines of code, you can hook up Playwright to your favorite JavaScript test runner.
Jest / Jasmine#
For Jest, jest-playwright can be used. However for a light-weight solution, requiring playwright directly works fine. Jest shares it's syntax with Jasmine, so this applies to Jasmine as well.
AVA#
Tests run concurrently in AVA, so a single page variable cannot be shared between tests. Instead, create new pages with a macro function.
Mocha#
Mocha looks very similar to the Jest/Jasmine setup, and functions in the same way.
Multiple Browsers#
These simple examples can be extended to support multiple browsers using an environment variable.
Then set BROWSER=firefox to run your tests with firefox, or any other browser.