1 // This tests checks that the "scraped examples" toggle is working as expected.
2 goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
4 // Checking the color of the toggle line.
8 (theme, toggle_line_color, toggle_line_hover_color),
10 local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
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": ""})
18 assert-css: (".toggle-line-inner", {"background-color": |toggle_line_color|}, ALL)
19 move-cursor-to: ".toggle-line"
21 ".toggle-line:hover .toggle-line-inner",
22 {"background-color": |toggle_line_hover_color|},
24 // Moving cursor away from the toggle line to prevent disrupting next test.
25 move-cursor-to: ".search-input"
29 call-function: ("check-color", {
31 "toggle_line_color": "rgb(153, 153, 153)",
32 "toggle_line_hover_color": "rgb(197, 197, 197)",
34 call-function: ("check-color", {
36 "toggle_line_color": "rgb(153, 153, 153)",
37 "toggle_line_hover_color": "rgb(197, 197, 197)",
39 call-function: ("check-color", {
41 "toggle_line_color": "rgb(204, 204, 204)",
42 "toggle_line_hover_color": "rgb(153, 153, 153)",
45 // Toggling all docs will close additional examples
46 click: "#toggle-all-docs"
47 assert-attribute-false: (".more-examples-toggle", {"open": ""})
49 // After re-opening the docs, the additional examples should stay closed
50 click: "#toggle-all-docs"
51 assert-attribute-false: (".more-examples-toggle", {"open": ""})