Skip to content

Commit db34320

Browse files
Add test for source sidebar elements display
1 parent ada7efa commit db34320

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// This test ensures that the elements in the sidebar are displayed correctly.
2+
javascript: false
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: 500
9+
assert-css: (".sidebar > *", {"visibility": "hidden", "opacity": 0})
10+
11+
// Let's retry with javascript enabled.
12+
javascript: true
13+
reload:
14+
wait-for: "#sidebar-toggle"
15+
assert-css: ("#sidebar-toggle", {"visibility": "visible", "opacity": 1})
16+
assert-css: (".sidebar > *:not(#sidebar-toggle)", {"visibility": "hidden", "opacity": 0})
17+
// Let's expand the sidebar now.
18+
click: "#sidebar-toggle"
19+
// Because of the transition CSS, better wait a second before checking.
20+
wait-for: 1000
21+
assert-css: ("#sidebar-toggle", {"visibility": "visible", "opacity": 1})
22+
assert-css: (".sidebar > *:not(#sidebar-toggle)", {"visibility": "visible", "opacity": 1})

0 commit comments

Comments
 (0)