Skip to content

Commit

Permalink
adding test exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Claire.Nicholas authored and Claire.Nicholas committed Oct 12, 2023
1 parent 091d6be commit b737606
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 24 deletions.
12 changes: 10 additions & 2 deletions cypress/integration/a11y.lighttheme.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ const A11Y_OPTS = {
type: 'tag',
values: ['section508', 'best-practice', 'wcag21aa', 'wcag2aa'],
},
rules: {
'color-contrast': { enabled: false },
'page-has-heading-one': { enabled: false },
},
};

const elmExclude = '[style*="padding-left: calc(1ch + 6px)"]';

context('Accessibility (a11y)', () => {
context('Logged out', () => {
it('overview', () => {
Expand All @@ -17,7 +23,8 @@ context('Accessibility (a11y)', () => {
cy.visit('/account/login');
cy.injectAxe();
cy.wait(500);
cy.checkA11y({exclude: ['[style*="padding-left: calc(1ch + 6px)"]']}, A11Y_OPTS);
// excludes accessibility testing for Elm pop-up that only appears in Cypress and not on the actual UI
cy.checkA11y({exclude: [elmExclude]}, A11Y_OPTS);
});
});

Expand Down Expand Up @@ -88,7 +95,8 @@ context('Accessibility (a11y)', () => {
cy.injectAxe();
cy.wait(500);
cy.clickSteps();
cy.checkA11y({exclude: ['[style*="padding-left: calc(1ch + 6px)"]']}, A11Y_OPTS);
// excludes accessibility testing for Elm pop-up that only appears in Cypress and not on the actual UI
cy.checkA11y({exclude: [elmExclude]}, A11Y_OPTS);
});
});
});
44 changes: 23 additions & 21 deletions cypress/integration/a11y.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,31 @@
*/

const A11Y_OPTS = {
// runOnly: {
// type: 'tag',
// values: ['section508', 'best-practice', 'wcag21aa', 'wcag2aa'],
// },
runOnly: {
type: 'tag',
values: ['section508', 'best-practice', 'wcag21aa', 'wcag2aa'],
},
rules: {
'color-contrast': { enabled: false },
'page-has-heading-one': { enabled: false },
},
};

context('Accessibility (a11y)', () => {
// context('Logged out', () => {
// it.skip('overview', () => {
// cy.clearSession();
// cy.visit('/account/login');
// cy.injectAxe();
// cy.wait(500);
// cy.checkA11y(A11Y_OPTS);
// });
// });
context('Logged out', () => {
it.skip('overview', () => {
//cy.clearSession();
cy.visit('/account/login');
cy.injectAxe();
cy.wait(500);
// excludes accessibility testing for Elm pop-up that only appears in Cypress and not on the actual UI
cy.checkA11y({exclude: [elmExclude]}, A11Y_OPTS);
});
});

context('Logged in', () => {
beforeEach(() => {
cy.clearSession();
//cy.clearSession();
cy.server();
// overview page
cy.route('GET', '*api/v1/user*', 'fixture:favorites.json');
Expand Down Expand Up @@ -73,20 +78,17 @@ context('Accessibility (a11y)', () => {
cy.checkA11yForPage('/github/octocat', A11Y_OPTS);
});

it.skip('hooks page', () => {
cy.login('/github/octocat/hooks');
cy.injectAxe();
cy.wait(500);
cy.get('[data-test=hook]').click({ multiple: true });
cy.checkA11y(A11Y_OPTS);
it('hooks page', () => {
cy.checkA11yForPage('/github/octocat/hooks', A11Y_OPTS);
});

it.skip('build page', () => {
cy.login('/github/octocat/1');
cy.injectAxe();
cy.wait(500);
cy.clickSteps();
cy.checkA11y(A11Y_OPTS);
// excludes accessibility testing for Elm pop-up that only appears in Cypress and not on the actual UI
cy.checkA11y({exclude: [elmExclude]}, A11Y_OPTS);
});
});
});
1 change: 1 addition & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ Cypress.Commands.add('checkA11yForPage', (path = '/', opts = {}) => {
cy.login(path);
cy.injectAxe();
cy.wait(500);
// excludes accessibility testing for Elm pop-up that only appears in Cypress and not on the actual UI
cy.checkA11y({exclude: ['[style*="padding-left: calc(1ch + 6px)"]']}, opts);
});

Expand Down
2 changes: 1 addition & 1 deletion src/elm/Pages/Hooks.elm
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ hooksToRows now hooks org repo redeliverHook =
-}
tableHeaders : Table.Columns
tableHeaders =
[ ( Just "-icon", "" )
[ ( Just "-icon", "Status" )
, ( Nothing, "source" )
, ( Nothing, "created" )
, ( Nothing, "host" )
Expand Down

0 comments on commit b737606

Please sign in to comment.