From 38bda67adc626db8bae127240f27ffeb556fd03a Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Thu, 24 Mar 2016 10:09:19 +0100 Subject: [PATCH 1/5] Add background-tabs and new-tab-position tests Using hints to select and open the link. Not sure if there are better ways. Issue-Link: https://github.com/The-Compiler/qutebrowser/issues/999 --- tests/integration/features/tabs.feature | 58 +++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/tests/integration/features/tabs.feature b/tests/integration/features/tabs.feature index f757d15f4..caab7976d 100644 --- a/tests/integration/features/tabs.feature +++ b/tests/integration/features/tabs.feature @@ -644,3 +644,61 @@ Feature: Tab management And I run :tab-only And I run :tab-close Then qutebrowser should quit + + # tab settings + + Scenario: opening links with tabs->background-tabs true + When I set tabs -> background-tabs to true + And I open data/hints/link.html + And I run :hint all tab + And I run :follow-hint a + Then the following tabs should be open: + - data/hints/link.html (active) + - data/hello.txt + + Scenario: opening tab with tabs->new-tab-position left + When I set tabs -> new-tab-position to left + And I set tabs -> background-tabs to false + And I open about:blank + And I open data/hints/link.html in a new tab + And I run :hint all tab + And I run :follow-hint a + Then the following tabs should be open: + - about:blank + - data/hello.txt (active) + - data/hints/link.html + + Scenario: opening tab with tabs->new-tab-position right + When I set tabs -> new-tab-position to right + And I set tabs -> background-tabs to false + And I open about:blank + And I open data/hints/link.html in a new tab + And I run :hint all tab + And I run :follow-hint a + Then the following tabs should be open: + - about:blank + - data/hints/link.html + - data/hello.txt (active) + + Scenario: opening tab with tabs->new-tab-position first + When I set tabs -> new-tab-position to first + And I open about:blank + And I open data/hints/link.html in a new tab + And I run :hint all tab + And I run :follow-hint a + Then the following tabs should be open: + - data/hello.txt (active) + - about:blank + - data/hints/link.html + + Scenario: opening tab with tabs->new-tab-position last + When I set tabs -> new-tab-position to last + And I open data/hints/link.html + And I open about:blank in a new tab + And I run :tab-focus last + And I run :hint all tab + And I run :follow-hint a + Then the following tabs should be open: + - data/hints/link.html + - about:blank + - data/hello.txt (active) From 7e55eee1b9dc07a9908c70cc49503eb48e976cac Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Thu, 24 Mar 2016 10:20:21 +0100 Subject: [PATCH 2/5] Set background-tabs to false for rest of the tests Because it is set to true in a previous test and it is better to avoid shared state in tests. Especially, if we want to randomize tests later on. --- tests/integration/features/tabs.feature | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/integration/features/tabs.feature b/tests/integration/features/tabs.feature index caab7976d..323ecea6e 100644 --- a/tests/integration/features/tabs.feature +++ b/tests/integration/features/tabs.feature @@ -682,6 +682,7 @@ Feature: Tab management Scenario: opening tab with tabs->new-tab-position first When I set tabs -> new-tab-position to first + And I set tabs -> background-tabs to false And I open about:blank And I open data/hints/link.html in a new tab And I run :hint all tab @@ -693,6 +694,7 @@ Feature: Tab management Scenario: opening tab with tabs->new-tab-position last When I set tabs -> new-tab-position to last + And I set tabs -> background-tabs to false And I open data/hints/link.html And I open about:blank in a new tab And I run :tab-focus last From 624aa9b41d68e11337765dfe189ccd98214a62af Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Thu, 24 Mar 2016 11:40:10 +0100 Subject: [PATCH 3/5] Try to fix possible race conditions --- tests/integration/features/tabs.feature | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/integration/features/tabs.feature b/tests/integration/features/tabs.feature index 323ecea6e..512085d78 100644 --- a/tests/integration/features/tabs.feature +++ b/tests/integration/features/tabs.feature @@ -663,6 +663,7 @@ Feature: Tab management And I open data/hints/link.html in a new tab And I run :hint all tab And I run :follow-hint a + And I wait until data/hello.txt is loaded Then the following tabs should be open: - about:blank - data/hello.txt (active) @@ -675,6 +676,7 @@ Feature: Tab management And I open data/hints/link.html in a new tab And I run :hint all tab And I run :follow-hint a + And I wait until data/hello.txt is loaded Then the following tabs should be open: - about:blank - data/hints/link.html @@ -687,6 +689,7 @@ Feature: Tab management And I open data/hints/link.html in a new tab And I run :hint all tab And I run :follow-hint a + And I wait until data/hello.txt is loaded Then the following tabs should be open: - data/hello.txt (active) - about:blank @@ -700,6 +703,7 @@ Feature: Tab management And I run :tab-focus last And I run :hint all tab And I run :follow-hint a + And I wait until data/hello.txt is loaded Then the following tabs should be open: - data/hints/link.html - about:blank From a0e32753a54dcc02d3ef7204fb4fa694207dea03 Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Thu, 24 Mar 2016 12:20:08 +0100 Subject: [PATCH 4/5] Forgot a possible race condition --- tests/integration/features/tabs.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/integration/features/tabs.feature b/tests/integration/features/tabs.feature index 512085d78..8d898694b 100644 --- a/tests/integration/features/tabs.feature +++ b/tests/integration/features/tabs.feature @@ -652,6 +652,7 @@ Feature: Tab management And I open data/hints/link.html And I run :hint all tab And I run :follow-hint a + And I wait until data/hello.txt is loaded Then the following tabs should be open: - data/hints/link.html (active) - data/hello.txt From 1c3516bfacf36293bfade2e1c1492cee219d202a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 24 Mar 2016 20:21:46 +0100 Subject: [PATCH 5/5] Regenerate authors --- README.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.asciidoc b/README.asciidoc index 315ba4562..451c140dc 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -170,6 +170,7 @@ Contributors, sorted by the number of commits in descending order: * John ShaggyTwoDope Jenkins * Peter Vilim * Oliver Caldwell +* Philipp Hansch * Jonas Schürmann * Jimmy * Panagiotis Ktistakis @@ -186,7 +187,6 @@ Contributors, sorted by the number of commits in descending order: * neeasade * jnphilipp * Tobias Patzl -* Philipp Hansch * Peter Michely * Link * Larry Hynes