-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Migrating cypress to v10 This is a breaking change for v10 * Update README with correct file name * Updating v10 and v9 specific instructions. * Updating installation instructions for cypress-axe * Dropping nodejs v10 and adding v16 to workflow.
- Loading branch information
1 parent
8d47177
commit 9e770d9
Showing
8 changed files
with
5,054 additions
and
229 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,17 +8,36 @@ Test accessibility with [axe-core](https://github.com/dequelabs/axe-core) in [Cy | |
|
||
1. **Install `cypress-axe` from npm:** | ||
|
||
- For Cypress v10 install latest cypress-axe | ||
|
||
```sh | ||
npm install --save-dev cypress-axe | ||
``` | ||
|
||
2. **Install peer dependencies:** | ||
- For Cypress v9 install 0.x.x | ||
|
||
```sh | ||
npm install --save-dev [email protected] | ||
``` | ||
|
||
1. **Install peer dependencies:** | ||
|
||
- For Cypress v10 and above | ||
|
||
```sh | ||
npm install --save-dev cypress axe-core | ||
``` | ||
|
||
3. **Include the commands.** Update `cypress/support/index.js` file to include the cypress-axe commands by adding: | ||
- For Cypress v9 and below install the specific cypress version you are using For example if you are using cypress v9.6.0 | ||
|
||
```sh | ||
npm install --save-dev [email protected] axe-core | ||
``` | ||
|
||
1. **Include the commands.** | ||
|
||
- For Cypress v10 and above update `cypress/support/e2e.js` file to include the cypress-axe commands by adding: | ||
- For Cypress v9 and below update `cypress/support/index.js` file to include the cypress-axe commands by adding: | ||
|
||
```js | ||
import 'cypress-axe' | ||
|
@@ -156,10 +175,8 @@ it('Has no a11y violations after button click', () => { | |
|
||
it('Only logs a11y violations while allowing the test to pass', () => { | ||
// Do not fail the test when there are accessibility failures | ||
cy.checkA11y(null, null, null, true); | ||
cy.checkA11y(null, null, null, true) | ||
}) | ||
|
||
|
||
``` | ||
|
||
#### Using the violationCallback argument | ||
|
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,9 @@ | ||
/* eslint @typescript-eslint/no-var-requires: "off" */ | ||
const { defineConfig } = require('cypress'); | ||
|
||
module.exports = defineConfig({ | ||
e2e: { | ||
baseUrl: 'http://localhost:8080', | ||
video: false, | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.