qutebrowser/tests/end2end/features/invoke.feature
Niklas Haas c2cc28a72b
Add new-instance-open-target.window = first-opened
Fixes #1060.

In the process of adding this, I also decided to rewrite
mainwindow.get_window() for clarity (and also because flake8 was warning
about complexity).

Also adds some tests to the new-instance-target mechanism, in particular
a specific test for the issue in question.
2016-08-16 12:24:38 +02:00

109 lines
4.0 KiB
Gherkin

Feature: Invoking a new process
Simulate what happens when running qutebrowser with an existing instance
Background:
Given I clean up open tabs
Scenario: Using new-instance-open-target = tab
When I set general -> new-instance-open-target to tab
And I open data/title.html
And I open data/search.html as a URL
Then the following tabs should be open:
- data/title.html
- data/search.html (active)
Scenario: Using new-instance-open-target = tab-bg
When I set general -> new-instance-open-target to tab-bg
And I open data/title.html
And I open data/search.html as a URL
Then the following tabs should be open:
- data/title.html (active)
- data/search.html
Scenario: Using new-instance-open-target = window
When I set general -> new-instance-open-target to window
And I open data/title.html
And I open data/search.html as a URL
Then the session should look like:
windows:
- tabs:
- history:
- url: about:blank
- url: http://localhost:*/data/title.html
- tabs:
- history:
- url: http://localhost:*/data/search.html
Scenario: Using new-instance-open-target.window = last-opened
When I set general -> new-instance-open-target to tab
And I set general -> new-instance-open-target.window to last-opened
And I open data/title.html
And I open data/search.html in a new window
And I open data/hello.txt as a URL
Then the session should look like:
windows:
- tabs:
- history:
- url: about:blank
- url: http://localhost:*/data/title.html
- tabs:
- history:
- url: http://localhost:*/data/search.html
- history:
- url: http://localhost:*/data/hello.txt
Scenario: Using new-instance-open-target.window = first-opened
When I set general -> new-instance-open-target to tab
And I set general -> new-instance-open-target.window to first-opened
And I open data/title.html
And I open data/search.html in a new window
And I open data/hello.txt as a URL
Then the session should look like:
windows:
- tabs:
- history:
- url: about:blank
- url: http://localhost:*/data/title.html
- history:
- url: http://localhost:*/data/hello.txt
- tabs:
- history:
- url: http://localhost:*/data/search.html
# issue #1060
Scenario: Using target.window = first-opened after tab-detach
When I set general -> new-instance-open-target to tab
And I set general -> new-instance-open-target.window to first-opened
And I open data/title.html
And I open data/search.html in a new tab
And I run :tab-detach
And I open data/hello.txt as a URL
Then the session should look like:
windows:
- tabs:
- history:
- url: about:blank
- url: http://localhost:*/data/title.html
- history:
- url: http://localhost:*/data/hello.txt
- tabs:
- history:
- url: http://localhost:*/data/search.html
Scenario: Opening a new qutebrowser instance with no parameters
When I set general -> new-instance-open-target to tab
And I set general -> startpage to about:blank
And I open data/title.html
And I spawn a new window
And I wait until about:blank is loaded
Then the session should look like:
windows:
- tabs:
- history:
- url: about:blank
- url: http://localhost:*/data/title.html
- tabs:
- history:
- url: about:blank