Cypress Component Testing Setup
Using DeploySentinel for Cypress Component Testing only requires minimal changes to your Cypress configuration.
Installing
Install NPM Package
npm install -D @deploysentinel/cypress-debugger
Add Plugin & Support Files
// Cypress Config File (cypress.config.js)
const { defineConfig } = require('cypress');
module.exports = defineConfig({
component: {
setupNodeEvents(on, config) {
// ❗ Must be declared at the top of the function to prevent conflicts
[on, config] = require('@deploysentinel/cypress-debugger/plugin')(
on,
config,
);
},
},
});
Note: This example overwrites the on
and config
variables on purpose to
workaround downstream plugin conflicts.
// Cypress Component Support File (cypress/support/component.js)
import '@deploysentinel/cypress-debugger/support'; // ❗ Must be imported top of file
import './commands';
Run With API key
Chrome Example:
CYPRESS_DEPLOYSENTINEL_KEY=YOUR_API_KEY npx cypress run --component --browser chrome
Electron Example:
ELECTRON_EXTRA_LAUNCH_ARGS="--remote-debugging-port=40500" CYPRESS_DEPLOYSENTINEL_KEY=YOUR_API_KEY npx cypress run --component --browser electron