Your First Playwright Run
Running Playwright tests with Currents Dashboard
Integrating Currents with Playwright enables recording test results together with screenshots, videos, and traces to the cloud reporting service. That unlocks more effective troubleshooting, analytics and proactive monitoring, extending your team's workflows using REST API, WebHooks and built-in integration with Slack, GitHub etc.
Overview
Here's an overview of what steps you'll need to take to start running Playwright tests using the Currents dashboard and a CI:
Create an organization and a project
Install
@currents/playwright
npm packageEnable traces, videos and screenshots in
playwright.config.js|ts
to enhance the dashboard test resultsRun the tests using
pwc
CLI command or by configuring an extra reporterUpdate your CI provider configuration
Create an Organization and a Project
After signing up for the dashboard service, you will be prompted to create a new organization and a project. You can change their names later.
After creating a new organization and a project, you'll see on-screen instructions with your newly created Project ID and Record Key.
Select Playwright from the framework selection list and then choose the preferred installation method (see below).
Install @currents/playwright
package
@currents/playwright
packageUpdate playwright.config.js|ts
playwright.config.js|ts
Enabled traces, videos and screenshots in playwright.config.js|ts
to enhance the dashboard test results.
Create your first Playwright run
@currents/playwright
provides an executable script named pwc
- it runs playwright
with a predefined configuration.
Alternatively, you can add @currents/playwright
reporter to playwright.config.ts
Using pwc
CLI command
pwc
CLI commandRun pwc
to create your first Playwright run in Currents dashboard.
Set the Record Key, and Project ID obtained from Currents dashboard in the previous step.
Provide
--ci-build-id
to identify this run in the dashboard - the example above useshello-currents
as the build ID.
Please note that CI environments require generating the Build ID based on CI environment variables.
@currents/playwright
automatically detects the Build ID for popular CI providers, but in some cases, you need to define it explicitly.
We encourage you to invest 3 minutes into learning more about CI Build ID to prevent confusion during the setup.
Manually configuring @currents/playwright
reporter
@currents/playwright
reporterAlternatively, you can explicitly add the reporter to Playwright configuration:
You can also set environment variables to provide the configuration options to Currents reporter:
With the reporter configured, you can run npx playwright test
to start sending the results to Currents dashboard.
Explore the Newly Created Run
If Currents reporter is set up correctly, the execution results will show on the Currents dashboard. Additionally, a link to the recorded run will also be available at the end of the execution:
Please consider exploring those guides to ensure smooth configuration:
Now you can start configuring your CI environment to record Playwright tests to Currents.
Update CI Provider Configuration
Treat the Record Key as a CI secret - don't expose it publicly
In order to collect results from multiple CI runners, please make sure that --ci-build-id
is similar across parallel machines, but is unique for each build.
Currents support collecting results from parallel executions on multiple machines using the built-in Playwright Sharding and also Playwright Orchestration. The results will be kept as a single dashboard run as long as they share the same CI build ID.
Examples
Check out the example repositories that showcase running Playwright tests on popular CI providers and recording the results to Currents:
Explore @currents/playwright npm package documentation for configuration options.
Last updated