0
0
CypressHow-ToBeginner ยท 4 min read

How to Use Cypress Dashboard for Test Monitoring

To use the Cypress Dashboard, first create an account on the Cypress Dashboard website and connect your project by running npx cypress open and linking your project. Then, run tests with cypress run --record --key <record_key> to upload results and view detailed test reports, videos, and screenshots on the dashboard.
๐Ÿ“

Syntax

The basic commands to use Cypress Dashboard are:

  • npx cypress open: Opens Cypress Test Runner and helps link your project to the dashboard.
  • cypress run --record: Runs tests in headless mode and records results to the dashboard.
  • --key <record_key>: Provides your unique project record key to authenticate uploads.

These commands connect your local tests to the Cypress Dashboard service for monitoring.

bash
npx cypress open
cypress run --record --key <record_key>
๐Ÿ’ป

Example

This example shows how to run Cypress tests and upload results to the dashboard.

First, open Cypress and link your project:

npx cypress open

Follow the prompts to create or connect to a dashboard project.

Then, run tests with recording enabled:

bash
npx cypress run --record --key abc123def456
Output
==================================================================================================== (Run Starting) โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Cypress: 12.17.0 โ”‚ โ”‚ Browser: Electron 112 (headless) โ”‚ โ”‚ Specs: 1 found (example_spec.cy.js) โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Running: example_spec.cy.js (1 of 1) โœ“ visits the example page 1 passing (Results) Video: true Screenshots: true (Run Finished) ==================================================================================================== (Uploading Results to Cypress Dashboard) View your test run results at: https://dashboard.cypress.io/projects/your-project-id/runs/123
โš ๏ธ

Common Pitfalls

Common mistakes when using Cypress Dashboard include:

  • Not setting the --record flag when running tests, so results are not uploaded.
  • Forgetting to provide the correct --key for your project, causing authentication errors.
  • Running npx cypress open without linking your project to the dashboard first.
  • Expecting dashboard features without a valid Cypress Dashboard account or project setup.

Always verify your project is linked and your record key is correct.

bash
Wrong:
cypress run

Right:
cypress run --record --key abc123def456
๐Ÿ“Š

Quick Reference

CommandPurpose
npx cypress openOpen Cypress Test Runner and link project to dashboard
cypress run --record --key Run tests and upload results to Cypress Dashboard
Visit https://dashboard.cypress.ioView test results, videos, and screenshots
--recordFlag to enable recording test runs
--key Your unique project key for authentication
โœ…

Key Takeaways

Always link your project to Cypress Dashboard using 'npx cypress open' before recording runs.
Use 'cypress run --record --key ' to upload test results to the dashboard.
Check your record key carefully to avoid authentication errors.
The dashboard shows detailed test reports, videos, and screenshots for easy debugging.
Without the '--record' flag, test results will not be uploaded to the dashboard.