Rollup merge of #112613 - GuillaumeGomez:fix-gui-test-windows, r=notriddle

Fix rustdoc-gui tests on Windows

The browser-ui-test update contains fixes needed for backslash handling (they were not correctly escaped).

Since we have a mix of slash and backslash in some tests, I replaced `DOC_FOLDER` variable backslashes with slashes.

And finally it seemed like the unicode escaped wasn't much appreciated on Windows for some reason so I used the character directly.

cc `@klensy`
r? `@notriddle`
This commit is contained in:
Matthias Krüger 2023-06-14 18:10:32 +02:00 committed by GitHub
commit 77b307ff20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 18 deletions

View File

@ -201,8 +201,8 @@ async function main(argv) {
try { try {
// This is more convenient that setting fields one by one. // This is more convenient that setting fields one by one.
const args = [ const args = [
"--variable", "DOC_PATH", opts["doc_folder"], "--enable-fail-on-js-error", "--variable", "DOC_PATH", opts["doc_folder"].split("\\").join("/"),
"--allow-file-access-from-files", "--enable-fail-on-js-error", "--allow-file-access-from-files",
]; ];
if (opts["debug"]) { if (opts["debug"]) {
debug = true; debug = true;

View File

@ -13,7 +13,7 @@ press-key: "Escape"
assert-css: ("#help-button .popover", {"display": "none"}) assert-css: ("#help-button .popover", {"display": "none"})
// Checking doc collapse and expand. // Checking doc collapse and expand.
// It should be displaying a "-": // It should be displaying a "-":
assert-text: ("#toggle-all-docs", "[\u2212]") assert-text: ("#toggle-all-docs", "[]")
press-key: "-" press-key: "-"
wait-for-text: ("#toggle-all-docs", "[+]") wait-for-text: ("#toggle-all-docs", "[+]")
assert-attribute: ("#toggle-all-docs", {"class": "will-expand"}) assert-attribute: ("#toggle-all-docs", {"class": "will-expand"})
@ -23,9 +23,9 @@ assert-text: ("#toggle-all-docs", "[+]")
assert-attribute: ("#toggle-all-docs", {"class": "will-expand"}) assert-attribute: ("#toggle-all-docs", {"class": "will-expand"})
// Expanding now. // Expanding now.
press-key: "+" press-key: "+"
wait-for-text: ("#toggle-all-docs", "[\u2212]") wait-for-text: ("#toggle-all-docs", "[]")
assert-attribute: ("#toggle-all-docs", {"class": ""}) assert-attribute: ("#toggle-all-docs", {"class": ""})
// Pressing it again shouldn't do anything. // Pressing it again shouldn't do anything.
press-key: "+" press-key: "+"
assert-text: ("#toggle-all-docs", "[\u2212]") assert-text: ("#toggle-all-docs", "[]")
assert-attribute: ("#toggle-all-docs", {"class": ""}) assert-attribute: ("#toggle-all-docs", {"class": ""})

View File

@ -64,23 +64,23 @@ call-function: ("check-colors", {
compare-elements-position: ("//*[@id='1']", ".rust > code > span", ("y")) compare-elements-position: ("//*[@id='1']", ".rust > code > span", ("y"))
// Check the `href` property so that users can treat anchors as links. // Check the `href` property so that users can treat anchors as links.
assert-property: (".src-line-numbers > a:nth-child(1)", { assert-property: (".src-line-numbers > a:nth-child(1)", {
"href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#1" "href": |DOC_PATH| + "/src/test_docs/lib.rs.html#1"
}) }, ENDS_WITH)
assert-property: (".src-line-numbers > a:nth-child(2)", { assert-property: (".src-line-numbers > a:nth-child(2)", {
"href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#2" "href": |DOC_PATH| + "/src/test_docs/lib.rs.html#2"
}) }, ENDS_WITH)
assert-property: (".src-line-numbers > a:nth-child(3)", { assert-property: (".src-line-numbers > a:nth-child(3)", {
"href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#3" "href": |DOC_PATH| + "/src/test_docs/lib.rs.html#3"
}) }, ENDS_WITH)
assert-property: (".src-line-numbers > a:nth-child(4)", { assert-property: (".src-line-numbers > a:nth-child(4)", {
"href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#4" "href": |DOC_PATH| + "/src/test_docs/lib.rs.html#4"
}) }, ENDS_WITH)
assert-property: (".src-line-numbers > a:nth-child(5)", { assert-property: (".src-line-numbers > a:nth-child(5)", {
"href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#5" "href": |DOC_PATH| + "/src/test_docs/lib.rs.html#5"
}) }, ENDS_WITH)
assert-property: (".src-line-numbers > a:nth-child(6)", { assert-property: (".src-line-numbers > a:nth-child(6)", {
"href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#6" "href": |DOC_PATH| + "/src/test_docs/lib.rs.html#6"
}) }, ENDS_WITH)
// Assert that the line numbers text is aligned to the right. // Assert that the line numbers text is aligned to the right.
assert-css: (".src-line-numbers", {"text-align": "right"}) assert-css: (".src-line-numbers", {"text-align": "right"})