<aside> π‘
This guide assumes that you already have a Cypress 10.9+ test suite. If youβre just setting up your Cypress test suite, first follow the instructions here.
</aside>
Install the @replayio/cypress
package in your project:
npm install @replayio/cypress -D
Add the Replay plugin to cypress.config.js
const { defineConfig } = require('cypress');
// πββοΈ Add this line to require the replay plugin
const { plugin: replayPlugin } = require("@replayio/cypress")
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
// πββοΈ Add this line to install the replay plugin
replayPlugin(on, config);
// Make sure that setupNodeEvents returns config
return config;
},
},
});
Add this line your support file, which should be cypress/support/e2e.js
for e2e tests (unless modified)
// cypress/support/e2e.js
require('@replayio/cypress/support');
After the setup is complete, you can now try running your tests locally with the Replay browser:
npx cypress run --browser=replay-chromium
<aside> π§ Replay Chromium is GA on Linux and beta for Mac and Windows!
</aside>
<aside> β οΈ If you run into any problems, consult our troubleshooting guide here.
</aside>