-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Clean up anchors.goml rustdoc GUI test #103115
Merged
bors
merged 2 commits into
rust-lang:master
from
GuillaumeGomez:clean-up-anchors-gui-test
Oct 16, 2022
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.12.4 | ||
0.12.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,154 +1,107 @@ | ||
// This test is to ensure that the anchors (`§`) have the expected color and position. | ||
goto: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html" | ||
|
||
// This is needed to ensure that the text color is computed. | ||
show-text: true | ||
|
||
// Set the theme to light. | ||
local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"} | ||
// We reload the page so the local storage settings are being used. | ||
reload: | ||
|
||
assert-css: ("#toggle-all-docs", {"color": "rgb(0, 0, 0)"}) | ||
assert-css: (".fqn a:nth-of-type(1)", {"color": "rgb(0, 0, 0)"}) | ||
assert-css: (".fqn a:nth-of-type(2)", {"color": "rgb(173, 55, 138)"}) | ||
assert-css: ( | ||
".rightside .srclink", | ||
{"color": "rgb(56, 115, 173)", "text-decoration": "none solid rgb(56, 115, 173)"}, | ||
ALL, | ||
) | ||
compare-elements-css: (".rightside .srclink", ".rightside.srclink", ["color", "text-decoration"]) | ||
compare-elements-css: (".main-heading .srclink", ".rightside.srclink", ["color", "text-decoration"]) | ||
|
||
move-cursor-to: ".main-heading .srclink" | ||
assert-css: ( | ||
".main-heading .srclink", | ||
{"color": "rgb(56, 115, 173)", "text-decoration": "underline solid rgb(56, 115, 173)"}, | ||
) | ||
move-cursor-to: ".impl-items .rightside .srclink" | ||
assert-css: ( | ||
".impl-items .rightside .srclink", | ||
{"color": "rgb(56, 115, 173)", "text-decoration": "none solid rgb(56, 115, 173)"}, | ||
) | ||
move-cursor-to: ".impl-items .rightside.srclink" | ||
assert-css: ( | ||
".impl-items .rightside.srclink", | ||
{"color": "rgb(56, 115, 173)", "text-decoration": "none solid rgb(56, 115, 173)"}, | ||
) | ||
|
||
goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html" | ||
|
||
assert-css: ("#top-doc-prose-title", {"color": "rgb(0, 0, 0)"}) | ||
|
||
assert-css: (".sidebar a", {"color": "rgb(53, 109, 164)"}) | ||
assert-css: ("h1.fqn a", {"color": "rgb(0, 0, 0)"}) | ||
|
||
// We move the cursor over the "Implementations" title so the anchor is displayed. | ||
move-cursor-to: "h2#implementations" | ||
assert-css: ("h2#implementations a.anchor", {"color": "rgb(0, 0, 0)"}) | ||
|
||
// Same thing with the impl block title. | ||
move-cursor-to: "#impl-HeavilyDocumentedStruct" | ||
assert-css: ("#impl-HeavilyDocumentedStruct a.anchor", {"color": "rgb(0, 0, 0)"}) | ||
|
||
assert-css: ("#title-for-struct-impl-item-doc", {"margin-left": "0px"}) | ||
|
||
// | ||
// We do the same checks with the dark theme now. | ||
// | ||
local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"} | ||
goto: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html" | ||
|
||
assert-css: ("#toggle-all-docs", {"color": "rgb(221, 221, 221)"}) | ||
assert-css: (".fqn a:nth-of-type(1)", {"color": "rgb(221, 221, 221)"}) | ||
assert-css: (".fqn a:nth-of-type(2)", {"color": "rgb(45, 191, 184)"}) | ||
assert-css: ( | ||
".rightside .srclink", | ||
{"color": "rgb(210, 153, 29)", "text-decoration": "none solid rgb(210, 153, 29)"}, | ||
ALL, | ||
) | ||
compare-elements-css: (".rightside .srclink", ".rightside.srclink", ["color", "text-decoration"]) | ||
compare-elements-css: (".main-heading .srclink", ".rightside.srclink", ["color", "text-decoration"]) | ||
|
||
move-cursor-to: ".main-heading .srclink" | ||
assert-css: ( | ||
".main-heading .srclink", | ||
{"color": "rgb(210, 153, 29)", "text-decoration": "underline solid rgb(210, 153, 29)"}, | ||
define-function: ( | ||
"check-colors", | ||
(theme, main_color, title_color, fqn_color, fqn_type_color, src_link_color, sidebar_link_color), | ||
[ | ||
("goto", "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html"), | ||
// This is needed to ensure that the text color is computed. | ||
("show-text", true), | ||
|
||
// Setting the theme. | ||
("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}), | ||
// We reload the page so the local storage settings are being used. | ||
("reload"), | ||
|
||
("assert-css", ("#toggle-all-docs", {"color": |main_color|})), | ||
("assert-css", (".fqn a:nth-of-type(1)", {"color": |fqn_color|})), | ||
("assert-css", (".fqn a:nth-of-type(2)", {"color": |fqn_type_color|})), | ||
("assert-css", ( | ||
".rightside .srclink", | ||
{"color": |src_link_color|, "text-decoration": "none solid " + |src_link_color|}, | ||
ALL, | ||
)), | ||
( | ||
"compare-elements-css", | ||
(".rightside .srclink", ".rightside.srclink", ["color", "text-decoration"]), | ||
), | ||
( | ||
"compare-elements-css", | ||
(".main-heading .srclink", ".rightside.srclink", ["color", "text-decoration"]), | ||
), | ||
|
||
("move-cursor-to", ".main-heading .srclink"), | ||
("assert-css", ( | ||
".main-heading .srclink", | ||
{"color": |src_link_color|, "text-decoration": "underline solid " + |src_link_color|}, | ||
)), | ||
("move-cursor-to", ".impl-items .rightside .srclink"), | ||
("assert-css", ( | ||
".impl-items .rightside .srclink", | ||
{"color": |src_link_color|, "text-decoration": "none solid " + |src_link_color|}, | ||
)), | ||
("move-cursor-to", ".impl-items .rightside.srclink"), | ||
("assert-css", ( | ||
".impl-items .rightside.srclink", | ||
{"color": |src_link_color|, "text-decoration": "none solid " + |src_link_color|}, | ||
)), | ||
|
||
("goto", "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"), | ||
// Since we changed page, we need to set the theme again. | ||
("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}), | ||
// We reload the page so the local storage settings are being used. | ||
("reload"), | ||
|
||
("assert-css", ("#top-doc-prose-title", {"color": |title_color|})), | ||
|
||
("assert-css", (".sidebar a", {"color": |sidebar_link_color|})), | ||
("assert-css", ("h1.fqn a", {"color": |title_color|})), | ||
|
||
// We move the cursor over the "Implementations" title so the anchor is displayed. | ||
("move-cursor-to", "h2#implementations"), | ||
("assert-css", ("h2#implementations a.anchor", {"color": |main_color|})), | ||
|
||
// Same thing with the impl block title. | ||
("move-cursor-to", "#impl-HeavilyDocumentedStruct"), | ||
("assert-css", ("#impl-HeavilyDocumentedStruct a.anchor", {"color": |main_color|})), | ||
|
||
("assert-css", ("#title-for-struct-impl-item-doc", {"margin-left": "0px"})), | ||
], | ||
) | ||
move-cursor-to: ".impl-items .rightside .srclink" | ||
assert-css: ( | ||
".impl-items .rightside .srclink", | ||
{"color": "rgb(210, 153, 29)", "text-decoration": "none solid rgb(210, 153, 29)"}, | ||
) | ||
move-cursor-to: ".impl-items .rightside.srclink" | ||
assert-css: ( | ||
".impl-items .rightside.srclink", | ||
{"color": "rgb(210, 153, 29)", "text-decoration": "none solid rgb(210, 153, 29)"}, | ||
) | ||
|
||
goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html" | ||
|
||
assert-css: ("#top-doc-prose-title", {"color": "rgb(221, 221, 221)"}) | ||
|
||
assert-css: (".sidebar a", {"color": "rgb(253, 191, 53)"}) | ||
assert-css: ("h1.fqn a", {"color": "rgb(221, 221, 221)"}) | ||
|
||
// We move the cursor over the "Implementations" title so the anchor is displayed. | ||
move-cursor-to: "h2#implementations" | ||
assert-css: ("h2#implementations a.anchor", {"color": "rgb(221, 221, 221)"}) | ||
|
||
// Same thing with the impl block title. | ||
move-cursor-to: "#impl-HeavilyDocumentedStruct" | ||
assert-css: ("#impl-HeavilyDocumentedStruct a.anchor", {"color": "rgb(221, 221, 221)"}) | ||
|
||
assert-css: ("#title-for-struct-impl-item-doc", {"margin-left": "0px"}) | ||
|
||
// | ||
// We do the same checks with the ayu theme now. | ||
// | ||
local-storage: {"rustdoc-theme": "ayu", "rustdoc-use-system-theme": "false"} | ||
goto: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html" | ||
|
||
assert-css: ("#toggle-all-docs", {"color": "rgb(197, 197, 197)"}) | ||
assert-css: (".fqn a:nth-of-type(1)", {"color": "rgb(255, 255, 255)"}) | ||
assert-css: (".fqn a:nth-of-type(2)", {"color": "rgb(255, 160, 165)"}) | ||
assert-css: ( | ||
".rightside .srclink", | ||
{"color": "rgb(57, 175, 215)", "text-decoration": "none solid rgb(57, 175, 215)"}, | ||
ALL, | ||
call-function: ( | ||
"check-colors", | ||
( | ||
"ayu", // theme | ||
"rgb(197, 197, 197)", // main color | ||
"rgb(255, 255, 255)", // title color | ||
"rgb(255, 255, 255)", // fqn color | ||
"rgb(255, 160, 165)", // fqn type color | ||
"rgb(57, 175, 215)", // src link | ||
"rgb(83, 177, 219)", // sidebar link | ||
), | ||
) | ||
compare-elements-css: (".rightside .srclink", ".rightside.srclink", ["color", "text-decoration"]) | ||
compare-elements-css: (".main-heading .srclink", ".rightside.srclink", ["color", "text-decoration"]) | ||
|
||
move-cursor-to: ".main-heading .srclink" | ||
assert-css: ( | ||
".main-heading .srclink", | ||
{"color": "rgb(57, 175, 215)", "text-decoration": "underline solid rgb(57, 175, 215)"}, | ||
) | ||
move-cursor-to: ".impl-items .rightside .srclink" | ||
assert-css: ( | ||
".impl-items .rightside .srclink", | ||
{"color": "rgb(57, 175, 215)", "text-decoration": "none solid rgb(57, 175, 215)"}, | ||
call-function: ( | ||
"check-colors", | ||
( | ||
"dark", // theme | ||
"rgb(221, 221, 221)", // main color | ||
"rgb(221, 221, 221)", // title color | ||
"rgb(221, 221, 221)", // fqn color | ||
"rgb(45, 191, 184)", // fqn type color | ||
"rgb(210, 153, 29)", // src link | ||
"rgb(253, 191, 53)", // sidebar link | ||
), | ||
) | ||
move-cursor-to: ".impl-items .rightside.srclink" | ||
assert-css: ( | ||
".impl-items .rightside.srclink", | ||
{"color": "rgb(57, 175, 215)", "text-decoration": "none solid rgb(57, 175, 215)"}, | ||
call-function: ( | ||
"check-colors", | ||
( | ||
"light", // theme | ||
"rgb(0, 0, 0)", // main color | ||
"rgb(0, 0, 0)", // title color | ||
"rgb(0, 0, 0)", // fqn color | ||
"rgb(173, 55, 138)", // fqn type color | ||
"rgb(56, 115, 173)", // src link | ||
"rgb(53, 109, 164)", // sidebar link | ||
), | ||
) | ||
|
||
goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html" | ||
|
||
assert-css: ("#top-doc-prose-title", {"color": "rgb(255, 255, 255)"}) | ||
|
||
assert-css: (".sidebar a", {"color": "rgb(83, 177, 219)"}) | ||
assert-css: ("h1.fqn a", {"color": "rgb(255, 255, 255)"}) | ||
|
||
// We move the cursor over the "Implementations" title so the anchor is displayed. | ||
move-cursor-to: "h2#implementations" | ||
assert-css: ("h2#implementations a.anchor", {"color": "rgb(197, 197, 197)"}) | ||
|
||
// Same thing with the impl block title. | ||
move-cursor-to: "#impl-HeavilyDocumentedStruct" | ||
assert-css: ("#impl-HeavilyDocumentedStruct a.anchor", {"color": "rgb(197, 197, 197)"}) | ||
|
||
assert-css: ("#title-for-struct-impl-item-doc", {"margin-left": "0px"}) |
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.
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.
Is there anything stopping browser-ui-test from having real named parameters? Comments like these are error-prone.
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.
No, just an implementation detail.