Ingestion
Cypress
Send Cypress test results to RunPilotAI using the Mochawesome JSON reporter.
Install Mochawesome
bash
npm install --save-dev mochawesome mochawesome-merge mochawesome-report-generatorConfigure Cypress
In cypress.config.ts:
typescript
import { defineConfig } from "cypress";
export default defineConfig({
reporter: "mochawesome",
reporterOptions: {
reportDir: "cypress/results",
overwrite: false,
html: false,
json: true,
},
});Send results via curl
bash
# Merge individual spec JSON files first
npx mochawesome-merge cypress/results/*.json > cypress-results.json
curl -s -X POST https://runpilotai.com/api/ingest/cypress \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_INGEST_KEY" \
-d @cypress-results.jsonGitHub Actions example
yaml
- run: npx cypress run
- name: Merge and send to RunPilotAI
if: always()
run: |
npx mochawesome-merge cypress/results/*.json > cypress-results.json
curl -s -X POST https://runpilotai.com/api/ingest/cypress \
-H "Content-Type: application/json" \
-H "x-api-key: ${{ secrets.RUNPILOT_API_KEY }}" \
-d @cypress-results.json