Currents Documentation
Currents.devGitHubChangelog
  • Getting Started
    • What is Currents?
    • Playwright
      • Playwright: Quick Start
      • Troubleshooting Playwright
    • Cypress
      • Your First Cypress Run
      • Integrating with Cypress
        • Compatibility
        • Alternative Cypress Binaries
      • Troubleshooting Cypress
    • Jest
      • Your First Jest Run
      • Detox + Jest
      • Troubleshooting Jest
    • Others
    • CI Setup
      • GitHub Actions
        • Cypress - GitHub Actions
        • Playwright - GitHub Actions
        • Jest - GitHub Actions
        • Node.js - GitHub Actions
        • Commit data for GitHub Actions
        • Custom Docker runners
        • Named Runners
      • GitLab
        • Cypress - GitLab CI/CD
        • Playwright - GitLab CI/CD
        • Custom Docker runners
      • Jenkins
        • Cypress - Jenkins
        • Playwright - Jenkins
      • CircleCI
        • Cypress - CircleCI
        • Playwright - CircleCI
      • Bitbucket
        • Cypress - Bitbucket Pipelines
      • Azure DevOps
        • Cypress - Azure DevOps
        • Playwright - Azure DevOps
      • AWS Code Build
        • Cypress - AWS Code Build
        • Playwright - AWS Code Build
      • NX
        • Playwright - NX
        • Cypress - NX
  • Guides
    • Record Key
    • CI Build ID
    • Reporting
      • Reporting Strategy
      • Reporting in CI
      • Step-Level Reporting
    • CI Optimization
      • Playwright Parallelization
      • Orchestration Setup
      • Fully Parallel Mode
      • Re-run Only Failed Tests
      • Cloud Spot Instances
      • Failing Fast
      • Load Balancing
    • Code Coverage
      • Code Coverage for Playwright
      • Code Coverage for Cypress
    • Currents Actions
      • Setup Currents Actions
      • Using Currents Actions
      • Reference
        • Conditions
        • Actions
    • Playwright Component Testing
    • Playwright Visual Testing
    • Playwright Annotations
    • Playwright Tags
    • MCP Server
  • Dashboard
    • Projects
      • Projects Summary view
      • Project Settings
      • Archive and Unarchive Projects
    • Runs
      • Run Status
      • Run Details
      • Commit Information
      • Tags
      • Run Timeouts
      • Cancelling Runs
      • Deleting Runs
      • Run Progress
    • Tests
      • Spec File Status
      • Test Status
      • Flaky Tests
      • Test History
    • Test Suite Explorer
      • Test Explorer
      • Spec Files Explorer
      • Error Explorer
      • Reference
  • Automated Reports
  • Insights and Analytics
  • Administration
    • Email Domain Based Access
    • SSO SAML2.0
      • SAML2.0 Configuration
      • SCIM User Provisioning
      • IdP-initiated Sessions
      • JumpCloud
        • JumpCloud User provisioning
      • Okta
        • Okta User provisioning
      • Troubleshooting SSO
    • Billing & Usage
  • Billing and Pricing
  • Resources
    • Reporters
      • cypress-cloud
        • Batched Orchestration
        • Migration to Cypress@13
      • @currents/cli
      • @currents/playwright
        • Configuration
        • pwc
        • pwc-p (orchestration)
        • Playwright Fixtures
      • @currents/jest
      • @currents/node-test-reporter
      • @currents/cmd
        • currents api
        • currents upload
        • currents cache
        • currents convert
      • Data Format Reference
    • Integrations
      • GitHub
        • GitHub App
        • GitHub OAuth
      • GitLab
      • Slack
      • Microsoft Teams
      • HTTP Webhooks
      • Bitbucket
    • API
      • Introduction
      • Authentication
      • API Keys
      • Errors
      • Pagination
      • API Resources
        • Instances
        • Runs
        • Projects
        • Spec Files
        • Test Signature
        • Test Results
    • Data Privacy
      • Access to Customer Data
      • Data Retention
      • Cloud Endpoints
    • Support
Powered by GitBook
On this page
  • Configuration Sources
  • Configuration Overrides
  • Reference
  • ciBuildId *
  • projectId *
  • recordKey *
  • tag
  • removeTitleTags
  • disableTitleTags
  • cancelAfterFailures
  • testSuiteFile
  • machineId
  • orchestrationId
  • outputFile
  • orchestration
  • coverage

Was this helpful?

  1. Resources
  2. Reporters
  3. @currents/playwright

Configuration

@currents/playwright configuration reference

Configuration Sources

@currents/playwright accepts configuration from the following sources:

  • ⭐️ Preferred: reading currents.config.ts file

  • Environment variables, e.g. CURRENTS_TAG=tagA,tagB

  • CLI command options, e.g. npx pwc ---tag tagA --tag tagB

  • Inline configuration in playwright.config.ts e.g. reporters: [currentsReporter(options)]

We recommend using currents.config.ts as the preferred method for defining the configution — the file is evaluated at runtime, i.e. you can make is smart.

For example:

import { OrchestrationStatus, CurrentsConfig } from "@currents/playwright";

function getCIBuildId() {
  return "example";
}
const onFinish = async (result: OrchestrationStatus) => {
    console.log("Orchestration finished with status", result);
};

const config: CurrentsConfig = {
  recordKey: process.env.CURRENTS_RECORD_KEY || throw new Error("oh no!"),
  projectId: process.env.CURRENTS_PROJECT_ID,
  ciBuildId: getCIBuildId(),
  orchestration: {
    skipReporterInjection: true,
    onFinish,
  },
};

export default config;

Configuration Overrides

Configuration values will resolve as follows:

  • environment variable value if exists, otherwise

  • corresponding CLI parameter value if exists, otherwise

  • value from playwright.config.ts if exists, otherwise

  • value from currents.config.ts if exists, otherwise

  • the default value, otherwise

  • throw if the value is mandatory

Example of using environment variables

CURRENTS_PROJECT_ID=PROJECT_ID \ // the projectId from https://app.currents.dev
CURRENTS_RECORD_KEY=RECORD_KEY \ // the record key from https://app.currents.dev
CURRENTS_CI_BUILD_ID=hello-currents \ // the CI build ID 
CURRENTS_TAG=tagA,tagB \
npx playwright test
cmd /V /C "set CURRENTS_PROJECT_ID=PROJECT_ID // the projectId from https://app.currents.dev
&& set CURRENTS_RECORD_KEY=RECORD_KEY // the record key from https://app.currents.dev
&& set CURRENTS_CI_BUILD_ID=hello-currents  // CI build id
&& set CURRENTS_TAG=tagA,tagB  // tags for the created run
&& npx playwright test"

Reference

ciBuildId *

  • Type: string

  • Default: undefined

  • Environment variable: CURRENTS_CI_BUILD_ID

Required. The ID of the build to associate the test run with. See CI Build ID.


projectId *

  • Type: string

  • Default: undefined

  • Environment variable: CURRENTS_PROJECT_ID

Required. The Currents project ID used for reporting. See Projects.


recordKey *

  • Type: string

  • Default: Required

  • Environment variable: CURRENTS_RECORD_KEY

Required. Secret key used to authenticate and upload results to Currents. See Record Key.


tag

  • Type: string[]

  • Default: []

  • Environment variable: CURRENTS_TAG=tagA,tagB

Tags added to the test run metadata. See Playwright Tags.


removeTitleTags

  • Type: boolean

  • Default: false

  • Environment variable: N/A

Remove inline tags like @smoke from test titles when processing test results on Currents servers. Helps to keep the test title consistent and keep test history when tags change.


disableTitleTags

  • Type: boolean

  • Default: false

  • Environment variable: CURRENTS_DISABLE_TITLE_TAGS

Prevent parsing tags like @smoke from test titles.


cancelAfterFailures

  • Type: number | false

  • Default: false

  • Environment variable: CURRENTS_CANCEL_AFTER_FAILURES

Stop the run after a number of failures. The number of failures is determined from all the results reported to the associated run (i.e. from multiple machines). Pass false to disable. See Failing Fast.


testSuiteFile

  • Type: string

  • Default: undefined

  • Environment variable: CURRENTS_TEST_SUITE_FILE

Full path to the test suite file used for orchestration and reporting. Mostly used internally.


machineId

  • Type: string

  • Default: CURRENTS_MACHINE_ID

  • Environment variable: N/A

Optional unique machine identifier. Mostly used internally.


orchestrationId

  • Type: string

  • Default: Auto-generated

  • Environment variable: CURRENTS_ORCHESTRATION_ID

Unique orchestration ID for the run. Mostly used internally.


outputFile

  • Type: string

  • Default: undefined

  • Environment variable: CURRENTS_OUTPUT_FILE

File path for the JSON output summary. The TypeScript definition of the contents is available:

import type { ExecutionJSONSummary } from '@currents/playwright'

orchestration

Set of configuration items related to Orchestration Setup.

orchestration.resetSignal

  • Type: SIGUSR1 | SIGUSR2

  • Default: undefined

  • Environment variable: N/A

Signal used to reset the tests running on the machine. See Cloud Spot Instances.

orchestration.skipReporterInjection

  • Type: boolean

  • Default: false

  • Environment variable: N/A

Prevents pwc-p from automatically configuring Playwright to use Currents reporter . If see, you must add Currents reporter manuall. See Orchestration Setup.

orchestration.onFinish

  • Type: (status: OrchestrationStatus) => Promise<void>

  • Default: undefined

  • Environment variable: N/A

Optional async callback called after orchestration completes. The callback runs on each machine that is part of an orchestrated run. The parameter status contains aggregated results from all the participating machines. The TypeScript definition of the contents is available:

import type { OrchestrationStatus } from "@currents/playwright";

orchestration.batchSize

  • Type: "auto" | number

  • Default: auto

  • Environment variable: CURRENTS_BATCH_SIZE

  • Released in: 1.13.0

Sets the batch size for orchestration. Batch size defines how many parallel workers should be used for the orchestration.

  • auto infers the batch size from Playwright workers.

  • number explicitly sets the batch size, must be greater than 0


coverage

Set of configuration items related to Code Coverage for Playwright.

coverage.projects

  • Type: boolean | string[]

  • Default: false

  • Environment variable: N/A

Enable or disable coverage collection for Playwright projects

  • true | []: enable for all projects

  • string[]: only enable for specified projects

  • false | undefined: disabled

coverage.dir

  • Type: string

  • Default: .nyc_output

  • Environment variable: N/A

Directory path for reading coverage reports. See Code Coverage for Playwright.

Previous@currents/playwrightNextpwc

Last updated 16 days ago

Was this helpful?