Skip to content

Commit eead6f4

Browse files
Rollup merge of #111459 - GuillaumeGomez:update-browser-ui-test, r=notriddle
Update browser-ui-test version to 0.16.0 This new version brings one major improvement: it allows to use the original color format in checks (I plan to slowly continue converting colors back to their "original" format, ie the one used in CSS). It also provides some improvements in some commands API. r? `````@notriddle`````
2 parents 7c31df9 + 8e55400 commit eead6f4

17 files changed

+70
-81
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.15.0
1+
0.16.0

src/tools/rustdoc-gui/tester.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ async function runTests(opts, framework_options, files, results, status_bar, sho
143143
const tests_queue = [];
144144

145145
for (const testPath of files) {
146-
const callback = runTest(testPath, framework_options)
146+
const callback = runTest(testPath, {"options": framework_options})
147147
.then(out => {
148148
const [output, nb_failures] = out;
149149
results[nb_failures === 0 ? "successful" : "failed"].push({
@@ -323,6 +323,7 @@ async function main(argv) {
323323
if (results.failed.length > 0 || results.errored.length > 0) {
324324
process.exit(1);
325325
}
326+
process.exit(0);
326327
}
327328

328329
main(process.argv);

tests/rustdoc-gui/check-stab-in-docblock.goml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,26 @@ set-window-size: (786, 600)
77
// Confirms that there 3 paragraphs.
88
assert-count: (".top-doc .docblock p", 3)
99
// Checking that there is no scrollable content.
10-
store-property: (clientHeight, ".top-doc .docblock p:nth-of-type(1)", "clientHeight")
11-
store-property: (clientWidth, ".top-doc .docblock p:nth-of-type(1)", "clientWidth")
10+
store-property: (".top-doc .docblock p:nth-of-type(1)", {
11+
"clientHeight": clientHeight,
12+
"clientWidth": clientWidth,
13+
})
1214
assert-property: (
1315
".top-doc .docblock p:nth-of-type(1)",
1416
{"scrollHeight": |clientHeight|, "scrollWidth": |clientWidth|},
1517
)
16-
store-property: (clientHeight, ".top-doc .docblock p:nth-of-type(2)", "clientHeight")
17-
store-property: (clientWidth, ".top-doc .docblock p:nth-of-type(2)", "clientWidth")
18+
store-property: (".top-doc .docblock p:nth-of-type(2)", {
19+
"clientHeight": clientHeight,
20+
"clientWidth": clientWidth,
21+
})
1822
assert-property: (
1923
".top-doc .docblock p:nth-of-type(2)",
2024
{"scrollHeight": |clientHeight|, "scrollWidth": |clientWidth|},
2125
)
22-
store-property: (clientHeight, ".top-doc .docblock p:nth-of-type(3)", "clientHeight")
23-
store-property: (clientWidth, ".top-doc .docblock p:nth-of-type(3)", "clientWidth")
26+
store-property: (".top-doc .docblock p:nth-of-type(3)", {
27+
"clientHeight": clientHeight,
28+
"clientWidth": clientWidth,
29+
})
2430
assert-property: (
2531
".top-doc .docblock p:nth-of-type(3)",
2632
{"scrollHeight": |clientHeight|, "scrollWidth": |clientWidth|},

tests/rustdoc-gui/codeblock-sub.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Test that code blocks nested within <sub> do not have a line height of 0.
22
go-to: "file://" + |DOC_PATH| + "/test_docs/codeblock_sub/index.html"
33

4-
store-property: (codeblock_sub_1, "#codeblock-sub-1", "offsetHeight")
4+
store-property: ("#codeblock-sub-1", {"offsetHeight": codeblock_sub_1})
55
assert-property-false: ("#codeblock-sub-3", { "offsetHeight": |codeblock_sub_1| })

tests/rustdoc-gui/docblock-details.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ reload:
99
assert-text: (".top-doc .docblock > h3", "Hello")
1010
assert-css: (
1111
".top-doc .docblock > h3",
12-
{"border-bottom": "1px solid rgb(210, 210, 210)"},
12+
{"border-bottom": "1px solid #d2d2d2"},
1313
)
1414
// We now check that the `<summary>` doesn't have a bottom border and has the correct display.
1515
assert-css: (

tests/rustdoc-gui/item-info.goml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ go-to: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
44
// We set a fixed size so there is no chance of "random" resize.
55
set-window-size: (1100, 800)
66
// We check that ".item-info" is bigger than its content.
7-
assert-css: (".item-info", {"width": "840px"})
8-
assert-css: (".item-info .stab", {"width": "289px"})
7+
assert-size: (".item-info", {"width": 840})
8+
assert-size: (".item-info .stab", {"width": 289})
99
assert-position: (".item-info .stab", {"x": 245})
1010

1111
// Now we ensure that they're not rendered on the same line.

tests/rustdoc-gui/notable-trait.goml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,12 @@ assert: "#method\.create_an_iterator_from_read .tooltip:focus"
225225

226226
// Now we check that the focus isn't given back to the wrong item when opening
227227
// another popover.
228-
store-window-property: (scroll, "scrollY")
228+
store-window-property: {"scrollY": scroll}
229229
click: "#method\.create_an_iterator_from_read .fn"
230230
// We ensure that the scroll position changed.
231231
assert-window-property-false: {"scrollY": |scroll|}
232232
// Store the new position.
233-
store-window-property: (scroll, "scrollY")
233+
store-window-property: {"scrollY": scroll}
234234
click: "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']"
235235
wait-for: "//*[@class='tooltip popover']"
236236
click: "#settings-menu a"
@@ -239,12 +239,12 @@ click: ".search-input"
239239
assert-window-property-false: {"scrollY": |scroll|}
240240

241241
// Same but with Escape handling.
242-
store-window-property: (scroll, "scrollY")
242+
store-window-property: {"scrollY": scroll}
243243
click: "#method\.create_an_iterator_from_read .fn"
244244
// We ensure that the scroll position changed.
245245
assert-window-property-false: {"scrollY": |scroll|}
246246
// Store the new position.
247-
store-window-property: (scroll, "scrollY")
247+
store-window-property: {"scrollY": scroll}
248248
click: "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']"
249249
wait-for: "//*[@class='tooltip popover']"
250250
click: "#settings-menu a"

tests/rustdoc-gui/scrape-examples-button-focus.goml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
go-to: "file://" + |DOC_PATH| + "/scrape_examples/fn.test.html"
44

55
// The next/prev buttons vertically scroll the code viewport between examples
6-
store-property: (initialScrollTop, ".scraped-example-list > .scraped-example pre", "scrollTop")
6+
store-property: (".scraped-example-list > .scraped-example pre", {"scrollTop": initialScrollTop})
77
focus: ".scraped-example-list > .scraped-example .next"
88
press-key: "Enter"
99
assert-property-false: (".scraped-example-list > .scraped-example pre", {
@@ -16,7 +16,7 @@ assert-property: (".scraped-example-list > .scraped-example pre", {
1616
}, NEAR)
1717

1818
// The expand button increases the scrollHeight of the minimized code viewport
19-
store-property: (smallOffsetHeight, ".scraped-example-list > .scraped-example pre", "offsetHeight")
19+
store-property: (".scraped-example-list > .scraped-example pre", {"offsetHeight": smallOffsetHeight})
2020
assert-property-false: (".scraped-example-list > .scraped-example pre", {
2121
"scrollHeight": |smallOffsetHeight|
2222
}, NEAR)
@@ -25,7 +25,7 @@ press-key: "Enter"
2525
assert-property-false: (".scraped-example-list > .scraped-example pre", {
2626
"offsetHeight": |smallOffsetHeight|
2727
}, NEAR)
28-
store-property: (fullOffsetHeight, ".scraped-example-list > .scraped-example pre", "offsetHeight")
28+
store-property: (".scraped-example-list > .scraped-example pre", {"offsetHeight": fullOffsetHeight})
2929
assert-property: (".scraped-example-list > .scraped-example pre", {
3030
"scrollHeight": |fullOffsetHeight|
3131
}, NEAR)

tests/rustdoc-gui/scrape-examples-layout.goml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ assert-property-false: (
99

1010
// Check that examples with very long lines have the same width as ones that don't.
1111
store-property: (
12-
clientWidth,
1312
".more-scraped-examples .scraped-example:nth-child(2) .code-wrapper .src-line-numbers",
14-
"clientWidth"
13+
{"clientWidth": clientWidth},
1514
)
1615

1716
assert-property: (
@@ -40,8 +39,8 @@ assert-property: (
4039
store-value: (offset_y, 4)
4140

4241
// First with desktop
43-
assert-position: (".scraped-example .code-wrapper", {"y": 253})
44-
assert-position: (".scraped-example .code-wrapper .prev", {"y": 253 + |offset_y|})
42+
assert-position: (".scraped-example .code-wrapper", {"y": 226})
43+
assert-position: (".scraped-example .code-wrapper .prev", {"y": 226 + |offset_y|})
4544

4645
// Then with mobile
4746
set-window-size: (600, 600)

tests/rustdoc-gui/search-result-display.goml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ set-text: (
3232
)
3333

3434
// Then we compare again to confirm the height didn't change.
35-
assert-css: ("#crate-search", {"width": "527px"})
36-
assert-css: (".search-results-title", {"height": "50px", "width": "640px"})
35+
assert-size: ("#crate-search", {"width": 527})
36+
assert-size: (".search-results-title", {"height": 50, "width": 640})
3737
// And we check that the `<select>` isn't bigger than its container (".search-results-title").
3838
assert-css: ("#search", {"width": "640px"})
3939

0 commit comments

Comments
 (0)