|
1 | 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 |
| -click: ".line-numbers > span:nth-child(4)" // This is the span for line 4. |
| 4 | +click: ".src-line-numbers > span:nth-child(4)" // This is the span for line 4. |
5 | 5 | // Ensure that the page URL was updated.
|
6 | 6 | assert-document-property: ({"URL": "lib.rs.html#4"}, ENDS_WITH)
|
7 | 7 | assert-attribute: ("//*[@id='4']", {"class": "line-highlighted"})
|
8 | 8 | // We now check that the good spans are highlighted
|
9 | 9 | goto: file://|DOC_PATH|/src/test_docs/lib.rs.html#4-6
|
10 |
| -assert-attribute-false: (".line-numbers > span:nth-child(3)", {"class": "line-highlighted"}) |
11 |
| -assert-attribute: (".line-numbers > span:nth-child(4)", {"class": "line-highlighted"}) |
12 |
| -assert-attribute: (".line-numbers > span:nth-child(5)", {"class": "line-highlighted"}) |
13 |
| -assert-attribute: (".line-numbers > span:nth-child(6)", {"class": "line-highlighted"}) |
14 |
| -assert-attribute-false: (".line-numbers > span:nth-child(7)", {"class": "line-highlighted"}) |
| 10 | +assert-attribute-false: (".src-line-numbers > span:nth-child(3)", {"class": "line-highlighted"}) |
| 11 | +assert-attribute: (".src-line-numbers > span:nth-child(4)", {"class": "line-highlighted"}) |
| 12 | +assert-attribute: (".src-line-numbers > span:nth-child(5)", {"class": "line-highlighted"}) |
| 13 | +assert-attribute: (".src-line-numbers > span:nth-child(6)", {"class": "line-highlighted"}) |
| 14 | +assert-attribute-false: (".src-line-numbers > span:nth-child(7)", {"class": "line-highlighted"}) |
15 | 15 | // This is to ensure that the content is correctly align with the line numbers.
|
16 | 16 | compare-elements-position: ("//*[@id='1']", ".rust > code > span", ("y"))
|
17 | 17 |
|
18 | 18 | // Assert that the line numbers text is aligned to the right.
|
19 |
| -assert-css: (".line-numbers", {"text-align": "right"}) |
| 19 | +assert-css: (".src-line-numbers", {"text-align": "right"}) |
20 | 20 |
|
21 | 21 | // Now let's check that clicking on something else than the line number doesn't
|
22 | 22 | // do anything (and certainly not add a `#NaN` to the URL!).
|
23 | 23 | show-text: true
|
24 | 24 | goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
|
25 | 25 | // We use this assert-position to know where we will click.
|
26 | 26 | assert-position: ("//*[@id='1']", {"x": 104, "y": 103})
|
27 |
| -// We click on the left of the "1" span but still in the "line-number" `<pre>`. |
| 27 | +// We click on the left of the "1" span but still in the "src-line-number" `<pre>`. |
28 | 28 | click: (103, 103)
|
29 | 29 | assert-document-property: ({"URL": "/lib.rs.html"}, ENDS_WITH)
|
30 | 30 |
|
|
0 commit comments