-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Testing: Add partial support for Axe verification in e2e tests #15018
Conversation
98d1e37
to
52a4193
Compare
Observed failures on Travis which seem to be unrelated to this PR:
@notnownikki any ideas? It looks like there are real network requests being triggered. I don't observe those failures locally. |
The tests look fine to me, all requests should be mocked there and I don't see those network requests when running locally. Looking at it further now. |
This might take me a while, Gutenberg master to longer works for me locally at all.
|
All I can tell at the moment is that during the tests, we're getting youtube content embedded during tests that should not touch youtube at all. That's very very weird. However, there is a network request happening inside the image block, and perhaps if we mock that, these errors might disappear. It needs to be done anyway. The way the image block to embed block replacement is triggered is through trying to display the image with the src set to the url of what the user entered, and |
0f126de
to
d93f590
Compare
26ebd7d
to
e792d47
Compare
|
||
await expect( page ).toPassAxeTests( { | ||
// Temporary disabled rules to enable initial integration. | ||
// See: https://github.com/WordPress/gutenberg/pull/15018. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to have these in a tracking issue, perhaps structured as a checklist to iteratively mark progress.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will do it after merging this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#15452 opened
This reverts commit 35b5a5c5b6714d08694a0fae5ce1ba3fc81a0e2f.
e792d47
to
21ea6ea
Compare
Description
This is a follow-up for #13241.
This PR enables Axe tests for every individual e2e test containing the block editor. They will run at the end of each test and perform static accessibility related analysis based on the DOM present in the test. It isn't perfect but it should help to catch basic regressions moving forward.
To get use there I had to temporary disable the following rules:
aria-allowed-role
aria-valid-attr-value
button-name
color-contrast
dlitem
duplicate-id
label
link-name
listitem
region
All rules are listed here:
https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md
I also excluded HTML elements containing the following class names:
.edit-post-layout__metaboxes
- ignores elements created by metaboxes.mce-container
- gnores elements created by TinyMCEThis helps to avoid false negatives when code unrelated to Gutenberg triggers errors.
Duration of tests
There is a noticable impact on the duration of the full test suite run. I'm observing 2-5 minutes duration increase which is the cost of running verifications for all tests.
Before
After
Testing
npm run test-e2e
To ensure that tests fail you can enable one of the rules as follows:
This is how errors are going to be presented:
Next steps
I plan to update a follow-up issues for every disabled rule with the example of failing tests and details. I'll take care of it next week.