Add start of GUI tests for clippy lints page #13618
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the beginning of adding GUI tests for the clippy lints page which had a number of regressions recently. I'll add (way) more if this is something the clippy team is interested into.
Now let me explain a bit why I picked this framework:
browser-ui-test
is meant to make it easy to write and read web GUI tests for people who are not familiar with web development (which is the case for most clippy contributors I suppose). It works by checking states of the various elements in the HTML page.It also supports screenshots, however this feature is disabled by default because fonts have very small differences in differences in rendering, making screenshot comparisons mostly pointless unless they are all performed on only one computer, which in turn would limit contributors to add or update GUI tests. Even when not rendering fonts, the layout had some small subtle differences which again prevented the screenshots comparison to work.
This is the approach we decided to take for rustdoc and docs.rs and for now it seems to work nicely for both projects.
Don't hesitate if you have more questions.
changelog: Add GUI tests for clippy lints page
r? @flip1995