Skip to content

Commit 9543636

Browse files
committed
Auto merge of #86468 - GuillaumeGomez:update-browser-ui-test-version, r=jsha
Update browser-ui-test version It greatly improves the test readability (thanks to `@jsha` for the suggestions!). r? `@jsha`
2 parents 192920c + 1e222ba commit 9543636

21 files changed

+101
-101
lines changed

src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ ENV PATH="/node-v14.4.0-linux-x64/bin:${PATH}"
7171
# https://github.com/puppeteer/puppeteer/issues/375
7272
#
7373
# We also specify the version in case we need to update it to go around cache limitations.
74-
RUN npm install -g browser-ui-test@0.2.14 --unsafe-perm=true
74+
RUN npm install -g browser-ui-test@0.3.0 --unsafe-perm=true
7575

7676
ENV RUST_CONFIGURE_ARGS \
7777
--build=x86_64-unknown-linux-gnu \

src/test/rustdoc-gui/basic-code.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
goto: file://|DOC_PATH|/test_docs/index.html
22
click: ".srclink"
3-
assert: (".line-numbers", 1)
3+
assert-count: (".line-numbers", 1)

src/test/rustdoc-gui/check_info_sign_position.goml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ goto: file://|DOC_PATH|/test_docs/index.html
22
goto: ./fn.check_list_code_block.html
33
// If the codeblock is the first element of the docblock, the information tooltip must have
44
// have some top margin to avoid going over the toggle (the "[+]").
5-
assert: (".docblock > .information > .compile_fail", { "margin-top": "16px" })
5+
assert-css: (".docblock > .information > .compile_fail", { "margin-top": "16px" })
66
// Checks that the other codeblocks don't have this top margin.
7-
assert: ("ol > li > .information > .compile_fail", { "margin-top": "0px" })
8-
assert: ("ol > li > .information > .ignore", { "margin-top": "0px" })
9-
assert: (".docblock > .information > .ignore", { "margin-top": "0px" })
7+
assert-css: ("ol > li > .information > .compile_fail", { "margin-top": "0px" })
8+
assert-css: ("ol > li > .information > .ignore", { "margin-top": "0px" })
9+
assert-css: (".docblock > .information > .ignore", { "margin-top": "0px" })

src/test/rustdoc-gui/code-sidebar-toggle.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ click: ".srclink"
33
click: "#sidebar-toggle"
44
wait-for: 500
55
fail: true
6-
assert: ("#source-sidebar", { "left": "-300px" })
6+
assert-css: ("#source-sidebar", { "left": "-300px" })

src/test/rustdoc-gui/escape-key.goml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@ goto: file://|DOC_PATH|/test_docs/index.html
22
// First, we check that the search results are hidden when the Escape key is pressed.
33
write: (".search-input", "test")
44
wait-for: "#search > h1" // The search element is empty before the first search
5-
assert: ("#search", "class", "content")
6-
assert: ("#main", "class", "content hidden")
5+
assert-attr: ("#search", {"class": "content"})
6+
assert-attr: ("#main", {"class": "content hidden"})
77
press-key: "Escape"
8-
assert: ("#search", "class", "content hidden")
9-
assert: ("#main", "class", "content")
8+
assert-attr: ("#search", {"class": "content hidden"})
9+
assert-attr: ("#main", {"class": "content"})
1010

1111
// Check that focusing the search input brings back the search results
1212
focus: ".search-input"
13-
assert: ("#search", "class", "content")
14-
assert: ("#main", "class", "content hidden")
13+
assert-attr: ("#search", {"class": "content"})
14+
assert-attr: ("#main", {"class": "content hidden"})
1515

1616
// Now let's check that when the help popup is displayed and we press Escape, it doesn't
1717
// hide the search results too.
1818
click: "#help-button"
19-
assert: ("#help", "class", "")
19+
assert-attr: ("#help", {"class": ""})
2020
press-key: "Escape"
21-
assert: ("#help", "class", "hidden")
22-
assert: ("#search", "class", "content")
23-
assert: ("#main", "class", "content hidden")
21+
assert-attr: ("#help", {"class": "hidden"})
22+
assert-attr: ("#search", {"class": "content"})
23+
assert-attr: ("#main", {"class": "content hidden"})
2424

2525
// Check that Escape hides the search results when a search result is focused.
2626
focus: ".search-input"
@@ -29,6 +29,6 @@ press-key: "ArrowDown"
2929
assert-false: ".search-input:focus"
3030
assert: "#results a:focus"
3131
press-key: "Escape"
32-
assert: ("#help", "class", "hidden")
33-
assert: ("#search", "class", "content hidden")
34-
assert: ("#main", "class", "content")
32+
assert-attr: ("#help", {"class": "hidden"})
33+
assert-attr: ("#search", {"class": "content hidden"})
34+
assert-attr: ("#main", {"class": "content"})

src/test/rustdoc-gui/font-weight.goml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
goto: file://|DOC_PATH|/lib2/struct.Foo.html
22
// This test checks that the font weight is correctly applied.
3-
assert: ("//*[@class='docblock type-decl']//a[text()='Alias']", {"font-weight": "400"})
4-
assert: ("//*[@class='structfield small-section-header']//a[text()='Alias']", {"font-weight": "400"})
5-
assert: ("#method\.a_method > code", {"font-weight": "600"})
6-
assert: ("#associatedtype\.X > code", {"font-weight": "600"})
7-
assert: ("#associatedconstant\.Y > code", {"font-weight": "600"})
3+
assert-css: ("//*[@class='docblock type-decl']//a[text()='Alias']", {"font-weight": "400"})
4+
assert-css: ("//*[@class='structfield small-section-header']//a[text()='Alias']", {"font-weight": "400"})
5+
assert-css: ("#method\.a_method > code", {"font-weight": "600"})
6+
assert-css: ("#associatedtype\.X > code", {"font-weight": "600"})
7+
assert-css: ("#associatedconstant\.Y > code", {"font-weight": "600"})
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// This test ensures that the element corresponding to the hash is displayed.
22
goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.borrow
33
// In the blanket implementations list, "Borrow" is the second one, hence the ":nth(2)".
4-
assert: ("#blanket-implementations-list > details:nth-child(2)", "open", "")
4+
assert-attr: ("#blanket-implementations-list > details:nth-child(2)", {"open": ""})
55
// We first check that the impl block is open by default.
6-
assert: ("#implementations + details", "open", "")
6+
assert-attr: ("#implementations + details", {"open": ""})
77
// We collapse it.
88
click: "#implementations + details > summary"
99
// We check that it was collapsed as expected.
10-
assert-false: ("#implementations + details", "open", "")
10+
assert-attr-false: ("#implementations + details", {"open": ""})
1111
// To ensure that we will click on the currently hidden method.
12-
assert: (".sidebar-links > a", "must_use")
12+
assert-text: (".sidebar-links > a", "must_use")
1313
click: ".sidebar-links > a"
1414
// We check that the impl block was opened as expected so that we can see the method.
15-
assert: ("#implementations + details", "open", "")
15+
assert-attr: ("#implementations + details", {"open": ""})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// This test ensures that the impl blocks are open by default.
22
goto: file://|DOC_PATH|/test_docs/struct.Foo.html
3-
assert: ("#main > details.implementors-toggle", "open", "")
3+
assert-attr: ("#main > details.implementors-toggle", {"open": ""})

src/test/rustdoc-gui/search-result-colors.goml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ write: (".search-input", "thisisanalias")
1010
// Waiting for the search results to appear...
1111
wait-for: "#titles"
1212
// Checking that the colors for the alias element are the ones expected.
13-
assert: (".result-name > .alias", {"color": "rgb(255, 255, 255)"})
14-
assert: (".result-name > .alias > .grey", {"color": "rgb(204, 204, 204)"})
13+
assert-css: (".result-name > .alias", {"color": "rgb(255, 255, 255)"})
14+
assert-css: (".result-name > .alias > .grey", {"color": "rgb(204, 204, 204)"})

src/test/rustdoc-gui/search-result-description.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
goto: file://|DOC_PATH|/test_docs/index.html?search=some_more_function
33
// Waiting for the search results to appear...
44
wait-for: "#titles"
5-
assert: (".search-results .desc code", "format!")
5+
assert-text: (".search-results .desc code", "format!")

0 commit comments

Comments
 (0)