How to Stream Cypress Test Results
See Cypress results in real time with the default reporter, JUnit output, or Cypress Cloud. Configure CI-friendly reports and troubleshoot common pitfalls.
To see Cypress test results as a run executes, use its default Mocha spec reporter, which writes human-readable progress to standard output. To stream JUnit output to the terminal while saving an XML report, configure the JUnit reporter with toConsole=true and mochaFile. To keep a hosted history of runs and artifacts, configure Cypress Cloud and run with --record; Cloud recording is a separate option from terminal reporting.
This guide covers the three destinations separately: terminal output, JUnit XML, and Cypress Cloud. Pick the one that matches how results need to be consumed. You can combine them where appropriate.
1. Stream human-readable results to the terminal
The simplest option requires no reporter configuration. Run Cypress in run mode:
npx cypress run
Cypress uses the Mocha spec reporter by default and writes its output to STDOUT. That output appears in a local terminal and, typically, in the log for a CI job that captures standard output. This is enough when a person needs to follow test progress and see a pass/fail summary.
For an installed project, use the package manager’s equivalent command if desired:
npm exec cypress -- run
In a CI workflow, invoke Cypress in the test step and make sure the job displays or retains the process output. The CI provider’s log retention and formatting are configured on its side; there is no single Cypress command that publishes logs to every CI product.
Choose a reporter based on the reader
- Human following a run: the default
specreporter is usually the most readable choice. - CI importing structured test cases: use JUnit XML and configure the CI system to ingest the generated file.
- Team browsing run history and artifacts: configure Cypress Cloud recording.
Reporters change the presentation of test-run results. They do not themselves configure how a CI provider stores logs or ingests artifacts.
2. Stream JUnit results and save XML
Cypress includes a JUnit reporter. Set toConsole=true to send its output to the console, and set mochaFile to write an XML report. Create the output directory before running if it does not already exist.
mkdir -p results
npx cypress run --reporter junit --reporter-options "mochaFile=results/my-test-output.xml,toConsole=true"
This gives the run a console output path and an XML artifact path. Configure your CI system separately to publish or import results/my-test-output.xml; the exact syntax depends on that CI product.
Put the reporter settings in Cypress configuration
To make JUnit output the project default, add reporter settings to cypress.config.js (or adapt the module syntax to the project’s existing configuration file):
const { defineConfig } = require('cypress');
module.exports = defineConfig({
reporter: 'junit',
reporterOptions: {
mochaFile: 'results/my-test-output.xml',
toConsole: true,
},
});
Then run:
npx cypress run
Alternatively, keep the project configuration unchanged and pass the reporter flags on the command line. CLI options are useful when different CI jobs need different output formats.
Keep reports from every spec
A static output path can be overwritten as multiple spec files run, leaving only one spec’s report. If every spec’s results need to be retained, give each spec a distinct filename with the [hash] token:
mkdir -p results
npx cypress run --reporter junit --reporter-options "mochaFile=results/junit-[hash].xml,toConsole=true"
This produces separate XML files rather than repeatedly targeting one filename. If the receiving CI system expects a single report, merge those files with a JUnit report merger used by your project, then point the CI publisher at the merged output. The merger and its command are project-specific, so confirm its usage and the CI importer’s file pattern in their respective documentation.
Use the CI process exit status
Streaming output does not change whether the test command succeeds. Let the Cypress process finish and preserve its exit status so a failing run marks the job as failed. Avoid shell pipelines or wrappers that hide the Cypress exit code; if output is piped through another command, configure the shell or wrapper to propagate the original command’s status.
3. Record results in Cypress Cloud
Cypress Cloud provides a hosted view of recorded test runs. Recording requires a configured Cypress project and a record key. After completing Cloud project setup, pass the key directly:
npx cypress run --record --key YOUR_RECORD_KEY
In CI, a common approach is to provide the key through the CYPRESS_RECORD_KEY environment variable, then run:
npx cypress run --record
Keep the record key in the CI system’s secret storage rather than committing it to source control. Cloud is optional: use it when a hosted run history and its related information are useful; it is not required for standard-output reporting or local JUnit XML.
What a recorded run can contain
Cypress Cloud recorded runs can include terminal standard output, test results and definitions, Cypress configuration excluding Cypress environment variables, screenshots, videos, and CI- or Git-related operating-system environment variables. With Test Replay enabled, additional debugging data can include rendered DOM and CSS, Cypress command events, network traffic, and browser console logs. Review Cypress’s current data-storage documentation and controls when deciding what to record for your project.
Cloud organizes results at run, test, and spec levels. Screenshots and videos can be attached to test results, and recorded-run pages provide ways to browse or download artifacts. The Cypress reporter still affects the CI output that Cloud surfaces from standard output.
4. Capture screenshots and video when they help explain failures
During cypress run, Cypress takes screenshots on failure by default unless that behavior is disabled. Video recording is off by default; enable it in the project configuration when videos are useful:
const { defineConfig } = require('cypress');
module.exports = defineConfig({
video: true,
});
Video is recorded per spec. Consider whether screenshots and video are useful for the failures your team investigates, and account for the extra artifacts when retaining or uploading run data.
5. Common errors and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| No progress appears until the run ends, or no expected output is visible | The command is not running in run mode, output is being buffered or hidden by a wrapper, or the CI step does not display standard output. | Run npx cypress run, inspect the command’s raw output, and check the CI step’s log handling. Use the default spec reporter for a straightforward human-readable stream. |
| JUnit XML exists but the terminal has no JUnit reporter output | The JUnit reporter was selected without enabling console output. | Add toConsole=true to reporterOptions or the CLI reporter options. |
| The XML file contains results for only one spec | Every spec is writing to the same static mochaFile path, so later output can overwrite earlier output. |
Use a filename such as junit-[hash].xml to write one file per spec. Merge the files if the CI importer expects a single XML document. |
| The CI job passes even though Cypress tests failed | A shell pipeline or wrapper may return its own exit status instead of Cypress’s. | Make the shell or wrapper propagate Cypress’s exit code. Confirm the CI step’s success condition uses the test command’s status. |
| Cloud reports a missing or invalid record key | The run was not given a valid key, or the project has not been configured for Cloud recording. | Complete the Cloud project setup and supply its record key with --key or CYPRESS_RECORD_KEY. Check that the CI secret is available to the job. |
| Cloud does not show a recorded run | The command may have run without --record, or the key/project configuration may be wrong. |
Check the invocation includes --record, verify the configured project and key, and inspect the command output for recording errors. |
| CI cannot find the JUnit report | The CI publisher is looking in a different path or for a different filename pattern. | Confirm the report is created at the expected path, then configure the CI importer to match that path or the per-spec pattern. |
6. Performance, reliability, and cost considerations
Performance
Terminal output is the lightest reporting setup because it writes the reporter output to standard output. JUnit adds XML files that need to be written and optionally merged. Cloud recording sends run data to a hosted service and may include artifacts; Test Replay can add more debugging data when enabled. Choose the smallest set of outputs that supports the team’s workflow, and avoid creating or retaining artifacts that nobody uses.
Reliability
- Preserve Cypress’s process exit code so test failures remain visible to CI.
- Use unique per-spec JUnit filenames when running multiple specs and retain all required outputs as CI artifacts.
- Check that the CI environment exposes the Cloud key to the job and that the project has been configured for recording.
- Keep local or CI reporting independent of Cloud when a run must still produce terminal output or XML without hosted recording.
Cost and data handling
The research sources do not establish current Cypress Cloud pricing, so this guide does not quote a price. Check Cypress’s current plan and data-storage information when budgeting or deciding what run data to retain. Standard-output reporting and writing XML are local Cypress reporting choices; the storage, artifact retention, and import behavior of your CI provider are separate considerations.
7. Choose the right output path
| Need | Use | What to configure |
|---|---|---|
| Readable progress in a terminal or CI log | Default spec reporter |
Run npx cypress run. |
| Console output plus machine-readable results | JUnit reporter | toConsole=true and a mochaFile path. |
| Reports for every spec | JUnit with per-spec files | Use [hash] in the path and merge if needed. |
| Shared hosted run history and debugging artifacts | Cypress Cloud | Configure the project and key, then use --record. |
8. Or skip the browser setup
Cypress reporting tells you how a test run went. If the next step is capturing a page screenshot for a test artifact, bug report, or visual investigation, ScreenshotNeo is a website screenshot API and MCP server. One GET request returns an image or PDF, and its API parameters used by other screenshot APIs also work, which can make switching easier. See the ScreenshotNeo API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
timeout=90,
)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
const bytes = Buffer.from(await res.arrayBuffer());
await import('node:fs/promises').then(fs => fs.writeFile('shot.webp', bytes));
- Cookie banners are accepted like a visitor, and 60+ known consent platforms, newsletter popups, and chat widgets are removed before the shot. Each step can be turned off.
- Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are never billed; responses identify the page verdict and billing status in headers.
- An MCP server gives AI agents such as Claude, Cursor, and other MCP clients the
take_screenshot,get_page_info, andcapture_pdftools. - The free plan includes 1,000 screenshots a month with no card. Paid plans start at $5 for 3,000 screenshots; every feature is on every plan.
Sign up free for 1,000 screenshots a month, with no card required.
9. FAQ
Does Cypress stream results while tests run?
Yes. The default spec reporter writes to standard output during a run, so a terminal or CI log that displays standard output can show progress.
Can I use JUnit for the CI log and the CI test report?
Yes. Enable toConsole and write XML with mochaFile. The CI product still needs its own configuration to ingest that XML.
Do I need Cypress Cloud to see results in CI?
No. The default reporter and JUnit output work without Cloud. Cloud is for a hosted view of recorded runs and related run information.
Does Cypress record video automatically?
No. Video is disabled by default; set video: true to enable it for cypress run.


