# Cypress end-to-end setup

> Configure the KwikQA Cypress reporter, keep JUnit or Mochawesome alongside it, and capture end-to-end failures.

KwikQA diagnoses, repairs, and validates Cypress end-to-end tests from its own reporter, Mochawesome JSON, or Cypress JUnit XML. Use the KwikQA reporter to retain individual retries, test locations, and error code frames. For component testing, see [unsupported frameworks](https://kwikqa.com/docs/setup/#unsupported-frameworks).

## Configure Cypress

Use the project's existing Cypress and TypeScript setup. The example keeps Cypress's default support-file discovery.

```
npm i -D kwikqa
```

```
// cypress.config.ts
import { defineConfig } from "cypress";

export default defineConfig({
  reporter: "node_modules/kwikqa/dist/cypress-reporter.cjs",
  e2e: {
    baseUrl: "http://localhost:3000",
    specPattern: "cypress/e2e/**/*.cy.{js,jsx,ts,tsx}",
  },
});
```

Set `baseUrl` to your running app and keep any existing `setupNodeEvents` and E2E settings. With npm's standard `node_modules` layout, the reporter path is relative to the test project's root.

## Keep JUnit or Mochawesome

For multiple outputs, replace `reporter` in the Cypress config and add `reporterOptions`. The exported `kwikqa/cypress-reporter` package path lets the multiplexer resolve it as a Node module.

```
npm i -D cypress-multi-reporters mocha-junit-reporter
```

```
// cypress.config.ts
import { defineConfig } from "cypress";

export default defineConfig({
  reporter: "cypress-multi-reporters",
  reporterOptions: { configFile: "cypress-reporters.json" },
  e2e: {
    baseUrl: "http://localhost:3000",
    specPattern: "cypress/e2e/**/*.cy.{js,jsx,ts,tsx}",
  },
});
```

Save this as `cypress-reporters.json`.

```
{
  "reporterEnabled": "spec, kwikqa/cypress-reporter, mocha-junit-reporter",
  "mochaJunitReporterReporterOptions": {
    "mochaFile": "cypress/results/results-[hash].xml"
  }
}
```

If you use the Mocha `mochawesome` reporter, install it and use this alternative `cypress-reporters.json`. Projects with an existing `cypress-mochawesome-reporter` plugin can also keep its normal configuration and point KwikQA at its JSON output.

```
npm i -D mochawesome
```

```
{
  "reporterEnabled": "spec, kwikqa/cypress-reporter, mochawesome",
  "mochawesomeReporterOptions": {
    "reportDir": "mochawesome-report",
    "overwrite": false,
    "html": false,
    "json": true
  }
}
```

Start each run with clean output directories. Give KwikQA only the report format you want it to read. JUnit and Mochawesome can omit earlier failed attempts of tests that pass on retry. For ambiguous JUnit XML, pass `--framework cypress`.

## Analyze a failing run

```
npx cypress run
npx kwikqa analyze --report test-results/kwikqa --html
```

Run `npx kwikqa analyze --report test-results/kwikqa --capture` to rerun the failing specs and collect page DOM, command, console, and network evidence. Run it where the app and Cypress are available. For an account-free report with failure groups, add `--local`. For an eligible failure, continue with [your first repair](https://kwikqa.com/docs/first-repair/).

See the [Cypress reporter guide](https://docs.cypress.io/app/tooling/reporters) for other combinations.

---

Source: https://kwikqa.com/docs/frameworks/cypress/, updated 2026-11-27
