about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2022-11-19 00:25:37 +0100
committerGuillaume Gomez <guillaume.gomez@huawei.com>2022-11-19 10:49:34 +0100
commit87f81b0a9c5fc578c6dfb2f0c3de9e888700e280 (patch)
treea11d333797d67cfbf25bb5a4886840f148c7d53b
parent59c856c071d3cdb5bd8d0d5b49c49be15f72d82a (diff)
downloadrust-87f81b0a9c5fc578c6dfb2f0c3de9e888700e280.tar.gz
rust-87f81b0a9c5fc578c6dfb2f0c3de9e888700e280.zip
Extend GUI test to check notable traits blur behaviour
-rw-r--r--src/test/rustdoc-gui/notable-trait.goml30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/notable-trait.goml b/src/test/rustdoc-gui/notable-trait.goml
index 4c3943d8858..aab3b11433e 100644
--- a/src/test/rustdoc-gui/notable-trait.goml
+++ b/src/test/rustdoc-gui/notable-trait.goml
@@ -219,3 +219,33 @@ press-key: "Tab"
 press-key: "Tab"
 press-key: "Tab"
 assert-count: ("//*[@class='notable popover']", 0)
+assert: "#method\.create_an_iterator_from_read .notable-traits:focus"
+
+// Now we check that the focus isn't given back to the wrong item when opening
+// another popover.
+store-window-property: (scroll, "scrollY")
+click: "#method\.create_an_iterator_from_read .fnname"
+// We ensure that the scroll position changed.
+assert-window-property-false: {"scrollY": |scroll|}
+// Store the new position.
+store-window-property: (scroll, "scrollY")
+click: "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']"
+wait-for: "//*[@class='notable popover']"
+click: "#settings-menu a"
+click: ".search-input"
+// We ensure we didn't come back to the previous focused item.
+assert-window-property-false: {"scrollY": |scroll|}
+
+// Same but with Escape handling.
+store-window-property: (scroll, "scrollY")
+click: "#method\.create_an_iterator_from_read .fnname"
+// We ensure that the scroll position changed.
+assert-window-property-false: {"scrollY": |scroll|}
+// Store the new position.
+store-window-property: (scroll, "scrollY")
+click: "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']"
+wait-for: "//*[@class='notable popover']"
+click: "#settings-menu a"
+press-key: "Escape"
+// We ensure we didn't come back to the previous focused item.
+assert-window-property-false: {"scrollY": |scroll|}