Skip to content

Axe results inconsistencies between "@axe-core/webdriverjs" and "@axe-core/playwright" #1090

@soykje

Description

@soykje

Product

playwright

Product Version

^4.9.1

Latest Version

  • I have tested the issue with the latest version of the product

Issue Description

Expectation

After developping a custom solution for testing a components library using @axe-core/webdriverjs I wanted to improve my project's workflow using Playwright and the dedicated @axe-core/playwright package.

Both were configured with same options:

export const AxeOptions: RunOptions = {
  resultTypes: ['violations', 'incomplete'],
  rules: {
    'page-has-heading-one': { enabled: false },
    'landmark-one-main': { enabled: false },
    region: { enabled: false },
    'color-contrast': { enabled: false },
  },
  runOnly: ['best-practice', 'wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'],
  reporter: 'v2',
}

As I was using same configuration of the AxeBuilder I expected having same results when testing this page. But for some reason it is not the case 😞

Actual

The custom script actually returns no errors (no violation nor incomplete one). But when I run my Playwright test, I got following results.

How to Reproduce

You can clone the related project. Then:

  • npm i
  • npm run test:a11y for Playwright+Axe implementation. The result will be directly logged, and also written as JSON file at public/a11y/a11y-report.json.
  • npm run a11y:check for custom script execution. If having some selenium-webdriver issues please execute npm run storybook:start then in parallel node bin/check-a11y.js. The result will be directly logged, and also written as JSON file at public/a11y-report.json.

Additional context

As I'm perfectly fine with fixing errors, I'd be very happy to understand the reason of these differences 🙂 Maybe I forgot something in my implementations/instanciations of any of the Axe packages?
Anyway, as I'd like to compare both solutions (CI execution time, ...) before eventually going with Playwright one, I'd like to have them working with equivalent configuration!

Thx in advance for all your amazing work, and for your help! 🙏

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions