I'm trying to run axe-core/cli as a Github Action on my pipeline, however I keep getting this error:
"Error: session not created: This version of ChromeDriver only supports Chrome version 121 Current browser version is 120.0.6099.224 with binary path /opt/google/chrome/chrome
Please install a matching version of ChromeDriver and run axe with the --chromedriver-path option"
I'm not sure what to do here, and struggling to find any useful information. Anyone know how I can get this to work?
name: CI Tests
on:
pull_request:
branches: [main]
jobs:
axe:
runs-on: ubuntu-latest
env:
WORDPRESS_API_URL: XYZ
GITHUB_API_SECRET: ABC
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: 18.x
- run: yarn install
- run: yarn run build
- run: yarn dev & npx wait-on http://localhost:3000
- name: Run axe
run: |
yarn add @axe-core/cli
npx axe http://localhost:3000 --exit
Thanks to Steven Lambert for pointing me in the right direction. With a bit of trial and error, I ended up with this, which is working: