For the complete documentation index, see llms.txt. This page is also available as Markdown.

Quick Start

Running Playwright tests with Currents Dashboard

Connect Playwright to Currents in a few minutes and start seeing runs, screenshots, videos, and traces in one place. This guide keeps the setup minimal so you can go from "tests run locally" to "results show up in Currents" without extra ceremony.

Prerequisites

  • An account - sign up for a free trial.

  • NodeJS v18.17.0+

  • Playwright v1.40.1+ works well.

    • If you're using Playwright v1.60.0+ you'll require @currents/playwright 2.0.0+, see Compatibility Guide.

To have a coding agent do the setup, see Set Up with an AI Agent.

Setup Currents

1

Create a Project

After you sign up, Currents asks you to name your organization and answer a few questions about your team. Then create your first project: the name is taken from your organization name, and you can change both later. Click Create project and show me the setup.

The first project form: a project name field and a button that opens the setup instructions

The setup page opens on Local Setup. Select Playwright as the testing framework. Project Credentials shows your Project ID and Record Key. Keep that page open for the next steps.

2

Install @currents/playwright

Install the native Playwright reporter with your project's package manager.

npm i -D @currents/playwright

If you use pnpm, yarn, or bun, run the equivalent dev dependency install command instead.

3

Create currents.config.ts

Create currents.config.ts next to playwright.config.ts, usually in the project root. If your Playwright config uses .js or .mjs, use that same extension for currents.config, and remove the type import and the !.

currents.config.ts
import { CurrentsConfig } from "@currents/playwright";

const config: CurrentsConfig = {
  recordKey: process.env.CURRENTS_RECORD_KEY!,
  projectId: process.env.CURRENTS_PROJECT_ID!,
};

export default config;
4

Enable artifacts

Update playwright.config.ts so every recorded run includes traces, videos, and screenshots.

use: {
    // ...
    trace: "retain-on-failure-and-retries",
    video: "retain-on-failure",
    screenshot: "on",
}

These artifacts are what make the dashboard useful from the first run, so it is worth enabling all three up front.

5

Setup Currents Reporter

You have two ways to finish the integration:

Most teams should start with the Currents Reporter because it keeps the existing Playwright command unchanged.

Option 2: Run tests with the pwc command

pwc is a lightweight command-line executable included in @currents/playwright. It runs Playwright with Currents wired in for you.

Setup

  • Run npx pwc.

  • Or update package.json to execute pwc instead of playwright test.

"scripts": {
  ...
  "test": "npx pwc",
},

How it works

  • pwc reads the configuration from currents.config.ts file. See additional configuration options Configuration.

  • pwc injects Currents reporter into Playwright configuration.

  • You can also provide CLI configuration parameters, e.g. npx pwc --key RECORD_KEY --project-id PROJECT_ID

Create your first run

After setup, run Playwright and watch results get streamed in real-time to Currents. Here's the command for the same:

CURRENTS_PROJECT_ID=<project-id> CURRENTS_RECORD_KEY=<record-key> npx playwright test

You can find both the CURRENTS_PROJECT_ID as well as the CURRENTS_RECORD_KEY in the Currents dashboard.

A link to the recorded run will be available at the start of the execution:

Open the link to see the run in the dashboard.

Next Step

Once your Playwright project is set up and reporting locally, configure your CI pipeline.

Running tests in CI is where you get consistent, repeatable feedback on every pull request and deployment, not just on your local machine.

CI Setup

Last updated

Was this helpful?