@@ -219,3 +219,33 @@ press-key: "Tab"
219
219
press-key: "Tab"
220
220
press-key: "Tab"
221
221
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