1 // This test ensures that the elements in the sidebar are displayed correctly.
3 goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
4 // Since the javascript is disabled, there shouldn't be a toggle.
5 assert-false: "#sidebar-toggle"
6 // For some reason, we need to wait a bit here because it seems like the transition on opacity
7 // is being applied whereas it can't be reproduced in a browser...
8 wait-for-css: (".sidebar > *", {"visibility": "hidden", "opacity": 0})
10 // Let's retry with javascript enabled.
13 wait-for: "#sidebar-toggle"
14 assert-css: ("#sidebar-toggle", {"visibility": "visible", "opacity": 1})
15 assert-css: (".sidebar > *:not(#sidebar-toggle)", {"visibility": "hidden", "opacity": 0})
16 // Let's expand the sidebar now.
17 click: "#sidebar-toggle"
18 // Because of the transition CSS, we check by using `wait-for-css` instead of `assert-css`.
19 wait-for-css: ("#sidebar-toggle", {"visibility": "visible", "opacity": 1})
21 // Now we check the display of the sidebar items.
24 // First we start with the light theme.
25 local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
27 // Waiting for the sidebar to be displayed...
28 wait-for-css: ("#sidebar-toggle", {"visibility": "visible", "opacity": 1})
30 "#source-sidebar .expand + .children a.selected",
31 {"color": "rgb(0, 0, 0)", "background-color": "rgb(255, 255, 255)"},
35 "#source-sidebar .expand + .children > .files a:not(.selected)",
36 {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
39 move-cursor-to: "#source-sidebar .expand + .children > .files a:not(.selected)"
41 "#source-sidebar .expand + .children > .files a:not(.selected)",
42 {"color": "rgb(0, 0, 0)", "background-color": "rgb(224, 224, 224)"},
46 "#source-sidebar .expand + .children .folders .name",
47 {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
50 move-cursor-to: "#source-sidebar .expand + .children .folders .name"
52 "#source-sidebar .expand + .children .folders .name",
53 {"color": "rgb(0, 0, 0)", "background-color": "rgb(224, 224, 224)"},
56 // Now with the dark theme.
57 local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"}
59 // Waiting for the sidebar to be displayed...
60 wait-for-css: ("#sidebar-toggle", {"visibility": "visible", "opacity": 1})
62 "#source-sidebar .expand + .children a.selected",
63 {"color": "rgb(221, 221, 221)", "background-color": "rgb(51, 51, 51)"},
67 "#source-sidebar .expand + .children > .files a:not(.selected)",
68 {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
71 move-cursor-to: "#source-sidebar .expand + .children > .files a:not(.selected)"
73 "#source-sidebar .expand + .children > .files a:not(.selected)",
74 {"color": "rgb(221, 221, 221)", "background-color": "rgb(68, 68, 68)"},
78 "#source-sidebar .expand + .children .folders .name",
79 {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
82 move-cursor-to: "#source-sidebar .expand + .children .folders .name"
84 "#source-sidebar .expand + .children .folders .name",
85 {"color": "rgb(221, 221, 221)", "background-color": "rgb(68, 68, 68)"},
88 // And finally with the ayu theme.
89 local-storage: {"rustdoc-theme": "ayu", "rustdoc-use-system-theme": "false"}
91 // Waiting for the sidebar to be displayed...
92 wait-for-css: ("#sidebar-toggle", {"visibility": "visible", "opacity": 1})
94 "#source-sidebar .expand + .children a.selected",
95 {"color": "rgb(255, 180, 76)", "background-color": "rgb(20, 25, 31)"},
99 "#source-sidebar .expand + .children > .files a:not(.selected)",
100 {"color": "rgb(197, 197, 197)", "background-color": "rgba(0, 0, 0, 0)"},
103 move-cursor-to: "#source-sidebar .expand + .children > .files a:not(.selected)"
105 "#source-sidebar .expand + .children > .files a:not(.selected)",
106 {"color": "rgb(255, 180, 76)", "background-color": "rgb(20, 25, 31)"},
110 "#source-sidebar .expand + .children .folders .name",
111 {"color": "rgb(197, 197, 197)", "background-color": "rgba(0, 0, 0, 0)"},
114 move-cursor-to: "#source-sidebar .expand + .children .folders .name"
116 "#source-sidebar .expand + .children .folders .name",
117 {"color": "rgb(255, 180, 76)", "background-color": "rgb(20, 25, 31)"},