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,23 +1,15 @@
import { Options } from "cypress-axe";
import { TEST_COLLECTION } from "cypress/support";
import { TEST_COLLECTION } from 'cypress/support';
import { testA11y } from 'cypress/support/utils';
describe('Collection Page', () => {
it('should pass accessibility tests', () => {
cy.visit('/collections/' + TEST_COLLECTION);
cy.injectAxe();
// <ds-collection-page> tag must be loaded
cy.get('ds-collection-page').should('exist');
// Analyze <ds-collection-page> for accessibility issues
// Disable color-contrast checks until it is fixed (see #1202 and #1178)
cy.checkA11y('ds-collection-page',
{
rules: {
'color-contrast': { enabled: false }
}
} as Options
);
testA11y('ds-collection-page');
});
});