-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ffb2869
commit 8e2956d
Showing
1 changed file
with
51 additions
and
4 deletions.
There are no files selected for viewing
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,7 +1,54 @@ | ||
// Example code blocks sometimes have a "Run" button to run them on the | ||
// Playground. That button is hidden until the user hovers over the code block. | ||
// This test checks that it is hidden, and that it shows on hover. | ||
// This test checks that it is hidden, and that it shows on hover. It also | ||
// checks for its color. | ||
goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html" | ||
assert-css: (".test-arrow", {"visibility": "hidden"}) | ||
move-cursor-to: ".example-wrap" | ||
assert-css: (".test-arrow", {"visibility": "visible"}) | ||
show-text: true | ||
|
||
define-function: ( | ||
"check-run-button", | ||
(theme, color, background, hover_color, hover_background), | ||
[ | ||
("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}), | ||
("reload"), | ||
("assert-css", (".test-arrow", {"visibility": "hidden"})), | ||
("move-cursor-to", ".example-wrap"), | ||
("assert-css", (".test-arrow", { | ||
"visibility": "visible", | ||
"color": |color|, | ||
"background-color": |background|, | ||
"font-size": "22px", | ||
"border-radius": "5px", | ||
})), | ||
("move-cursor-to", ".test-arrow"), | ||
("assert-css", (".test-arrow:hover", { | ||
"visibility": "visible", | ||
"color": |hover_color|, | ||
"background-color": |hover_background|, | ||
"font-size": "22px", | ||
"border-radius": "5px", | ||
})), | ||
], | ||
) | ||
|
||
call-function: ("check-run-button", { | ||
"theme": "ayu", | ||
"color": "rgb(120, 135, 151)", | ||
"background": "rgba(57, 175, 215, 0.09)", | ||
"hover_color": "rgb(197, 197, 197)", | ||
"hover_background": "rgba(57, 175, 215, 0.37)", | ||
}) | ||
call-function: ("check-run-button", { | ||
"theme": "dark", | ||
"color": "rgb(222, 222, 222)", | ||
"background": "rgba(78, 139, 202, 0.2)", | ||
"hover_color": "rgb(222, 222, 222)", | ||
"hover_background": "rgb(78, 139, 202)", | ||
}) | ||
call-function: ("check-run-button", { | ||
"theme": "light", | ||
"color": "rgb(245, 245, 245)", | ||
"background": "rgba(78, 139, 202, 0.2)", | ||
"hover_color": "rgb(245, 245, 245)", | ||
"hover_background": "rgb(78, 139, 202)", | ||
}) |