Skip to content

Commit c3a124e

Browse files
Rollup merge of #123338 - GuillaumeGomez:update-browser-ui-test, r=notriddle
Update to new browser-ui-test version This new version brings a lot of new internal improvements (mostly around validating the commands input). It also improved some command names and arguments. r? `@notriddle`
2 parents 3aab05e + 0bb1ec7 commit c3a124e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+267
-249
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.16.11
1+
0.17.0

tests/rustdoc-gui/anchors.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
define-function: (
44
"check-colors",
5-
(theme, main_color, title_color, main_heading_color, main_heading_type_color, src_link_color, sidebar_link_color),
5+
[theme, main_color, title_color, main_heading_color, main_heading_type_color, src_link_color, sidebar_link_color],
66
block {
77
go-to: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html"
88
// This is needed to ensure that the text color is computed.

tests/rustdoc-gui/code-color.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ show-text: true
88

99
define-function: (
1010
"check-colors",
11-
(theme, doc_code_color, doc_inline_code_color),
11+
[theme, doc_code_color, doc_inline_code_color],
1212
block {
1313
// Set the theme.
1414
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}

tests/rustdoc-gui/codeblock-tooltip.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ show-text: true
44

55
define-function: (
66
"check-colors",
7-
(theme, background, color, border),
7+
[theme, background, color, border],
88
block {
99
// Setting the theme.
1010
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}

tests/rustdoc-gui/cursor.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ assert-css: ("#toggle-all-docs", {"cursor": "pointer"})
88
assert-css: ("#copy-path", {"cursor": "pointer"})
99

1010
// the search tabs
11-
write: (".search-input", "Foo")
11+
write-into: (".search-input", "Foo")
1212
// To be SURE that the search will be run.
1313
press-key: 'Enter'
1414
// Waiting for the search results to appear...

tests/rustdoc-gui/docblock-code-block-line-number.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ assert-false: "pre.example-line-numbers"
1010
// Let's now check some CSS properties...
1111
define-function: (
1212
"check-colors",
13-
(theme, color),
13+
[theme, color],
1414
block {
1515
// We now set the setting to show the line numbers on code examples.
1616
set-local-storage: {

tests/rustdoc-gui/docblock-table.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ compare-elements-css: (".impl-items .docblock table td", ".top-doc .docblock tab
66

77
define-function: (
88
"check-colors",
9-
(theme, border_color, zebra_stripe_color),
9+
[theme, border_color, zebra_stripe_color],
1010
block {
1111
set-local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": |theme|}
1212
reload:

tests/rustdoc-gui/escape-key.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// current content displayed.
33
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
44
// First, we check that the search results are hidden when the Escape key is pressed.
5-
write: (".search-input", "test")
5+
write-into: (".search-input", "test")
66
// To be SURE that the search will be run.
77
press-key: 'Enter'
88
wait-for: "#search h1" // The search element is empty before the first search

tests/rustdoc-gui/globals.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ assert-window-property: {"srcIndex": null}
1010

1111
// Form input
1212
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
13-
write: (".search-input", "Foo")
13+
write-into: (".search-input", "Foo")
1414
press-key: 'Enter'
1515
wait-for: "#search-tabs"
1616
assert-window-property-false: {"searchIndex": null}

tests/rustdoc-gui/go-to-collapsed-elem.goml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ set-property: ("#implementations-list .implementors-toggle", {"open": "false"})
99
click: "//*[@class='sidebar']//a[@href='#method.must_use']"
1010
assert-property: ("#implementations-list .implementors-toggle", {"open": "true"})
1111

12-
define-function: ("collapsed-from-search", (), block {
12+
define-function: ("collapsed-from-search", [], block {
1313
// Now we do the same through search result.
1414
// First we reload the page without the anchor in the URL.
1515
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
1616
// Then we collapse the section again...
1717
set-property: ("#implementations-list .implementors-toggle", {"open": "false"})
1818
// Then we run the search.
19-
write: (".search-input", "foo::must_use")
19+
write-into: (".search-input", "foo::must_use")
2020
wait-for: "//*[@id='search']//a[@href='../test_docs/struct.Foo.html#method.must_use']"
2121
click: "//*[@id='search']//a[@href='../test_docs/struct.Foo.html#method.must_use']"
2222
assert-property: ("#implementations-list .implementors-toggle", {"open": "true"})

tests/rustdoc-gui/headers-color.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
define-function: (
44
"check-colors",
5-
(theme, color, code_header_color, focus_background_color, headings_color),
5+
[theme, color, code_header_color, focus_background_color, headings_color],
66
block {
77
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
88
// This is needed so that the text color is computed.

tests/rustdoc-gui/headings-anchor.goml

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ show-text: true
44

55
define-function: (
66
"check-heading-anchor",
7-
(heading_id),
7+
[heading_id],
88
block {
99
// The anchor should not be displayed by default.
1010
assert-css: ("#" + |heading_id| + " .doc-anchor", { "display": "none" })
@@ -27,6 +27,6 @@ move-cursor-to: "#top-doc-prose-title"
2727
// to prevent it from overlapping with the `[-]` element.
2828
assert-css: ("#top-doc-prose-title:hover .doc-anchor", { "display": "none" })
2929

30-
call-function: ("check-heading-anchor", ("top-doc-prose-sub-heading"))
31-
call-function: ("check-heading-anchor", ("top-doc-prose-sub-sub-heading"))
32-
call-function: ("check-heading-anchor", ("you-know-the-drill"))
30+
call-function: ("check-heading-anchor", {"heading_id": "top-doc-prose-sub-heading"})
31+
call-function: ("check-heading-anchor", {"heading_id": "top-doc-prose-sub-sub-heading"})
32+
call-function: ("check-heading-anchor", {"heading_id": "you-know-the-drill"})

tests/rustdoc-gui/headings.goml

+5-5
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ go-to: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
156156

157157
define-function: (
158158
"check-colors",
159-
(theme, heading_color, small_heading_color, heading_border_color),
159+
[theme, heading_color, small_heading_color, heading_border_color],
160160
block {
161161
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
162162
reload:
@@ -220,7 +220,7 @@ call-function: (
220220

221221
define-function: (
222222
"check-since-color",
223-
(theme),
223+
[theme],
224224
block {
225225
set-local-storage: {"rustdoc-theme": |theme|}
226226
reload:
@@ -229,6 +229,6 @@ define-function: (
229229
)
230230

231231
go-to: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html"
232-
call-function: ("check-since-color", ("ayu"))
233-
call-function: ("check-since-color", ("dark"))
234-
call-function: ("check-since-color", ("light"))
232+
call-function: ("check-since-color", {"theme": "ayu"})
233+
call-function: ("check-since-color", {"theme": "dark"})
234+
call-function: ("check-since-color", {"theme": "light"})

tests/rustdoc-gui/help-page.goml

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ assert-css: ("#help dd", {"font-size": "16px"})
77
click: "#help-button > a"
88
assert-css: ("#help", {"display": "block"})
99
compare-elements-property: (".sub", "#help", ["offsetWidth"])
10-
compare-elements-position: (".sub", "#help", ("x"))
10+
compare-elements-position: (".sub", "#help", ["x"])
1111
set-window-size: (500, 1000) // Try mobile next.
1212
assert-css: ("#help", {"display": "block"})
1313
compare-elements-property: (".sub", "#help", ["offsetWidth"])
14-
compare-elements-position: (".sub", "#help", ("x"))
14+
compare-elements-position: (".sub", "#help", ["x"])
1515

1616
// Checking the color of the elements of the help menu.
1717
show-text: true
1818
define-function: (
1919
"check-colors",
20-
(theme, color, background, box_shadow),
20+
[theme, color, background, box_shadow],
2121
block {
2222
// Setting the theme.
2323
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
@@ -60,7 +60,7 @@ assert-css: ("#help dd", {"font-size": "16px"})
6060
click: "#help-button > a"
6161
assert-css: ("#help", {"display": "none"})
6262
compare-elements-property-false: (".sub", "#help", ["offsetWidth"])
63-
compare-elements-position-false: (".sub", "#help", ("x"))
63+
compare-elements-position-false: (".sub", "#help", ["x"])
6464

6565
// This test ensures that the "the rustdoc book" anchor link within the help popover works.
6666
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"

tests/rustdoc-gui/highlight-colors.goml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ show-text: true
44

55
define-function: (
66
"check-colors",
7-
(
7+
[
88
theme,
99
kw,
1010
kw2,
@@ -20,7 +20,7 @@ define-function: (
2020
question_mark,
2121
comment,
2222
doc_comment,
23-
),
23+
],
2424
block {
2525
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
2626
reload:

tests/rustdoc-gui/item-decl-colors.goml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fail-on-request-error: false
66

77
define-function: (
88
"check-colors",
9-
(
9+
[
1010
theme,
1111
attr_color,
1212
trait_color,
@@ -16,7 +16,7 @@ define-function: (
1616
constant_color,
1717
fn_color,
1818
assoc_type_color,
19-
),
19+
],
2020
block {
2121
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.WithGenerics.html"
2222
show-text: true

tests/rustdoc-gui/item-decl-comment-highlighting.goml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ show-text: true
44

55
define-function: (
66
"check-item-decl-comment",
7-
(theme, url, comment_color),
7+
[theme, url, comment_color],
88
block {
99
go-to: |url|
1010
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
@@ -15,7 +15,7 @@ define-function: (
1515

1616
define-function: (
1717
"check-items-for-theme",
18-
(theme, comment_color),
18+
[theme, comment_color],
1919
block {
2020
call-function: ("check-item-decl-comment", {
2121
"theme": |theme|,

tests/rustdoc-gui/item-info-alignment.goml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go-to: "file://" + |DOC_PATH| + "/lib2/struct.ItemInfoAlignmentTest.html"
44

55
// First, we try it in "desktop" mode.
66
set-window-size: (1200, 870)
7-
compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ("x"))
7+
compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ["x"])
88
// Next, we try it in "mobile" mode (max-width: 700px).
99
set-window-size: (650, 650)
10-
compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ("x"))
10+
compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ["x"])

tests/rustdoc-gui/item-info.goml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ assert-count: ("#main-content > .item-info .stab", 2)
3131
compare-elements-position-false: (
3232
"#main-content > .item-info .stab:nth-of-type(1)",
3333
"#main-content > .item-info .stab:nth-of-type(2)",
34-
("y"),
34+
["y"],
3535
)
3636
// But they should have the same `x` position.
3737
compare-elements-position: (
3838
"#main-content > .item-info .stab:nth-of-type(1)",
3939
"#main-content > .item-info .stab:nth-of-type(2)",
40-
("x"),
40+
["x"],
4141
)
4242
// They are supposed to have the same height too.
4343
compare-elements-css: (

tests/rustdoc-gui/jump-to-def-background.goml

+13-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ go-to: "file://" + |DOC_PATH| + "/src/link_to_definition/lib.rs.html"
33

44
define-function: (
55
"check-background-color",
6-
(theme, background_color),
6+
[theme, background_color],
77
block {
88
// Set the theme.
99
set-local-storage: { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false" }
@@ -17,6 +17,15 @@ define-function: (
1717
},
1818
)
1919

20-
call-function: ("check-background-color", ("ayu", "#333"))
21-
call-function: ("check-background-color", ("dark", "#333"))
22-
call-function: ("check-background-color", ("light", "#eee"))
20+
call-function: ("check-background-color", {
21+
"theme": "ayu",
22+
"background_color": "#333",
23+
})
24+
call-function: ("check-background-color", {
25+
"theme": "dark",
26+
"background_color": "#333",
27+
})
28+
call-function: ("check-background-color", {
29+
"theme": "light",
30+
"background_color": "#eee",
31+
})

tests/rustdoc-gui/label-next-to-symbol.goml

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ compare-elements-position-near: (
2727
compare-elements-position: (
2828
".item-name .stab.deprecated",
2929
".item-name .stab.portability",
30-
("y"),
30+
["y"],
3131
)
3232

3333
// Ensure no wrap
3434
compare-elements-position: (
3535
"//*[@class='item-name']//a[text()='replaced_function']/..",
3636
"//*[@class='desc docblock-short'][text()='a thing with a label']",
37-
("y"),
37+
["y"],
3838
)
3939

4040
// Mobile view
@@ -49,19 +49,19 @@ compare-elements-position-near: (
4949
compare-elements-position: (
5050
".item-name .stab.deprecated",
5151
".item-name .stab.portability",
52-
("y"),
52+
["y"],
5353
)
5454

5555
// Ensure wrap
5656
compare-elements-position-false: (
5757
"//*[@class='item-name']//a[text()='replaced_function']/..",
5858
"//*[@class='desc docblock-short'][text()='a thing with a label']",
59-
("y"),
59+
["y"],
6060
)
6161
compare-elements-position-false: (
6262
".item-name .stab.deprecated",
6363
"//*[@class='desc docblock-short'][text()='a thing with a label']",
64-
("y"),
64+
["y"],
6565
)
6666

6767
// Ensure it doesn't expand.
@@ -72,5 +72,5 @@ go-to: "file://" + |DOC_PATH| + "/test_docs/cfgs/index.html"
7272
compare-elements-position-false: (
7373
"//*[@class='stab portability']/code[text()='appservice-api-c']",
7474
"//*[@class='stab portability']/code[text()='server']",
75-
("y"),
75+
["y"],
7676
)

tests/rustdoc-gui/links-color.goml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ show-text: true
66

77
define-function: (
88
"check-colors",
9-
(theme, mod, macro, struct, enum, trait, fn, type, union, keyword,
10-
sidebar, sidebar_current, sidebar_current_background),
9+
[theme, mod, macro, struct, enum, trait, fn, type, union, keyword,
10+
sidebar, sidebar_current, sidebar_current_background],
1111
block {
1212
set-local-storage: {
1313
"rustdoc-theme": |theme|,

0 commit comments

Comments
 (0)