Skip to content

Commit 16d5cdc

Browse files
Improve source-code-page.goml GUI test code
1 parent f3eae89 commit 16d5cdc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/test/rustdoc-gui/source-code-page.goml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
33
// Check that we can click on the line number.
44
click: ".line-numbers > span:nth-child(4)" // This is the span for line 4.
5-
// Unfortunately, "#4" isn't a valid query selector, so we have to go around that limitation
6-
// by instead getting the nth span.
7-
assert-attribute: (".line-numbers > span:nth-child(4)", {"class": "line-highlighted"})
5+
// Ensure that the page URL was updated.
6+
assert-document-property: ({"URL": "#4"}, ENDS_WITH)
7+
assert-attribute: ("//*[@id='4']", {"class": "line-highlighted"})
88
// We now check that the good spans are highlighted
99
goto: file://|DOC_PATH|/src/test_docs/lib.rs.html#4-6
1010
assert-attribute-false: (".line-numbers > span:nth-child(3)", {"class": "line-highlighted"})

0 commit comments

Comments
 (0)