The
@replayio/cypress package includes an optional wrapper around cypress.run() which exposes a few additional features. run() accepts all the same parameters as cypress.run() as well as the following Replay-specific options:mode- The wrapper runs in one of three modes'record'- The default mode which records all tests'record-on-retry'- The whole suite is run one without recording. Any failures are accumulated and re-ran with recording enabled'stress'- Runs the suite multiple times with recording to capture flaky tests. Also see--count.'diagnostic'-Runs the suite in a diagnostic mode which runs multiple times with various flags set to adjust Replayโs behaviors to isolate problems.
count- When running withmode: 'stress', settingcountcontrols how many times the run is repeated
'level'- When running withmode: 'diagnostic',levelcan be set to'basic'or'full'to control which diagnostics are ran.
timeout- Configures the time in milliseconds each iteration ofcypress.run()is allowed to run
javascriptimport { run } from '@replayio/cypress' // Runs cypress/e2e/my-test-spect.ts in record-on-retry mode // with a 10s timeout for each attempt. run({ mode: "record-on-retry", spec: "cypress/e2e/my-test-spec.ts", timeout: 10000 }).then(() => { console.log("Done!"); });