rust/tests/rustdoc-gui/run-on-hover.goml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.8 KiB
Plaintext
Raw Normal View History

// 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.
2022-11-05 11:22:38 -05:00
// This test checks that it is hidden, and that it shows on hover. It also
// checks for its color.
go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
2022-11-05 11:22:38 -05:00
show-text: true
define-function: (
"check-run-button",
(theme, color, background, hover_color, hover_background),
block {
set-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", {
2022-11-05 11:22:38 -05:00
"visibility": "visible",
"color": |color|,
"background-color": |background|,
"font-size": "22px",
"border-radius": "5px",
})
move-cursor-to: ".test-arrow"
assert-css: (".test-arrow:hover", {
2022-11-05 11:22:38 -05:00
"visibility": "visible",
"color": |hover_color|,
"background-color": |hover_background|,
"font-size": "22px",
"border-radius": "5px",
})
},
2022-11-05 11:22:38 -05:00
)
call-function: ("check-run-button", {
"theme": "ayu",
"color": "#788797",
2022-11-05 11:22:38 -05:00
"background": "rgba(57, 175, 215, 0.09)",
"hover_color": "#c5c5c5",
2022-11-05 11:22:38 -05:00
"hover_background": "rgba(57, 175, 215, 0.37)",
})
call-function: ("check-run-button", {
"theme": "dark",
"color": "#dedede",
2022-11-05 11:22:38 -05:00
"background": "rgba(78, 139, 202, 0.2)",
"hover_color": "#dedede",
2022-11-05 11:22:38 -05:00
"hover_background": "rgb(78, 139, 202)",
})
call-function: ("check-run-button", {
"theme": "light",
"color": "#f5f5f5",
2022-11-05 11:22:38 -05:00
"background": "rgba(78, 139, 202, 0.2)",
"hover_color": "#f5f5f5",
2022-11-05 11:22:38 -05:00
"hover_background": "rgb(78, 139, 202)",
})