|
1 | 1 | goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
|
2 | 2 |
|
3 |
| -// Clicking "More examples..." will open additional examples |
4 |
| -assert-attribute-false: (".more-examples-toggle", {"open": ""}) |
5 |
| -click: ".more-examples-toggle" |
6 |
| -assert-attribute: (".more-examples-toggle", {"open": ""}) |
| 3 | +// Checking the color of the toggle line. |
| 4 | +show-text: true |
| 5 | +define-function: ( |
| 6 | + "check-color", |
| 7 | + (theme, toggle_line_color, toggle_line_hover_color), |
| 8 | + [ |
| 9 | + ("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}), |
| 10 | + ("reload"), |
| 11 | + |
| 12 | + // Clicking "More examples..." will open additional examples |
| 13 | + ("assert-attribute-false", (".more-examples-toggle", {"open": ""})), |
| 14 | + ("click", ".more-examples-toggle"), |
| 15 | + ("assert-attribute", (".more-examples-toggle", {"open": ""})), |
| 16 | + |
| 17 | + ("assert-css", (".toggle-line-inner", {"background-color": |toggle_line_color|}, ALL)), |
| 18 | + ("move-cursor-to", ".toggle-line"), |
| 19 | + ("assert-css", ( |
| 20 | + ".toggle-line:hover .toggle-line-inner", |
| 21 | + {"background-color": |toggle_line_hover_color|}, |
| 22 | + )), |
| 23 | + // Moving cursor away from the toggle line to prevent disrupting next test. |
| 24 | + ("move-cursor-to", ".search-input"), |
| 25 | + ], |
| 26 | +) |
| 27 | + |
| 28 | +call-function: ("check-color", { |
| 29 | + "theme": "ayu", |
| 30 | + "toggle_line_color": "rgb(153, 153, 153)", |
| 31 | + "toggle_line_hover_color": "rgb(197, 197, 197)", |
| 32 | +}) |
| 33 | +call-function: ("check-color", { |
| 34 | + "theme": "dark", |
| 35 | + "toggle_line_color": "rgb(153, 153, 153)", |
| 36 | + "toggle_line_hover_color": "rgb(197, 197, 197)", |
| 37 | +}) |
| 38 | +call-function: ("check-color", { |
| 39 | + "theme": "light", |
| 40 | + "toggle_line_color": "rgb(204, 204, 204)", |
| 41 | + "toggle_line_hover_color": "rgb(153, 153, 153)", |
| 42 | +}) |
7 | 43 |
|
8 | 44 | // Toggling all docs will close additional examples
|
9 | 45 | click: "#toggle-all-docs"
|
|
0 commit comments