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
        • Tests Performance
      • Spec Files Explorer
        • Spec Files Performance
      • Errors Explorer
  • 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
  • Using @currents/cli
  • API - Programmatic Usage
  • Integration Details
  • Compatibility
  • Deprecated Functionality

Was this helpful?

  1. Resources
  2. Reporters

@currents/cli

Setup and usage instructions for Cypress integration with Currents Dashboard

PreviousMigration to Cypress@13Next@currents/playwright

Last updated 1 year ago

Was this helpful?

In Feb 2023, Cypress.io team decided to to its internal orchestration and recording protocol, preventing the use of @currents/cli (affected versions are 12.6.0+).

Please note

Migrate to if you are seeing any of the errors below

  • Integrity check failed

  • DecryptionError: JWE Recipients missing or incorrect type

  • Cypress does not support recording test results to this third party service

is a small npm package that allows seamless integration of cypress with Currents cloud orchestration service. The package contains an executable script that provides the same CLI and API experience as the original cypress package - they are 100% interchangeable.

> npm install @currents/cli cypress
> npx currents run --record --parallel --key $CURRENTS_RECORD_KEY

In fact, currents runs cypress command behind the scenes, passing down all the CLI flags or API options. currents requires cypress to be installed.

Please note: @currents/cli is designed to be used in CI environments. Using it for running cypress tests interactively is not recommended.

Using @currents/cli

Install both cypress and @currents/cli packages on your system

> npm install @currents/cli cypress
> npx currents run --record --parallel --key #currents_key

Use currents the same way you are using cypress- it accepts the same flags and configuration options. Usually, you end up running a somewhat similar command as part of your CI build:

npx currents run --record --parallel --ci-build-id $BUILD_ID --key $CURRENTS_KEY

Learn more about obtaining a Record Key and generating a CI Build ID

API - Programmatic Usage

run

run(config: CypressCommandLine.CypressRunOptions): Promise<CypressCommandLine.CypressRunResult | CypressCommandLine.CypressFailedRunResult>

Example:

import { run } from "@currents/cli";

const cypressOptions: Partial<CypressCommandLine.CypressRunOptions> = {
  browser: "chrome",
  parallel: true,
  record: true,
  key: "Currents key from https://app.currents.dev",
  tag: "smoke",
};
const results = await run(cypressOptions);

spawn

Spawn Cypress as a child process and inherit all the flags and environment variables. It invokes process.exit with the child process' exit code at the end of its execution.

spawn(): Promise<void>

Example:

import { spawn } from "@currents/cli";

await spawn();

Integration Details

Compatibility

Please refer to Compatibility.

Deprecated Functionality

Additional tools within @currents/cli [deprecated]

Deprecated: this functionality was deprecated in @currents/cli@4+

The package contains a few other utilities:

  • currents-prepare - reconfigures cypress to use Currents dashboard without automatically launching cypress runner

  • currents-reset - restores the original Cypress runner configuration

Using currents-prepare CLI [deprecated]

Deprecated: this functionality was deprecated in @currents/cli@4+

currents-prepare can be useful when you need to invoke custom scripts that run cypress behind the scenes.

npm install @currents/cli cypress-repeat
npx currents-prepare
npx cypress-repeat ...

Uninstalling currents

Please note: this functionality is only relevant for versions 3 and below.

Older versions of @currents/cli (prior to 3) were used to modify cypress installation. Use one of the following methods for restoring the original cypress configuration and removing Currents from cypress package:

  • Run npx currents-reset from @currents/cli npm package to restore the original configuration

  • Run cypress install --force to install a fresh version of cypress binaries

  • Reinstall cypress npm package from scratch

MacOS Ventura Users

Running the commands in an interactive shell (or VSCode) can fail withEPERM: operation not permitted error.

You need to explicitly allow the shell app (or VSCode) to modify other applications.

Add the app to the App Management allowed list to stop the error.

Mac OS Settings > Privacy and Security > App Management

Please note: the documentation below is for the most recent version of the package. Please refer to the package for details about the previous versions.

Run Cypress via its

currents CLI tool uses the public APIs of cypress runner. It connects the runner to Currents servers for orchestration, parallelization and reporting the results. It uses another open-source tool from the sorry-cypress project ().

For example: let's say you have a custom script that's starting cypress via its . Before running the custom script, you'd run currents-prepare. It will change cypress configuration to use Currents Dashboard:

Remove the

cypress-cloud
@current/cli
changelog
Module API
cy2
Module API
cached Cypress binaries