Cypress - Azure DevOps
Running Cypress test in parallel on Azure DevOps and Currents Dashboard
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)


Last updated
Was this helpful?