How do I hide the Cypress Panel?
CYPRESS_NO_COMMAND_LOG
should work in < 10 and > 10.3 (ish) and set automatically by the @replayio/cypress
plugin on > 10.9How do I get debug logs?
DEBUG=replay:cypress:*
How do I use Replay with earlier versions of Cypress?
Replay works best with Cypress 10.9 or later but can be used with Cypress 8 or later with some additional environment configuration:
RECORD_ALL_CONTENT
must be set when usingreplay-firefox
to record replays
RECORD_REPLAY_METADATA_FILE
must be set for either browser to capture metadata about the test run.
When running locally, you can set these variables in your npm scripts so they are set every time:
json"scripts": { "test:cypress": "cypress run", "test:cypress:replay": "RECORD_ALL_CONTENT=1 RECORD_REPLAY_METADATA_FILE=/tmp/replay-metadata cypress run" }
On CI, you can set these environment variables on the task that runs your tests:
yaml# Install NPM dependencies, cache them correctly # and run all Cypress tests - name: Cypress run uses: cypress-io/github-action@v5 with: browser: replay-chromium env: RECORD_ALL_CONTENT: 1 RECORD_REPLAY_METADATA_FILE: /tmp/replay-metadata
How do I group tests ran in a matrix or across multiple runners into the same test run?
By default, each invocation of Cypress is grouped into a test run by a UUID generated when the run begins. To group multiple invocations of Cypress into the same run, set
RECORD_REPLAY_METADATA_TEST_RUN_ID
to the same UUID value and that will be used instead of generating a UUID for each.Below is an example which runs three test suites using a matrix in Github Actions but groups the results into the same test run in Replay:
yamljobs: test-run-id: runs-on: ubuntu-latest outputs: testRunId: ${{ steps.testRunId.outputs.testRunId }} steps: - id: testRunId run: echo testRunId=$(npx uuid) >> "$GITHUB_OUTPUT" test: needs: test-run-id runs-on: ubuntu-latest strategy: matrix: product: [frontend, backend, api] steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version: 16 - name: Install dependencies run: npm ci - name: Run run: npm run test-${{ matrix.product }} env: RECORD_REPLAY_METADATA_TEST_RUN_ID: ${{ needs.test-run-id.outputs.testRunId }}
RECORD_REPLAY_METADATA_TEST_RUN_TITLE