Skip to content

Commit a7570b0

Browse files
authored
Rollup merge of rust-lang#109412 - GuillaumeGomez:add-gui-test, r=notriddle
rustdoc: Add GUI test for "Auto-hide item contents for large items" setting Part of rust-lang#66181. The `browser-ui-test` version update is because there wasn't `null` check for attributes so I added it (PR is [here](GuillaumeGomez/browser-UI-test#440)). r? ``@notriddle``
2 parents 44942ad + ab1573a commit a7570b0

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.14.4
1+
0.14.5
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// This test ensures that the "Auto-hide item contents for large items" setting is working as
2+
// expected.
3+
4+
// We need to disable this check because `implementors/test_docs/trait.Iterator.js` doesn't exist.
5+
fail-on-request-error: false
6+
7+
define-function: (
8+
"check-setting",
9+
(storage_value, setting_attribute_value, toggle_attribute_value),
10+
block {
11+
assert-local-storage: {"rustdoc-auto-hide-large-items": |storage_value|}
12+
click: "#settings-menu"
13+
wait-for: "#settings"
14+
assert-property: ("#auto-hide-large-items", {"checked": |setting_attribute_value|})
15+
assert-attribute: (".item-decl .type-contents-toggle", {"open": |toggle_attribute_value|})
16+
}
17+
)
18+
19+
goto: "file://" + |DOC_PATH| + "/lib2/scroll_traits/trait.Iterator.html"
20+
21+
// We check that the setting is enabled by default and is working.
22+
call-function: ("check-setting", {
23+
"storage_value": null,
24+
"setting_attribute_value": "true",
25+
"toggle_attribute_value": null,
26+
})
27+
28+
// Now we change its value.
29+
click: "#auto-hide-large-items"
30+
assert-local-storage: {"rustdoc-auto-hide-large-items": "false"}
31+
32+
// We check that the changes were applied as expected.
33+
reload:
34+
35+
call-function: ("check-setting", {
36+
"storage_value": "false",
37+
"setting_attribute_value": "false",
38+
"toggle_attribute_value": "",
39+
})
40+
41+
// And now we re-enable the setting.
42+
click: "#auto-hide-large-items"
43+
assert-local-storage: {"rustdoc-auto-hide-large-items": "true"}
44+
45+
// And we check everything is back the way it was before.
46+
reload:
47+
call-function: ("check-setting", {
48+
"storage_value": "true",
49+
"setting_attribute_value": "true",
50+
"toggle_attribute_value": null,
51+
})

0 commit comments

Comments
 (0)