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

1.7.0 • 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.3119oldversion
1.1.9-alpha.00alpha
1.7.0251latest
1.7.0-beta.142beta

Version History

VersionDownloads (Last 7 Days)Published
1.7.0251
1.7.0-beta.142
1.7.0-beta.023
1.6.28,827
1.6.11,290
1.6.01
1.5.122,201
1.5.1110,994
1.6.0-beta.50
1.6.0-beta.46
1.6.0-beta.30
1.6.0-beta.20
1.6.0-beta.10
1.6.0-beta.00
1.5.103,311
1.5.90
1.5.81,340
1.5.717
1.5.6881
1.5.53,574
1.5.40
1.5.30
1.5.22,204
1.5.053
1.4.62,780
1.4.5310
1.4.3255
1.4.3-beta.10
1.4.3-beta.00
1.4.286
1.4.123
1.4.01,585
1.3.324
1.3.25
1.3.13,239
1.3.010,754
1.2.0722
1.2.0-beta.00
1.1.915
1.1.9-alpha.00
1.1.84
1.1.70
1.1.6537
1.1.50
1.1.436
1.1.30
1.1.20
1.1.10
0.12.3119
1.1.0505
1.0.10
1.0.0-beta.716
1.0.0-beta.60
1.0.0-beta.50
0.12.2415
1.0.0-beta.40
1.0.0-beta.30
1.0.0-beta.20
1.0.0-beta.10
1.0.0-beta.00
0.12.0-alpha.80
0.12.1750
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.54,778
0.11.5-beta.00
0.11.42
0.11.30
0.11.3-beta.10
0.11.3-beta.00
0.11.238
0.11.131
0.11.00
0.11.0-beta.00
0.10.993
0.10.80
0.10.8-beta.00
0.10.74,322
0.10.6108
0.10.50
0.10.40
0.10.30
0.10.20
0.10.10
0.10.00
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.2338
0.7.10
0.7.00
0.6.4121
0.6.4-beta.00
0.6.310
0.6.285
0.6.10
0.5.00
0.5.0-beta.20
0.5.0-beta.10
0.5.0-beta.00
0.4.2467
0.4.10
0.4.00
0.3.8-beta.00
0.3.760
0.3.60
0.3.50
0.3.5-beta.10
0.3.5-beta.00
0.3.40
0.3.30
0.3.20
0.3.10
0.3.00
0.2.20
0.2.00
0.1.10
0.1.00
1.0.01

Package Sidebar

Install

npm i @currents/playwright

Homepage

currents.dev

Weekly Downloads

67,649

Version

1.7.0

License

GPL-3.0-or-later

Unpacked Size

299 kB

Total Files

21

Last publish

Collaborators

  • currents.npm
  • agoldis