|
1 |
| -// Checks that the interactions with the source code pages are workined as expected. |
| 1 | +// Checks that the interactions with the source code pages are working as expected. |
2 | 2 | goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
|
3 | 3 | // Check that we can click on the line number.
|
4 | 4 | click: ".line-numbers > span:nth-child(4)" // This is the span for line 4.
|
@@ -27,3 +27,26 @@ assert-position: ("//*[@id='1']", {"x": 104, "y": 103})
|
27 | 27 | // We click on the left of the "1" span but still in the "line-number" `<pre>`.
|
28 | 28 | click: (103, 103)
|
29 | 29 | assert-document-property: ({"URL": "/lib.rs.html"}, ENDS_WITH)
|
| 30 | + |
| 31 | +// Checking the source code sidebar. |
| 32 | + |
| 33 | +// First we "open" it. |
| 34 | +click: "#sidebar-toggle" |
| 35 | +assert: ".sidebar.expanded" |
| 36 | + |
| 37 | +// We check that the first entry of the sidebar is collapsed (which, for whatever reason, |
| 38 | +// is number 2 and not 1...). |
| 39 | +assert-attribute: ("#source-sidebar .name:nth-child(2)", {"class": "name"}) |
| 40 | +assert-text: ("#source-sidebar .name:nth-child(2)", "implementors") |
| 41 | +// We also check its children are hidden too. |
| 42 | +assert-css: ("#source-sidebar .name:nth-child(2) + .children", {"display": "none"}) |
| 43 | +// We now click on it. |
| 44 | +click: "#source-sidebar .name:nth-child(2)" |
| 45 | +assert-attribute: ("#source-sidebar .name:nth-child(2)", {"class": "name expand"}) |
| 46 | +// Checking that its children are displayed as well. |
| 47 | +assert-css: ("#source-sidebar .name:nth-child(2) + .children", {"display": "block"}) |
| 48 | + |
| 49 | +// And now we collapse it again. |
| 50 | +click: "#source-sidebar .name:nth-child(2)" |
| 51 | +assert-attribute: ("#source-sidebar .name:nth-child(2)", {"class": "name"}) |
| 52 | +assert-css: ("#source-sidebar .name:nth-child(2) + .children", {"display": "none"}) |
0 commit comments