@releaseqa/reporter-cypress
v1.0.1
Published
ReleaseQA Cypress Plugin - Report Cypress test results to ReleaseQA
Maintainers
Readme
@releaseqa/cypress
Cypress plugin for ReleaseQA. Automatically reports your Cypress test results to ReleaseQA for tracking, analysis, and flaky test detection.
Installation
npm install --save-dev @releaseqa/cypressQuick Start
Add the plugin to your Cypress configuration:
// cypress.config.js
const { defineConfig } = require('cypress')
const releaseqa = require('@releaseqa/cypress')
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
releaseqa(on, config, {
apiKey: process.env.RELEASEQA_API_KEY,
})
}
}
})That's it! Your test results will now be reported to ReleaseQA.
TypeScript Configuration
// cypress.config.ts
import { defineConfig } from 'cypress'
import releaseqa from '@releaseqa/cypress'
export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
releaseqa(on, config, {
apiKey: process.env.RELEASEQA_API_KEY,
})
}
}
})Configuration
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| apiKey | string | process.env.RELEASEQA_API_KEY | Your ReleaseQA API key |
| project | string | Auto-detected | Project name (defaults to package.json name) |
| tags | string[] | [] | Custom tags for filtering |
| baseUrl | string | https://releaseqa.com/api/v1 | API URL (for self-hosted) |
| debug | boolean | false | Enable debug logging |
Environment Variables
You can also configure the reporter via environment variables:
| Variable | Description |
|----------|-------------|
| RELEASEQA_API_KEY | Your ReleaseQA API key |
| RELEASEQA_PROJECT | Override project name |
| RELEASEQA_BASE_URL | Custom API URL |
Features
📊 Comprehensive Reporting
The plugin captures:
- Test pass/fail status
- Test duration
- Error messages and stack traces
- Screenshot and video paths
- Browser information
🔄 Retry Detection
When using Cypress retries, the plugin tracks:
- Number of retry attempts
- Tests that pass after retries (potential flaky tests)
🏷️ Rich Metadata
Each test result includes:
- Spec file path
- Browser name and version
- Cypress version
How It Works
The plugin hooks into Cypress lifecycle events:
- before:run — Creates a new test run in ReleaseQA
- after:spec — Reports results for each spec file
- after:run — Completes the test run
Example Configuration with Retries
// cypress.config.js
const { defineConfig } = require('cypress')
const releaseqa = require('@releaseqa/cypress')
module.exports = defineConfig({
retries: {
runMode: 2, // Retry failed tests in CI
openMode: 0, // No retries in interactive mode
},
e2e: {
setupNodeEvents(on, config) {
releaseqa(on, config, {
apiKey: process.env.RELEASEQA_API_KEY,
project: 'my-app',
tags: ['e2e'],
})
}
}
})Example Output
[ReleaseQA] Test run created: run_abc123
[ReleaseQA] Reported 25 tests from auth.cy.js
[ReleaseQA] Reported 18 tests from checkout.cy.js
[ReleaseQA] Test run completed: https://releaseqa.com/dashboard/runs/run_abc123License
MIT
