-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WEBUI-1317: Accessibility checks are failing after upgrade NodeJS 18-1
- Loading branch information
1 parent
abe37d4
commit 9ada451
Showing
9 changed files
with
69 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,40 @@ | ||
// eslint-disable-next-line import/no-unresolved | ||
import { source } from 'axe-core'; | ||
|
||
export function runAxeCore() { | ||
// inject the axe-core lib | ||
browser.execute(source); | ||
class AxeCore { | ||
async run() { | ||
await browser.execute(source); | ||
const options = { | ||
runOnly: { | ||
type: 'tag', | ||
values: ['ACT', 'best-practice', 'wcag2a', 'wcag2aa'], | ||
}, | ||
}; | ||
// run inside browser and get results | ||
const results = await browser.executeAsync((opts, done) => { | ||
// eslint-disable-next-line no-undef | ||
axe | ||
.run(opts) | ||
.then((res) => done(res)) | ||
.catch((err) => { | ||
throw err; | ||
}); | ||
}, options); | ||
return this.process(await results); | ||
} | ||
|
||
// https://github.com/dequelabs/axe-core/blob/develop/doc/API.md | ||
const options = { | ||
runOnly: { | ||
type: 'tag', | ||
values: ['ACT', 'best-practice', 'wcag2a', 'wcag2aa'], | ||
}, | ||
}; | ||
// run inside browser and get results | ||
const results = browser.executeAsync((opts, done) => { | ||
// eslint-disable-next-line no-undef | ||
axe | ||
.run(opts) | ||
.then((res) => done(res)) | ||
.catch((err) => { | ||
throw err; | ||
}); | ||
}, options); | ||
|
||
return { | ||
results, | ||
incomplete: results.incomplete.map((a) => { | ||
return { id: a.id, issues: a.nodes.length }; | ||
}), | ||
violations: results.violations.map((a) => { | ||
return { id: a.id, issues: a.nodes.length }; | ||
}), | ||
}; | ||
process(results) { | ||
return { | ||
results, | ||
incomplete: results.incomplete.map((a) => { | ||
return { id: a.id, issues: a.nodes.length }; | ||
}), | ||
violations: results.violations.map((a) => { | ||
return { id: a.id, issues: a.nodes.length }; | ||
}), | ||
}; | ||
} | ||
} | ||
export async function runAxeCore() { | ||
return new AxeCore().run(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import Login from '@nuxeo/nuxeo-web-ui-ftest/pages/login'; | ||
import UI from '@nuxeo/nuxeo-web-ui-ftest/pages/ui'; | ||
|
||
const login = (username = 'Administrator', password = 'Administrator') => { | ||
const login = async (username = 'Administrator', password = 'Administrator') => { | ||
const logIn = Login.get(); | ||
logIn.username = username; | ||
logIn.password = password; | ||
logIn.submit(); | ||
await logIn.username(username); | ||
await logIn.password(password); | ||
await logIn.submit(); | ||
const ui = UI.get(); | ||
ui.waitForVisible('nuxeo-page'); | ||
await ui.waitForVisible('nuxeo-page'); | ||
}; | ||
|
||
export default login; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters