Currents Fixtures for Playwright
Enhance Playwright functionality with Currents fixtures for Playwright
Last updated
Enhance Playwright functionality with Currents fixtures for Playwright
Last updated
Requires @currents/playwright
1.7.0+
is an important concept in Playwright ecosystem that allow augmenting and modifying the behaviour of Playwright tests.
Current integration with Playwright includes a several fixtures for enabling advanced Currents features like:
We pick up the configuration automatically from the currents.config.js|ts
file - if you created the file you can skip this step. If you explicitly provide config to the Currents reporter in your playwright.config.ts
you will also need to pass that same config to the fixture like this:
Import the new test
implementation and use it in your tests where you want to use the features provided by the fixtures (or Combine Currents fixtures with existing custom fixtures).
If you want to test that fixtures are loading, you can confirm that the currentsConfig
is loaded by calling the fixture in one of the tests, and printing it’s result.
If you already have your own custom fixtures, you will want to use to combined fixtures from multiple modules. The merged result should be exported and used in your tests.
After extending the test
method, many Currents fixtures are enabled by default. If you wish to only conditionally enable them (such as only in CI) you can use the currentsFixturesEnabled
property in your playwright.config.ts
file.
See for details