diff options
author | toofar <toofar@spalge.com> | 2024-04-21 17:31:39 +1200 |
---|---|---|
committer | toofar <toofar@spalge.com> | 2024-04-21 17:31:39 +1200 |
commit | 9bf2bae60f6daf631729cb901c845e6c48da4778 (patch) | |
tree | 8dfbd390b2ad17bd303c45609a124f7be75fe56b /tests/end2end/features/conftest.py | |
parent | 7ab4346e501b2011a4be1c5d584008833c6aad6f (diff) | |
parent | 80931acab0cc63760dfc484820b783aaced439b6 (diff) | |
download | qutebrowser-9bf2bae60f6daf631729cb901c845e6c48da4778.tar.gz qutebrowser-9bf2bae60f6daf631729cb901c845e6c48da4778.zip |
Merge remote-tracking branch 'upstream/main' into tree-tabs-integrationtree-tabs-integration
Diffstat (limited to 'tests/end2end/features/conftest.py')
-rw-r--r-- | tests/end2end/features/conftest.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/end2end/features/conftest.py b/tests/end2end/features/conftest.py index 9b7ffdeb5..ce31125b6 100644 --- a/tests/end2end/features/conftest.py +++ b/tests/end2end/features/conftest.py @@ -730,8 +730,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 " |