logo
The @replayio/cypress plugin includes a cypress runner that includes diagnostic modes to help identify issues with the Replay browsers. The runner uses cypressโ€™s module API to invoke cypress multiple times with different environment variables to adjust the behavior of the Replay browser.
shell
npx @replayio/cypress run --mode <mode> <...other cypress parameters>

Record on Retry

shell
npx @replayio/cypress run --mode record-on-retry
Runs the test suite once with recording disabled and if any specs fail, those are re-ran with recording enabled.

Stress

shell
npx @replayio/cypress run --mode stress
Runs the test suite 10 times regardless of test result

Diagnostics

shell
npx @replayio/cypress run --mode diagnostics --level basic

Basic

When level is set to basic, the test suite is run 3 times:
  1. Recording disabled
  1. Recording enabled
  1. Recording enabled with debug assertions disabled

Full

When level is set to full, the test suite is run many times (currently 38) with each run disabling a different browser feature. Due to the number of runs, this should often be limited to a specific spec file that is failing.
shell
npx @replayio/cypress run --mode diagnostics --level full --spec cypress/e2e/failing-spec.ts

Running a test case multiple times in development

If you want to quickly reproduce a flaky test, you can also re-run the test case in a loop several times as well. This strategy can sometimes be easier if you want to quickly record a flake locally.
javascript
describe('Verify "Login" is visible. Test: '+i, () => { for (let i = 0; i < 3 ; i++) { it('finds the Login link in the header', () => { //Place code inside the loop that you want to repeat }) } })