Running Cypress Tests on LambdaTest: Cloud Grid Setup and Parallel Execution
Cypress can't run as a remote WebDriver, so LambdaTest uses a different integration model: the lambdatest-cypress-cli uploads your test specs to their cloud, which runs them in real browsers. You get parallel execution across multiple browsers, video recordings, and screenshots — without managing Cypress Docker containers or a CI machine with 8 cores.
How LambdaTest Runs Cypress (vs. Selenium)
With Selenium/Playwright, your test runner stays local and controls a remote browser over the network. Cypress doesn't work that way — it runs inside the browser process itself. A remote WebDriver URL won't help.
LambdaTest's solution: the CLI packages your test files, uploads them, and LambdaTest runs the full Cypress process on their nodes. Results (video, screenshots, logs) are sent back to the dashboard.
This is architecturally similar to Cypress Cloud (formerly Dashboard), but running on LambdaTest's browser grid instead of Cypress's own.
Installation
npm install -g lambdatest-cypress-cliVerify:
lambdatest-cypress --versionYou also need your LambdaTest credentials:
export LT_USERNAME="your_username"
export LT_ACCESS_KEY="your_access_key"Initializing the Config
Run the init command inside your Cypress project root:
lambdatest-cypress initThis generates lambdatest-config.json in your project. Edit it:
{
"lambdatest_auth": {
"username": "${LT_USERNAME}",
"access_key": "${LT_ACCESS_KEY}"
},
"browsers": [
{
"browser": "Chrome",
"platform": "Windows 11",
"versions": ["latest", "latest-1"]
},
{
"browser": "Firefox",
"platform": "Windows 10",
"versions": ["latest"]
},
{
"browser": "Edge",
"platform": "Windows 11",
"versions": ["latest"]
}
],
"run_settings": {
"cypress_config_file": "cypress.config.js",
"reporter_config_file": "base_reporter_config.json",
"build_name": "Cypress Build",
"parallels": 5,
"specs": "./cypress/e2e/**/*.cy.js",
"ignore_files": "cypress/e2e/skip/*.cy.js",
"network": true,
"headless": false,
"npm_dependencies": {
"cypress": "13.0.0"
}
},
"tunnel_settings": {
"tunnel": false,
"tunnel_name": null
}
}Key fields:
| Field | Purpose |
|---|---|
browsers |
Browser/platform/version matrix to run against |
parallels |
Max concurrent sessions |
specs |
Glob pattern for spec files to run |
build_name |
Groups runs in the LambdaTest dashboard |
headless |
Run browsers headless (faster, no visual) |
network |
Capture network logs |
npm_dependencies |
Packages to install on LambdaTest nodes |
Running Tests
# Run all specs
lambdatest-cypress run
# Run a specific spec
lambdatest-cypress run --spec cypress/e2e/login.cy.js
# Dry run (shows what would run without uploading)
lambdatest-cypress run --dryRunThe CLI uploads your specs, triggers execution on LambdaTest nodes, and streams real-time results back to your terminal.
Parallel Spec Execution
Set "parallels": N in lambdatest-config.json. LambdaTest distributes your spec files across N concurrent sessions. Each session runs a subset of specs.
For a project with 20 spec files at 45 seconds per spec:
- Sequential (1 parallel): 900 seconds (15 minutes)
- 5 parallels: ~180 seconds (3 minutes)
- 10 parallels: ~90 seconds (1.5 minutes)
Parallel count is capped by your plan's concurrent session limit. If you request 10 parallels on a 5-session plan, the extra sessions queue.
The distribution is file-based, not test-based. A spec file with 50 tests runs as one unit. Keep spec files reasonably small (10–20 tests) for better parallelism.
Cross-Browser Matrix
The browsers array in your config defines the matrix. Each combination of browser + version runs your entire spec suite:
"browsers": [
{ "browser": "Chrome", "platform": "Windows 11", "versions": ["latest"] },
{ "browser": "Firefox", "platform": "Windows 11", "versions": ["latest"] },
{ "browser": "Edge", "platform": "Windows 10", "versions": ["latest"] },
{ "browser": "Chrome", "platform": "macOS Ventura", "versions": ["latest"] }
]With 20 specs and 4 browser configurations and 5 parallels: 80 total spec runs distributed across 5 concurrent sessions per browser config (or across all at once, depending on your session limit).
Video and Screenshot Artifacts
Every test run produces:
- Video: Full screen recording of the Cypress session. Accessible from the test dashboard immediately after the run.
- Screenshots: Automatic screenshot on test failure (Cypress default). Additional screenshots via
cy.screenshot(). - Terminal logs: stdout/stderr from the Cypress process on the LambdaTest node.
To download artifacts programmatically:
# Get session IDs from a build
curl -u "$LT_USERNAME:$LT_ACCESS_KEY" \
"https://api.lambdatest.com/automation/api/v1/sessions?build=Cypress+Build&limit=10"
# Download video for a specific session
curl -u "$LT_USERNAME:$LT_ACCESS_KEY" \
"https://api.lambdatest.com/automation/api/v1/sessions/{session_id}/video" \
--output test-video.mp4GitHub Actions Integration
# .github/workflows/cypress.yml
name: Cypress Tests
on:
push:
branches: [main]
pull_request:
jobs:
cypress:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Install LambdaTest Cypress CLI
run: npm install -g lambdatest-cypress-cli
- name: Run Cypress on LambdaTest
env:
LT_USERNAME: ${{ secrets.LT_USERNAME }}
LT_ACCESS_KEY: ${{ secrets.LT_ACCESS_KEY }}
run: lambdatest-cypress run --config lambdatest-config.json
- name: Report results
if: always()
run: echo "Results available at https://automation.lambdatest.com"Testing a Localhost App
For apps running on localhost in CI, enable the tunnel:
"tunnel_settings": {
"tunnel": true,
"tunnel_name": "ci-tunnel"
}Start the tunnel before running tests:
- name: Start LambdaTest Tunnel
run: |
wget -q https://downloads.lambdatest.com/tunnel/v3/linux/64bit/LT_Linux.zip
unzip -q LT_Linux.zip
./LT --user $LT_USERNAME --key $LT_ACCESS_KEY --tunnelName ci-tunnel --daemon startReporter Configuration
LambdaTest supports Cypress reporters. Create base_reporter_config.json:
{
"reporter": "mochawesome",
"reporterOptions": {
"reportDir": "cypress/results",
"overwrite": false,
"html": false,
"json": true
}
}Install mochawesome:
npm install --save-dev mochawesome mochawesome-merge mochawesome-report-generatorAfter the run, merge and generate the HTML report:
npx mochawesome-merge cypress/results/*.json > merged.json
npx marge merged.json --reportDir cypress/report --inlineCommon Issues
Specs not found: The specs glob in lambdatest-config.json is evaluated relative to the project root. Use ./cypress/e2e/**/*.cy.js not cypress/e2e/**/*.cy.js.
npm dependencies not installed on node: Add your custom packages to run_settings.npm_dependencies. Without this, require('some-plugin') fails on the LambdaTest node even if it's in your local node_modules.
Build not appearing in dashboard: Check that build_name is consistent across runs. Each unique string creates a new build entry.
Cypress version mismatch: The Cypress version in npm_dependencies must match your local version. A mismatch causes silent failures.