Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: component-driven/cypress-axe
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.14.0
Choose a base ref
...
head repository: component-driven/cypress-axe
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.0.0
Choose a head ref
  • 2 commits
  • 8 files changed
  • 3 contributors

Commits on Jun 16, 2022

  1. Migrating cypress to v10 (#130)

    * 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.
    srikanthkyatham authored Jun 16, 2022
    Copy the full SHA
    9e770d9 View commit details
  2. feat: support Cypress 10 (#133)

    BREAKING CHANGE: upgrading to Cypress 10 is a breaking change
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    bmordue and dependabot[bot] authored Jun 16, 2022
    Copy the full SHA
    d280f0e View commit details
Showing with 4,748 additions and 467 deletions.
  1. +11 −12 .github/workflows/node.js.yml
  2. +22 −5 README.md
  3. +9 −0 cypress.config.js
  4. +0 −4 cypress.json
  5. 0 cypress/{integration/test.js → e2e/test.cy.js}
  6. 0 cypress/support/{index.js → e2e.js}
  7. +4,704 −444 package-lock.json
  8. +2 −2 package.json
23 changes: 11 additions & 12 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -5,25 +5,24 @@ name: Node.js CI

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
node-version: [12.x, 14.x, 16.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
27 changes: 22 additions & 5 deletions README.md
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 cypress-axe@0.14.0
```

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 cypress@9.6.0 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
9 changes: 9 additions & 0 deletions cypress.config.js
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,
},
});
4 changes: 0 additions & 4 deletions cypress.json

This file was deleted.

File renamed without changes.
File renamed without changes.
Loading