Skip to content

Commit

Permalink
Added test case around exclude and passing in objects
Browse files Browse the repository at this point in the history
  • Loading branch information
reallymello committed Jan 18, 2024
1 parent d19e5a1 commit 30d366b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/canAxeNicely.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,32 @@ describe('axe nightwatch integration tests', () => {
});
});

it('Can pass exclude in an object', (browser) => {
browser
.url('https://www.w3.org/WAI/demos/bad/before/home.html')
.assert.titleEquals('Welcome to CityLights! [Inaccessible Home Page]')
.axeInject()
.axeRun(
{ exclude: ['img', 'td'] },
{
runOnly: ['image-alt', 'aria-hidden-body', 'color-contrast'],
},
(results) => {
browser.assert.ok(
'violations' in results,
'axe results are available in the callback'
);
}
)
.perform(() => {
browser.assert.strictEqual(
browser.currentTest.results.assertions.length,
4,
'There were 4 assertons performed'
);
});
});

it('can use axe command from async function', async (browser) => {
const results = await browser
.url('https://www.w3.org/WAI/demos/bad/after/home.html')
Expand Down

0 comments on commit 30d366b

Please sign in to comment.