@ariada-org/cypress-ariada
v0.1.1
Published
Cypress custom command and Node task for running Ariada accessibility scans from Cypress suites.
Maintainers
Readme
@ariada-org/cypress-ariada
Cypress custom command and Node task for running Ariada accessibility scans from Cypress suites.
// cypress.config.ts
import { defineConfig } from 'cypress';
import { setupAriadaNodeEvents } from '@ariada-org/cypress-ariada/plugin';
export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
return setupAriadaNodeEvents(on, config);
},
},
});// cypress/support/e2e.ts
import '@ariada-org/cypress-ariada';cy.visit('/checkout');
cy.ariadaScan({ severityThreshold: 'serious' });cy.ariadaScan() reads the current Cypress-controlled URL, calls the ariada:scan Node task, and fails the Cypress command when findings at or above the configured threshold are returned.
Scanner Path
The package is a thin Cypress adapter. The Node task delegates to the shared @ariada-org/cli scanner and normalises its JSON output for Cypress assertions; it does not implement scanning rules.
Chromium runs use the Ariada CLI scanner's Chromium path, where the engine can use the richer browser accessibility tree. For non-Chromium browsers or environments where a CDP accessibility-tree session is not reachable, the result is reported as dom-fallback and still uses the shared rule-library output from the Ariada CLI pipeline.
API
registerAriadaCommand(Cypress?, cy?): registerscy.ariadaScan().setupAriadaNodeEvents(on, config, defaults?): registers theariada:scantask.runAriadaScan(url, options?): Node-side wrapper around@ariada-org/clirunScan.
Options:
severityThreshold:minor,moderate,serious, orcritical; defaultmoderate.browser:chromium,firefox, orwebkit; defaultchromium.timeoutMs: scanner navigation timeout.outputDir: directory for CLI JSON output.failOnViolation: setfalseto return findings without throwing in Cypress.logOnly: settrueto log findings without failing the Cypress command.taskTimeoutMs: Cypress task timeout; default 120 seconds.
Evidence
Run:
pnpm --filter @ariada-org/cypress-ariada scan:evidenceThis writes scan-evidence/result.html with embedded evidence for the Cypress failure surface.
