-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MLAPB-22: Add cypress and codecept (#17)
* Add cypress and codeceptJS * Add axe/a11y checking to cypress and codeceptJS
- Loading branch information
Showing
16 changed files
with
4,244 additions
and
311 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const { setHeadlessWhen, setCommonPlugins } = require('@codeceptjs/configure'); | ||
|
||
// turn on headless mode when running with HEADLESS=true environment variable | ||
// export HEADLESS=true && npx codeceptjs run | ||
setHeadlessWhen(process.env.HEADLESS); | ||
|
||
// enable all common plugins https://github.com/codeceptjs/configure#setcommonplugins | ||
setCommonPlugins(); | ||
|
||
exports.config = { | ||
tests: './codecept/scenarios/*_test.js', | ||
output: './codecept/output', | ||
helpers: { | ||
Playwright: { | ||
url: 'http://localhost:5050', | ||
show: false, | ||
browser: 'chromium' | ||
}, | ||
AxeRunner: { | ||
require: './codecept/helpers/axeRunner_helper.js' | ||
} | ||
}, | ||
include: { | ||
I: './codecept/steps_file.js' | ||
}, | ||
bootstrap: null, | ||
mocha: {}, | ||
name: 'app' | ||
} |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const Helper = require('@codeceptjs/helper'); | ||
const { injectAxe, checkA11y } = require('axe-playwright') | ||
|
||
class AxeRunner extends Helper { | ||
|
||
// before/after hooks | ||
/** | ||
* @protected | ||
*/ | ||
_before() { | ||
|
||
} | ||
|
||
/** | ||
* @protected | ||
*/ | ||
_after() { | ||
// remove if not used | ||
} | ||
|
||
async runAccessibilityChecks() { | ||
const { page } = this.helpers.Playwright; | ||
await injectAxe(page) | ||
await checkA11y(page, null, { | ||
detailedReport: true, | ||
}) | ||
} | ||
// add custom methods here | ||
// If you need to access other helpers | ||
// use: this.helpers['helperName'] | ||
|
||
} | ||
|
||
module.exports = AxeRunner; |
Oops, something went wrong.