@argos-ci/cypress
v7.0.20
Published
Cypress SDK for visual testing with Argos.
Maintainers
Readme
Official Argos Cypress integration
Capture stable Argos screenshots from your Cypress tests.
Visit the Cypress SDK documentation for guides, the API reference, and more.
Installation
npm install --save-dev @argos-ci/cypressUsage
Register the Argos task in your Cypress config:
// cypress.config.js
const { defineConfig } = require("cypress");
const { registerArgosTask } = require("@argos-ci/cypress/task");
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
registerArgosTask(on, config, {
// Upload the screenshots to Argos only on CI.
uploadToArgos: !!process.env.CI,
});
return config;
},
},
});Import the command in your support file:
// cypress/support/e2e.js
import "@argos-ci/cypress/support";Then capture stable screenshots with cy.argosScreenshot in your tests:
// cypress/e2e/example.cy.js
describe("Homepage", () => {
it("takes a screenshot", () => {
cy.visit("http://localhost:3000");
cy.argosScreenshot("homepage");
});
});