]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc-gui/shortcuts.goml
Auto merge of #106884 - clubby789:fieldless-enum-debug, r=michaelwoerister
[rust.git] / tests / rustdoc-gui / shortcuts.goml
1 // Check that the various shortcuts are working.
2 goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
3 // We first check that the search input isn't already focused.
4 assert-false: "input.search-input:focus"
5 press-key: "s"
6 assert: "input.search-input:focus"
7 press-key: "Escape"
8 assert-false: "input.search-input:focus"
9 // We now check for the help popup.
10 press-key: "?"
11 assert-css: ("#help-button .popover", {"display": "block"})
12 press-key: "Escape"
13 assert-css: ("#help-button .popover", {"display": "none"})
14 // Checking doc collapse and expand.
15 // It should be displaying a "-":
16 assert-text: ("#toggle-all-docs", "[\u2212]")
17 press-key: "-"
18 wait-for-text: ("#toggle-all-docs", "[+]")
19 assert-attribute: ("#toggle-all-docs", {"class": "will-expand"})
20 // Pressing it again shouldn't do anything.
21 press-key: "-"
22 assert-text: ("#toggle-all-docs", "[+]")
23 assert-attribute: ("#toggle-all-docs", {"class": "will-expand"})
24 // Expanding now.
25 press-key: "+"
26 wait-for-text: ("#toggle-all-docs", "[\u2212]")
27 assert-attribute: ("#toggle-all-docs", {"class": ""})
28 // Pressing it again shouldn't do anything.
29 press-key: "+"
30 assert-text: ("#toggle-all-docs", "[\u2212]")
31 assert-attribute: ("#toggle-all-docs", {"class": ""})