Skip to content

Commit 87f81b0

Browse files
Extend GUI test to check notable traits blur behaviour
1 parent 59c856c commit 87f81b0

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/test/rustdoc-gui/notable-trait.goml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,3 +219,33 @@ press-key: "Tab"
219219
press-key: "Tab"
220220
press-key: "Tab"
221221
assert-count: ("//*[@class='notable popover']", 0)
222+
assert: "#method\.create_an_iterator_from_read .notable-traits:focus"
223+
224+
// Now we check that the focus isn't given back to the wrong item when opening
225+
// another popover.
226+
store-window-property: (scroll, "scrollY")
227+
click: "#method\.create_an_iterator_from_read .fnname"
228+
// We ensure that the scroll position changed.
229+
assert-window-property-false: {"scrollY": |scroll|}
230+
// Store the new position.
231+
store-window-property: (scroll, "scrollY")
232+
click: "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']"
233+
wait-for: "//*[@class='notable popover']"
234+
click: "#settings-menu a"
235+
click: ".search-input"
236+
// We ensure we didn't come back to the previous focused item.
237+
assert-window-property-false: {"scrollY": |scroll|}
238+
239+
// Same but with Escape handling.
240+
store-window-property: (scroll, "scrollY")
241+
click: "#method\.create_an_iterator_from_read .fnname"
242+
// We ensure that the scroll position changed.
243+
assert-window-property-false: {"scrollY": |scroll|}
244+
// Store the new position.
245+
store-window-property: (scroll, "scrollY")
246+
click: "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']"
247+
wait-for: "//*[@class='notable popover']"
248+
click: "#settings-menu a"
249+
press-key: "Escape"
250+
// We ensure we didn't come back to the previous focused item.
251+
assert-window-property-false: {"scrollY": |scroll|}

0 commit comments

Comments
 (0)