Skip to content

Commit c3f88a0

Browse files
Add GUI tests
1 parent 94736c4 commit c3f88a0

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Test to ensure that you can click on the search input, whatever the width.
2+
// The PR which fixed it is: https://github.com/rust-lang/rust/pull/81592
3+
goto: file://|DOC_PATH|/index.html
4+
size: (463, 700)
5+
// We first check that the search input isn't already focused.
6+
assert-false: ("input.search-input:focus")
7+
click: "input.search-input"
8+
reload:
9+
size: (750, 700)
10+
click: "input.search-input"
11+
assert: ("input.search-input:focus")

src/test/rustdoc-gui/shortcuts.goml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Check that the various shortcuts are working.
2+
goto: file://|DOC_PATH|/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: ("#help", {"display": "flex"})
12+
assert-false: "#help.hidden"
13+
press-key: "Escape"
14+
assert: ("#help.hidden", {"display": "none"})
15+
// Check for the themes list.
16+
assert: ("#theme-choices", {"display": "none"})
17+
press-key: "t"
18+
assert: ("#theme-choices", {"display": "block"})
19+
press-key: "t"
20+
// We ensure that 't' hides back the menu.
21+
assert: ("#theme-choices", {"display": "none"})
22+
press-key: "t"
23+
assert: ("#theme-choices", {"display": "block"})
24+
press-key: "Escape"
25+
// We ensure that 'Escape' hides the menu too.
26+
assert: ("#theme-choices", {"display": "none"})

0 commit comments

Comments
 (0)