summaryrefslogtreecommitdiff
path: root/tests/end2end/features/conftest.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/end2end/features/conftest.py')
-rw-r--r--tests/end2end/features/conftest.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/end2end/features/conftest.py b/tests/end2end/features/conftest.py
index 2aefe97da..c883e4f58 100644
--- a/tests/end2end/features/conftest.py
+++ b/tests/end2end/features/conftest.py
@@ -613,9 +613,37 @@ def check_open_tree_tabs(quteproc, request, tabs):
It expects a tree of URLs, with an optional "(active)" suffix.
"""
+ session = quteproc.get_session()
+ # TODO: support ' (collapsed)', also maybe make suffixes generic?
+ active_suffix = ' (active)'
+ pinned_suffix = ' (pinned)'
+ tabs = tabs.splitlines()
+ assert len(session['windows']) == 1
+ assert len(session['windows'][0]['tabs']) == len(tabs)
+
+ # If we don't have (active) anywhere, don't check it
+ has_active = any(active_suffix in line for line in tabs)
+ has_pinned = any(pinned_suffix in line for line in tabs)
+
+
+ from qutebrowser.misc import sessions
+ tree_data = sessions.SessionManager._reconstruct_tree_data(None, session['windows'][0])
+
+ # TODO: iterate/recurse through tree_data and build a string of the same
+ # format we are putting in the test fixtures
+
+ root = [v for v in tree_data.values() if "treetab_node_data" not in v][0]
+ expected = ""
+ for uid in root["children"]:
+ ...
+
+ # Then copy the remaining parts from check_open_tabs() and probably change
+ # it to support more leading spaces
+
raise NotImplementedError
+
@bdd.then(bdd.parsers.parse("the following tabs should be open:\n{tabs}"))
def check_open_tabs(quteproc, request, tabs):
"""Check the list of open tabs in the session.