Add logging for violations & testA11y() in utils.ts. Use that method everywhere else

This commit is contained in:
Tim Donohue
2021-09-13 17:11:53 -05:00
parent fad74a4ca2
commit 4faa850fba
16 changed files with 100 additions and 65 deletions

View File

@@ -1,5 +1,6 @@
import { Options } from "cypress-axe";
import { TEST_ENTITY_PUBLICATION } from "cypress/support";
import { Options } from 'cypress-axe';
import { TEST_ENTITY_PUBLICATION } from 'cypress/support';
import { testA11y } from 'cypress/support/utils';
describe('Item Page', () => {
const ITEMPAGE = '/items/' + TEST_ENTITY_PUBLICATION;
@@ -13,14 +14,13 @@ describe('Item Page', () => {
it('should pass accessibility tests', () => {
cy.visit(ENTITYPAGE);
cy.injectAxe();
// <ds-item-page> tag must be loaded
cy.get('ds-item-page').should('exist');
// Analyze <ds-item-page> for accessibility issues
// Disable heading-order checks until it is fixed
cy.checkA11y('ds-item-page',
testA11y('ds-item-page',
{
rules: {
'heading-order': { enabled: false }