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

Was this helpful?

  1. Getting Started
  2. CI Setup
  3. Azure DevOps

Cypress - Azure DevOps

Running Cypress test in parallel on Azure DevOps and Currents Dashboard

PreviousAzure DevOpsNextPlaywright - Azure DevOps

Last updated 1 year ago

Was this helpful?

This guide will help you to run Cypress tests in parallel using Azure DevOps and Currents Dashboard. The example showcases using 3 Azure DevOps containers for parallelizing the execution using Currents as an orchestration and reporting service.

TLDR; Check out the example Azure DevOps pipeline

  • Connect a new/existing pipeline to a repository containing your Cypress tests

  • Make sure that your cypress.config.js file has the correct projectId. You can fetch the projectId by navigating to and then Project Name > Manage Project

  • Make sure that both cypress and are listed in your package.json as dependencies

  • Create or modify an existing , and add a new secret variable called CURRENTS_SECRET. You can grab the secret key at Currents Dashboard > Org Name (Header Menu) > Record Keys

  • Modify your azure-pipelines.yml file and use as a reference.

jobs:
  - job: Cypress_e2e_tests
    pool:
      vmImage: "ubuntu-latest"
    # Use 3 containers for parallel execution, use 
    strategy:
      parallel: 3
    # Fetch the secrets from Variable Group names "Currents"
    variables:
      - group: Currents
    steps:
      # Use Node@16 container
      - task: NodeTool@0
        inputs:
          versionSpec: "16.x"
          displayName: "Install Node.js"

      # Speed up the execution by caching the dependencies
      - task: CacheBeta@1
        inputs:
          key: npm | $(Agent.OS) | package-lock.json
          path: /home/vsts/.npm
          restoreKeys: npm | $(Agent.OS) | package-lock.json
        displayName: Cache NPM packages

      # cache cypress binary, which is installed at a different location
      - task: CacheBeta@1
        inputs:
          key: cypress | $(Agent.OS) | package-lock.json
          path: /home/vsts/.cache/Cypress
          restoreKeys: cypress | $(Agent.OS) | package-lock.json
        displayName: Cache Cypress binary

      # Install Node dependencies
      - script: npm ci
        displayName: "Install NPM dependencies"

      # Grab 
      # - CURRENTS_PROJECT_ID
      # - CURRENTS_RECORD_KEY
      # at https://app.currents.dev 
      #
      # Read more about CI Build ID:
      # https://currents.dev/readme/guides/cypress-ci-build-id

      # Note the use of `currents` command
      - script: |
          npx cypress-cloud run --record --parallel --key $CURRENTS_RECORD_KEY --ci-build-id $BUILD_BUILDNUMBER
        displayName: "Run Currents tests"
        env:
          CURRENTS_RECORD_KEY: $(CURRENTS_SECRET)

Pipeline executions will be orchestrated via the Currents Dashboard, and execution results and artifacts will be automatically uploaded as well.

configuration file
https://app.currents.dev
cypress-cloud
Variable Group
this file
Running Cypress Tests in Azure DevOps Pipeline
Running Cypress Tests in Azure DevOps Pipeline
Currents Dashboard executing tests from Azure DevOps Pipeline