Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jest-puppeteer-axe: migrate to @axe-core/puppeteer #25659

Merged
merged 3 commits into from
Oct 20, 2020

Conversation

Hypnosphi
Copy link
Contributor

axe-puppeteer is deprecated and renamed to @axe-core/puppeteer, see https://github.com/dequelabs/axe-puppeteer#deprecated-axe-puppeteer

@Hypnosphi
Copy link
Contributor Author

@gziolo can you please review?

@gziolo
Copy link
Member

gziolo commented Oct 14, 2020

@Hypnosphi, I'm back from extended leave. I will have a look at this PR in the upcoming days, thanks for proposing those changes 👍

@gziolo gziolo self-assigned this Oct 14, 2020
@gziolo gziolo added the [Tool] Jest Puppeteer aXe /packages/jest-puppeteer-axe label Oct 14, 2020
@gziolo
Copy link
Member

gziolo commented Oct 14, 2020

One note, there are legitimate failures in e2e tests raised by the new version of axe API. The best way of moving forward would be to skip them for the time being and report a separate issue for them. We already maintain the list of disabled rules:

disabledRules: [
'aria-allowed-role',
'aria-allowed-attr',
'aria-hidden-focus',
'aria-input-field-name',
'aria-valid-attr-value',
'button-name',
'color-contrast',
'dlitem',
'duplicate-id',
'label',
'landmark-one-main',
'link-name',
'listitem',
'region',
],

@gziolo
Copy link
Member

gziolo commented Oct 15, 2020

There are two things that would make this PR complete:

  1. aria-required-children and aria-required-parent are two rules that need to be disabled in the check for e2e tests.
  2. An entry in the CHANGELOG (https://github.com/WordPress/gutenberg/blob/master/packages/jest-puppeteer-axe/CHANGELOG.md) file describing the change would be very useful as well.

@Hypnosphi Hypnosphi requested a review from talldan as a code owner October 16, 2020 01:40
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some additional comments that should conclude this PR.

packages/jest-puppeteer-axe/package.json Outdated Show resolved Hide resolved
packages/jest-puppeteer-axe/package.json Outdated Show resolved Hide resolved
packages/jest-puppeteer-axe/CHANGELOG.md Outdated Show resolved Hide resolved
packages/jest-puppeteer-axe/CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl>
@gziolo
Copy link
Member

gziolo commented Oct 19, 2020

There's still one e2e test failing:

FAIL packages/e2e-tests/specs/local/demo.test.js (6.605s)
29
  ● new editor state › should be immediately saveable
30

31
    expect(jest.fn()).not.toHaveErrored(expected)
32

33
    Expected mock function not to be called but it was called with:
34
    ["Failed to inject axe-core into frame (about:blank)"],["Failed to inject axe-core into frame (about:blank)"],["Failed to inject axe-core into frame (about:blank)"]
35

36
      at assertExpectedCalls (../jest-console/build/@wordpress/jest-console/src/index.js:36:4)
37
          at runMicrotasks (<anonymous>)
38

It's surprising to see it. Let me restart tests and debug locally if it doesn't help.

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested locally and I see the same e2e test failure on master branch. Let's get this in and explore it separately.

Thank you again for the patch 💯

@gziolo gziolo merged commit 68d4318 into WordPress:master Oct 20, 2020
@github-actions github-actions bot added this to the Gutenberg 9.3 milestone Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Tool] Jest Puppeteer aXe /packages/jest-puppeteer-axe
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants