-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
tests(report): add axe-core validation of report output #9421
Conversation
I am not sure how this slowed down boot time when it is adding a test, does the boot time come from test runs? ✘ difference at bootup-time audit.details
expected: {"items":{"0":{"scripting":">1000"}}}
found: undefined
found result:
{
"id": "bootup-time",
"title": "JavaScript execution time",
"description": "Consider reducing the time spent parsing, compiling, and executing JS. You may find delivering smaller JS payloads helps with this. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/bootup).",
"score": null,
"scoreDisplayMode": "error",
"errorMessage": "Fatal trace logic error - expected start event, got X"
} |
lighthouse-core/test/report/html/renderer/report-renderer-test.js
Outdated
Show resolved
Hide resolved
lighthouse-core/test/report/html/renderer/report-renderer-test.js
Outdated
Show resolved
Hide resolved
lighthouse-core/test/report/html/renderer/report-renderer-test.js
Outdated
Show resolved
Hide resolved
lighthouse-core/test/report/html/renderer/report-renderer-test.js
Outdated
Show resolved
Hide resolved
@johnemau iirc that particular test is flaky. Let's see if it happens again on your next push. |
lighthouse-core/test/report/html/renderer/report-renderer-test.js
Outdated
Show resolved
Hide resolved
lighthouse-core/test/report/html/renderer/report-renderer-test.js
Outdated
Show resolved
Hide resolved
lighthouse-core/test/report/html/renderer/report-renderer-test.js
Outdated
Show resolved
Hide resolved
lighthouse-core/test/report/html/renderer/report-renderer-test.js
Outdated
Show resolved
Hide resolved
lighthouse-core/test/report/html/renderer/report-renderer-test.js
Outdated
Show resolved
Hide resolved
I'm not sure about the fidelity of the axe tests when run against jsdom, since most of styling and layout isn't simulated. Some structural stuff will be caught, but it might be easier to run this as one of the smoke tests against a generated report (one of which is generated for at least the now.sh deployment) |
❤️ |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
I made a web edit and forgot that would default to my private github email which triggered the cla bot message. I will rebase the branch on Monday with my corrected author email to resolve the issue. |
If that is a better approach I can move this over to the smoke tests. I didn't look closely at the smoke tests before starting this work, instead I used adding this test as a learning exercise into how the reports are generated. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
@brendankenny I took a look at the smoke tests and because they currently require a pre-checked in test fixture would it preferred to check in a snapshot of the report view once and update it periodically or add a step to the smoke test infrastructure that generates a report on the fly? If we want to continue down that road it might be better to consider it a new kind of test all together because axe-core relies on webdriver. That would definitely catch more types of issues (at the cost of runtime/flakyness) and it depends on what the project's appetite is for webdriver. I think this is a good starting point with a todo to replace with a webdriver based test in the future. |
Yes, I think adding that step would be the best fix available. Lighthouse runs
So I think we'd need:
the ugliest part of this is the second bullet point, but I can't think of a great way around it that wouldn't require anyone wanting to run the smoke tests to always run both Anyone else have thoughts on this? |
(spoiler: we also fail the contrast check) Other benefits of this approach:
|
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.
LGTM
lighthouse-core/test/report/html/renderer/report-renderer-test.js
Outdated
Show resolved
Hide resolved
Make sense to me but it will take me a while to get ramped up on the smoke test infrastructure and get any PRs out. In the meantime this test is ready to go and will provide some basic coverage so I will leave this PR open if anyone wants to move forward with it / merge. |
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.
Agreed @johnemau! This is a great start and smoketest seems like a perfect candidate for future followup.
Summary
Add a test to run axe-core validation on the output of a sample report,
any violations are logged as the assert failure message.
Example Failure Output:
Axe-core is slow so I needed to bump the timeout to 10 seconds.