diff options
-rw-r--r-- | tests/end2end/features/conftest.py | 11 | ||||
-rw-r--r-- | tests/end2end/features/utilcmds.feature | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/tests/end2end/features/conftest.py b/tests/end2end/features/conftest.py index 089f0c42c..082b999b1 100644 --- a/tests/end2end/features/conftest.py +++ b/tests/end2end/features/conftest.py @@ -684,8 +684,15 @@ def should_quit(qtbot, quteproc): def _get_scroll_values(quteproc): data = quteproc.get_session() - pos = data['windows'][0]['tabs'][0]['history'][-1]['scroll-pos'] - return (pos['x'], pos['y']) + + def get_active(things): + return next(thing for thing in things if thing.get("active")) + + active_window = get_active(data["windows"]) + active_tab = get_active(active_window["tabs"]) + current_entry = get_active(active_tab["history"]) + pos = current_entry["scroll-pos"] + return (pos["x"], pos["y"]) @bdd.then(bdd.parsers.re(r"the page should be scrolled " diff --git a/tests/end2end/features/utilcmds.feature b/tests/end2end/features/utilcmds.feature index 1b5306adb..ebacea890 100644 --- a/tests/end2end/features/utilcmds.feature +++ b/tests/end2end/features/utilcmds.feature @@ -3,6 +3,7 @@ Feature: Miscellaneous utility commands exposed to the user. Background: Given I open data/scroll/simple.html And I run :tab-only + And I run :window-only ## :cmd-later |