]> git.proxmox.com Git - rustc.git/blame - tests/rustdoc-gui/scrape-examples-toggle.goml
Merge 1.70 into proxmox/bookworm
[rustc.git] / tests / rustdoc-gui / scrape-examples-toggle.goml
CommitLineData
9c376795 1// This tests checks that the "scraped examples" toggle is working as expected.
353b0b11 2go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
9c376795
FG
3
4// Checking the color of the toggle line.
5show-text: true
6define-function: (
7 "check-color",
8 (theme, toggle_line_color, toggle_line_hover_color),
9 block {
353b0b11 10 set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
9c376795
FG
11 reload:
12
13 // Clicking "More examples..." will open additional examples
14 assert-attribute-false: (".more-examples-toggle", {"open": ""})
15 click: ".more-examples-toggle"
16 assert-attribute: (".more-examples-toggle", {"open": ""})
17
18 assert-css: (".toggle-line-inner", {"background-color": |toggle_line_color|}, ALL)
19 move-cursor-to: ".toggle-line"
20 assert-css: (
21 ".toggle-line:hover .toggle-line-inner",
22 {"background-color": |toggle_line_hover_color|},
23 )
24 // Moving cursor away from the toggle line to prevent disrupting next test.
25 move-cursor-to: ".search-input"
26 },
27)
28
29call-function: ("check-color", {
30 "theme": "ayu",
31 "toggle_line_color": "rgb(153, 153, 153)",
32 "toggle_line_hover_color": "rgb(197, 197, 197)",
33})
34call-function: ("check-color", {
35 "theme": "dark",
36 "toggle_line_color": "rgb(153, 153, 153)",
37 "toggle_line_hover_color": "rgb(197, 197, 197)",
38})
39call-function: ("check-color", {
40 "theme": "light",
41 "toggle_line_color": "rgb(204, 204, 204)",
42 "toggle_line_hover_color": "rgb(153, 153, 153)",
43})
44
45// Toggling all docs will close additional examples
46click: "#toggle-all-docs"
47assert-attribute-false: (".more-examples-toggle", {"open": ""})
48
49// After re-opening the docs, the additional examples should stay closed
50click: "#toggle-all-docs"
51assert-attribute-false: (".more-examples-toggle", {"open": ""})