summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoofar <toofar@spalge.com>2024-02-09 14:11:42 +1300
committertoofar <toofar@spalge.com>2024-02-09 14:45:34 +1300
commitcfaff206ea8cc1c369b2bd9c0d525c9933b80ff2 (patch)
tree3a92fae93bda77937eeb26b375e412920a9844db
parent5a0e9ddfe7185f98de4d50ea6bf73db4e7a44840 (diff)
downloadqutebrowser-cfaff206ea8cc1c369b2bd9c0d525c9933b80ff2.tar.gz
qutebrowser-cfaff206ea8cc1c369b2bd9c0d525c9933b80ff2.zip
Add some more end2end tests for tree tabs
The first three tests make sure that the "collapsed" attribute makes it through the session machinery and behaves as expected. Third one is a bit sneaky because it tests a case that was causing issues, but this test couldn't actually reproduce. The problem was that before we were passing `related=False` to `tabopen()` the tab after a collapsed group would be loaded hidden when it wasn't supposed to be. This was only in the UI though, if you saved a session it would be correct, so we can't test it in these e2e tests currently...
-rw-r--r--tests/end2end/features/treetabs.feature61
1 files changed, 61 insertions, 0 deletions
diff --git a/tests/end2end/features/treetabs.feature b/tests/end2end/features/treetabs.feature
index f32ff3d07..898f9e21a 100644
--- a/tests/end2end/features/treetabs.feature
+++ b/tests/end2end/features/treetabs.feature
@@ -25,3 +25,64 @@ Feature: Tree tab management
Then the following tabs should be open:
- data/numbers/1.txt
- data/numbers/2.txt (active)
+
+ Scenario: Collapse a subtree
+ When I open data/numbers/1.txt
+ And I open data/numbers/2.txt in a new related tab
+ And I open data/numbers/3.txt in a new related tab
+ And I run :tab-focus 2
+ And I run :tree-tab-toggle-hide
+ Then the following tabs should be open:
+ - data/numbers/1.txt
+ - data/numbers/2.txt (active) (collapsed)
+ - data/numbers/3.txt
+
+ Scenario: Load a collapsed subtree
+ # Same setup as above
+ When I open data/numbers/1.txt
+ And I open data/numbers/2.txt in a new related tab
+ And I open data/numbers/3.txt in a new related tab
+ And I run :tab-focus 2
+ And I run :tree-tab-toggle-hide
+ # Now actually load the saved session
+ And I run :session-save foo
+ And I run :session-load -c foo
+ And I wait until data/numbers/3.txt is loaded
+ # And of course the same assertion as above too
+ Then the following tabs should be open:
+ - data/numbers/1.txt
+ - data/numbers/2.txt (active) (collapsed)
+ - data/numbers/3.txt
+
+ Scenario: Uncollapse a subtree
+ When I open data/numbers/1.txt
+ And I open data/numbers/2.txt in a new related tab
+ And I open data/numbers/3.txt in a new related tab
+ And I run :tab-focus 2
+ And I run :tree-tab-toggle-hide
+ And I run :tree-tab-toggle-hide
+ Then the following tabs should be open:
+ - data/numbers/1.txt
+ - data/numbers/2.txt (active)
+ - data/numbers/3.txt
+
+ # Same as a test in sessions.feature but tree tabs and the related
+ # settings.
+ Scenario: TreeTabs: Loading a session with tabs.new_position.related=prev
+ When I open data/numbers/1.txt
+ And I open data/numbers/2.txt in a new related tab
+ And I open data/numbers/3.txt in a new related tab
+ And I open data/numbers/4.txt in a new tab
+ And I run :tab-focus 2
+ And I run :tree-tab-toggle-hide
+ And I run :session-save foo
+ And I set tabs.new_position.related to prev
+ And I set tabs.new_position.tree.new_child to last
+ And I set tabs.new_position.tree.new_toplevel to prev
+ And I run :session-load -c foo
+ And I wait until data/numbers/4.txt is loaded
+ Then the following tabs should be open:
+ - data/numbers/1.txt
+ - data/numbers/2.txt (active) (collapsed)
+ - data/numbers/3.txt
+ - data/numbers/4.txt