Improve source-code-page.goml GUI test code

This commit is contained in:
Guillaume Gomez 2022-05-30 17:07:21 +02:00
parent f3eae89b33
commit 16d5cdc570

View File

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