From af9e13690e8cff1423fb5dd70867c4f8c99be961 Mon Sep 17 00:00:00 2001 From: toofar Date: Mon, 29 Jan 2024 22:11:12 +1300 Subject: Finish end2end tests for :tab-close --recursive Background section: * use the new Given I open ... to open a new window after enabling tree tabs, so we can actually test with a tree tabbed window * an alternative is to change the "fresh instance" given step to take -s settings, but that seems a little more expense * move "clean up open tabs" to after we've opened a new window Scenario section: * change to opening related tabs so that they are nested and get closed recursively (also "I open" doesn't know about siblings yet) Other: * add a test_treetabs_bdd.py file - don't we need these to run the features? Maybe I'm missing something and have been doing it wrong... TODO: * do we need to clean up the tabs.tree_tabs setting? If so how? Or do we get a new instance for each Feature file? * why is `set tabs.tabs_are_windows to false` there? Do we need that? Lets see in CI I guess Co-authored-by: pylbrecht --- tests/end2end/features/test_treetabs_bdd.py | 6 ++++++ tests/end2end/features/treetabs.feature | 12 +++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 tests/end2end/features/test_treetabs_bdd.py diff --git a/tests/end2end/features/test_treetabs_bdd.py b/tests/end2end/features/test_treetabs_bdd.py new file mode 100644 index 000000000..9cbb315d7 --- /dev/null +++ b/tests/end2end/features/test_treetabs_bdd.py @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) +# +# SPDX-License-Identifier: GPL-3.0-or-later + +import pytest_bdd as bdd +bdd.scenarios("treetabs.feature") diff --git a/tests/end2end/features/treetabs.feature b/tests/end2end/features/treetabs.feature index 78439e373..bc6fad45c 100644 --- a/tests/end2end/features/treetabs.feature +++ b/tests/end2end/features/treetabs.feature @@ -1,16 +1,18 @@ Feature: Tree tab management - Tests for various :tab-* commands. + Tests for various :tree-tab-* commands. Background: - Given I clean up open tabs - And I set tabs.tabs_are_windows to false + # Open a new tree tab enabled window, close everything else + Given I set tabs.tabs_are_windows to false And I set tabs.tree_tabs to true + And I open about:blank?starting%20page in a new window + And I clean up open tabs And I clear the log Scenario: :tab-close --recursive When I open data/numbers/1.txt - And I open data/numbers/2.txt in a new tab as a sibling - And I open data/numbers/3.txt in a new tab as a sibling + 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 1 And I run :tab-close --recursive -- cgit v1.2.3-54-g00ecf