We recommend running your tests with linux using
Replay Chromium
in CI.The steps may be different depending on how you run tests in CI, so pick one of the options below that best applies to you.
Replay Chromium
in CI.cypress-io/github-action
yaml- name: Cypress run uses: cypress-io/github-action@v5 with: # πββοΈ Specify Replay Chromium browser: "Replay Chromium" env: # πββοΈ Add these environment variable RECORD_REPLAY_METADATA_FILE: /tmp/replay-metadata RECORD_REPLAY_DISABLE_ASSERTS: 1 RECORD_REPLAY_DISABLE_SOURCEMAP_COLLECTION: 1
yaml- name: Upload replays if: always() uses: replayio/action-upload@v0.4.6 with: api-key: ${{ secrets.RECORD_REPLAY_API_KEY }}
cypress-io/github-action
package.json
like this:json"scripts": { "cy:run": "cypress run", // original test script "cy:run:replay": "cypress run --browser='Replay Chromium'" // new test script }
yaml- name: Cypress run # run: npm run cy:run run: npm run cy:run:replay env: # πββοΈ Add this environment variable RECORD_REPLAY_METADATA_FILE: /tmp/replay-metadata RECORD_REPLAY_DISABLE_ASSERTS: 1 RECORD_REPLAY_DISABLE_SOURCEMAP_COLLECTION: 1
yaml- name: Upload replays if: always() uses: replayio/action-upload@v0.4.6 with: api-key: ${{ secrets.RECORD_REPLAY_API_KEY }}
npm install
or yarn
command to install project dependencies:bashnpm install # or yarn
package.json
for running tests with Replay, and replace your current test script in your CI workflow file:json"scripts": { "cy:run": "cypress run", // original test script "cy:run:replay": "cypress run --browser='Replay Chromium'" // new test script }
bashnpm i -g @replayio/replay replay metadata --init --keys source --warn replay upload-all --api-key <api key>