@currents/playwright
TypeScript icon, indicating that this package has built-in type declarations

1.11.7 • Public • Published

@currents/playwright

Playwright integration and reporter for Currents - a cloud dashboard for debugging, troubleshooting and analysing parallel CI tests supporting Cypress and Playwright.

npm version npm dm npm dt

Documentation | Currents


Requirements

  • NodeJS 14.0.0+
  • Playwright 1.22.2+

Install

npm install @currents/playwright

Enable traces, screenshots and videos

use: {
  // ...
  trace: "on",
  video: "on",
  screenshot: "on",
}

Usage

Choose the preferred launch method:

  • executing a pwc CLI command - it runs playwright with a predefined configuration
  • add @currents/playwright reporter to Playwright configuration file

pwc CLI

We need to pass three parameters to run pwc:

  • our record key
  • the project ID, which is created when you create a project in the Current dashboard
  • the CI build ID

The command passes down all the other CLI flags to the Playwright test runner as-is. We can pass these as command line arguments, as environment variables, or a mixture of both.

pwc --project-id PROJECT_ID --key RECORD_KEY --ci-build-id hello-currents --tag tagA,tagB

@currents/playwright reporter

Alternatively, you can manually add the reporter to playwright configuration and keep using playwright test CLI command.

import type { PlaywrightTestConfig } from "@playwright/test";
import { currentsReporter } from "@currents/playwright";

const currentsConfig = {
  ciBuildId: process.env.CURRENTS_CI_BUILD_ID,
  recordKey: process.env.CURRENTS_RECORD_KEY,
  projectId: process.env.CURRENTS_PROJECT_ID,
  tag: ["runTagA", "runTagB"],
};

const config: PlaywrightTestConfig = {
  reporter: [currentsReporter(currentsConfig)],
};

export default config;

You can also provide configuration by setting environment variables before running playwright command

CURRENTS_RECORD_KEY=RECORD_KEY CURRENTS_PROJECT_ID=PROJECT_ID CURRENTS_CI_BUILD_ID=hello-currents CURRENTS_TAG=tagA,tagB npx playwright test

Examples

Run all tests in the current directory:

pwc --key <record-key> --project-id <id> --ci-build-id <build-id>

Run only tests filtered by the tag "@smoke":

pwc --key <record-key> --project-id <id> --ci-build-id <build-id> --grep smoke

Run playwright tests and add tags "tagA", "tagB" to the recorded run:

pwc --key <record-key> --project-id <id> --ci-build-id <build-id> --tag tagA --tag tagB

Provide playwright arguments and flags:

pwc --key <record-key> --project-id <id> --ci-build-id <build-id> -- --workers 2 --timeout 10000 --shard 1/2

CI Integrations

Check out the example repositories that showcase running Playwright tests on popular CI providers and recording the results to Currents:

Explore how to speed up CI Playwright runs by running enabling pw-parallelization.

Documentation

Explore our comprehensive guides and documentation:

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.12.3800oldversion
1.10.1-beta.00beta
1.1.9-alpha.00alpha
1.11.792latest

Version History

VersionDownloads (Last 7 Days)Published
1.11.792
1.11.61,372
1.11.52,080
1.11.48,613
1.11.37,366
1.11.2417
1.11.193
1.11.013,517
1.10.1-beta.00
1.10.01,255
1.9.5-beta.1998
1.9.45,775
1.9.32,356
1.9.21,110
1.9.19,755
1.9.016,064
1.9.0-beta.276
1.9.0-beta.10
1.9.0-beta.00
1.8.02,088
1.7.1216
1.7.05,232
1.7.0-beta.10
1.7.0-beta.00
1.6.25,691
1.6.11,050
1.6.01
1.5.1213
1.5.117,858
1.6.0-beta.50
1.6.0-beta.40
1.6.0-beta.32
1.6.0-beta.20
1.6.0-beta.10
1.6.0-beta.00
1.5.1042
1.5.90
1.5.8699
1.5.70
1.5.653
1.5.54,594
1.5.40
1.5.30
1.5.21,920
1.5.00
1.4.63,469
1.4.541
1.4.3136
1.4.3-beta.10
1.4.3-beta.00
1.4.2136
1.4.10
1.4.01,367
1.3.30
1.3.21
1.3.1128
1.3.01,265
1.2.01,109
1.2.0-beta.00
1.1.964
1.1.9-alpha.00
1.1.80
1.1.70
1.1.6193
1.1.51
1.1.413
1.1.31
1.1.20
1.1.11
0.12.3800
1.1.00
1.0.10
1.0.0-beta.791
1.0.0-beta.60
1.0.0-beta.50
0.12.20
1.0.0-beta.40
1.0.0-beta.30
1.0.0-beta.21
1.0.0-beta.10
1.0.0-beta.00
0.12.0-alpha.80
0.12.1964
0.12.0-alpha.70
0.12.0-alpha.60
0.12.0-alpha.50
0.12.00
0.12.0-alpha.40
0.12.0-alpha.30
0.12.0-alpha.20
0.12.0-alpha.10
0.11.51,431
0.11.5-beta.00
0.11.40
0.11.30
0.11.3-beta.11
0.11.3-beta.00
0.11.263
0.11.1171
0.11.00
0.11.0-beta.00
0.10.9195
0.10.80
0.10.8-beta.00
0.10.70
0.10.667
0.10.50
0.10.40
0.10.30
0.10.20
0.10.10
0.10.01
0.10.0-beta.20
0.10.0-beta.10
0.10.0-beta.00
0.9.00
0.8.10
0.8.00
0.7.2527
0.7.10
0.7.00
0.6.4399
0.6.4-beta.00
0.6.311
0.6.243
0.6.10
0.5.00
0.5.0-beta.20
0.5.0-beta.10
0.5.0-beta.00
0.4.253
0.4.10
0.4.00
0.3.8-beta.00
0.3.740
0.3.60
0.3.50
0.3.5-beta.10
0.3.5-beta.00
0.3.40
0.3.30
0.3.21
0.3.10
0.3.00
0.2.20
0.2.00
0.1.10
0.1.00
1.0.00

Package Sidebar

Install

npm i @currents/playwright

Homepage

currents.dev

Weekly Downloads

113,182

Version

1.11.7

License

MIT

Unpacked Size

302 kB

Total Files

22

Last publish

Collaborators

  • agoldis
  • currents.npm