By default, Cypress does not support multiple reporters. To maintain your existing reporter behavior, you'll need to install mocha-multi-reporters
. This package acts as a single reporter for Cypress (which behind the scenes runs Mocha) and delegates to any number of other reporters configured with it: npm install --save-dev mocha-multi-reporters
.
Additionally, you'll need to install mocha-junit-reporter
to produce JUnit output. We'll configure mocha-multi-reporters
to produce the standard built-in Cypress output (spec
) and JUnit output: npm install --save-dev mocha-junit-reporter
.
Once both packages are installed, adapt your own Cypress configuration and Cypress multi-reporters configuration to configure Cypress to use the reporters as we have in this example.
Create an Access Token for your organization within Captain (more documentation here).
Add the new token as an action secret to your repository. Conventionally, we call this secret RWX_ACCESS_TOKEN
.
See the full documentation on test suite integration.
- uses: rwx-research/setup-captain@v1
- name: Run Cypress
uses: cypress-io/github-action@v4
with:
browser: chrome
config: "video=false"
command-prefix: "captain run --suite-id captain-examples-cypress --test-results \"tmp/junit/*.xml\" --"
env:
RWX_ACCESS_TOKEN: ${{ secrets.RWX_ACCESS_TOKEN }}
Take a look at the final workflow, Cypress configuration, and Cypress multi-reporters configuration!