diff options
-rw-r--r-- | tests/end2end/features/conftest.py | 28 | ||||
-rw-r--r-- | tests/end2end/features/treetabs.feature | 7 |
2 files changed, 35 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. diff --git a/tests/end2end/features/treetabs.feature b/tests/end2end/features/treetabs.feature index bc6fad45c..bb2654acd 100644 --- a/tests/end2end/features/treetabs.feature +++ b/tests/end2end/features/treetabs.feature @@ -18,3 +18,10 @@ Feature: Tree tab management And I run :tab-close --recursive Then the following tabs should be open: - data/numbers/4.txt + + Scenario: Open a child tab + When I open data/numbers/1.txt + And I open data/numbers/2.txt in a new related tab + Then the following tree tabs should be open: + - data/numbers/1.txt + - data/numbers/2.txt |