Currents Playwright fixtures
Enhance Playwright functionality with Currents playwright fixtures
Last updated
Enhance Playwright functionality with Currents playwright fixtures
Last updated
Requires @currents/playwright
1.7.0+
Playwright custom fixtures is an important concept in Playwright ecosystem - fixtures allow augmenting and modifying the behaviour of Playwright tests at runtime.
Current integration with Playwright includes a couple of The @currents/playwright
package provides some fixtures for integrating with advanced Currents features like:
The baseFixtures
are required for loading the currents config for the other Currents fixtures. You will also want to include any Currents fixture you plan on using. Here is Playwright coverage as an example:
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 wan to use Playwright's mergeTests helper to combind fixtures from multiple modules. The merged result should be exported and used in your tests.
See for details