Miss any of our Open RFC calls?Watch the recordings here! »

@netsells/cypress-commands

2.0.3 • Public • Published

Cypress Commands

Build Status

Useful commands for testing accessibility issues in Cypress

Installation

yarn add --dev @netsells/cypress-commands

Setup

In support/commands.js:

const { loadAccessibilityCommands } = require('@netsells/cypress-commands');
 
loadAccessibilityCommands();

In plugins/index.js:

const { loadAccessibilityPlugins } = require('@netsells/cypress-commands');
 
module.exports = (on, config) => {
    loadAccessibilityPlugins(on, config);
}
 

Usage

checkAccessibility

Assert a pages HTML is accessible using the PayPal AATT

// visit a page
cy.visit('/page');
// assert the page has finished loading
cy.contains('Page Title').should('be.visible');
// assert its accessibility
cy.checkAccessibility();

field

Get a field by via its label

cy.field('Password', field => field.type('Password'));

createAccessiblityTests

Use this to easily generate lots of accessibility tests for multiple URLs.

import { createAccessiblityTests } from '@netsells/cypress-commands';
 
createAccessiblityTests('/', 'gift-cards', 'login');

Keywords

none

Install

npm i @netsells/cypress-commands

DownloadsWeekly Downloads

36

Version

2.0.3

License

ISC

Unpacked Size

210 kB

Total Files

27

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar