qutebrowser/tests/end2end/features/open.feature

111 lines
3.8 KiB
Gherkin
Raw Normal View History

2015-11-24 19:19:23 +01:00
Feature: Opening pages
Scenario: :open with URL
Given I open about:blank
2015-11-25 18:02:14 +01:00
When I run :open http://localhost:(port)/data/numbers/1.txt
And I wait until data/numbers/1.txt is loaded
2015-11-24 19:19:23 +01:00
And I run :tab-only
Then the session should look like:
windows:
- tabs:
- active: true
history:
- url: about:blank
- active: true
2015-11-25 18:02:14 +01:00
url: http://localhost:*/data/numbers/1.txt
2015-11-24 19:19:23 +01:00
Scenario: :open without URL and no -t/-b/-w
When I run :open
2015-11-26 17:50:39 +01:00
Then the error "No URL given, but -t/-b/-w is not set!" should be shown
2015-11-24 19:19:23 +01:00
Scenario: :open without URL and -t
2015-11-25 18:02:14 +01:00
When I set general -> default-page to http://localhost:(port)/data/numbers/2.txt
2015-11-24 19:19:23 +01:00
And I run :open -t
2015-11-25 18:02:14 +01:00
Then data/numbers/2.txt should be loaded
2015-11-24 19:19:23 +01:00
Scenario: :open with invalid URL
When I set general -> auto-search to false
And I run :open foo!
2015-11-26 17:50:39 +01:00
Then the error "Invalid URL" should be shown
2015-11-24 19:19:23 +01:00
Scenario: :open with -t and -b
When I run :open -t -b foo.bar
2015-11-26 17:50:39 +01:00
Then the error "Only one of -t/-b/-w can be given!" should be shown
2015-11-24 19:19:23 +01:00
Scenario: Searching with :open
When I set general -> auto-search to naive
2015-11-25 18:02:14 +01:00
And I set searchengines -> DEFAULT to http://localhost:(port)/data/numbers/{}.txt
2015-11-24 19:19:23 +01:00
And I run :open 3
2015-11-25 18:02:14 +01:00
Then data/numbers/3.txt should be loaded
2015-11-24 19:19:23 +01:00
Scenario: Opening in a new tab
Given I open about:blank
When I run :tab-only
2015-11-25 18:02:14 +01:00
And I run :open -t http://localhost:(port)/data/numbers/4.txt
And I wait until data/numbers/4.txt is loaded
2015-11-24 19:19:23 +01:00
Then the session should look like:
windows:
- tabs:
- history:
- url: about:blank
- active: true
history:
- active: true
2015-11-25 18:02:14 +01:00
url: http://localhost:*/data/numbers/4.txt
2015-11-24 19:19:23 +01:00
Scenario: Opening in a new background tab
Given I open about:blank
When I run :tab-only
2015-11-25 18:02:14 +01:00
And I run :open -b http://localhost:(port)/data/numbers/5.txt
And I wait until data/numbers/5.txt is loaded
2015-11-24 19:19:23 +01:00
Then the session should look like:
windows:
- tabs:
- active: true
history:
- active: true
url: about:blank
- history:
- active: true
2015-11-25 18:02:14 +01:00
url: http://localhost:*/data/numbers/5.txt
2015-11-24 19:19:23 +01:00
Scenario: :open with count
Given I open about:blank
When I run :tab-only
And I open about:blank in a new tab
2015-11-25 18:02:14 +01:00
And I run :open http://localhost:(port)/data/numbers/6.txt with count 2
And I wait until data/numbers/6.txt is loaded
2015-11-24 19:19:23 +01:00
Then the session should look like:
windows:
- tabs:
- history:
- url: about:blank
- active: true
history:
- url: about:blank
- active: true
2015-11-25 18:02:14 +01:00
url: http://localhost:*/data/numbers/6.txt
2015-11-24 19:19:23 +01:00
Scenario: Opening in a new window
Given I open about:blank
When I run :tab-only
2015-11-25 18:02:14 +01:00
And I run :open -w http://localhost:(port)/data/numbers/7.txt
And I wait until data/numbers/7.txt is loaded
2015-11-24 19:19:23 +01:00
Then the session should look like:
windows:
- tabs:
- active: true
history:
- active: true
url: about:blank
- tabs:
- active: true
history:
- active: true
2015-11-25 18:02:14 +01:00
url: http://localhost:*/data/numbers/7.txt
2016-07-29 08:36:05 +02:00
Scenario: Opening a quickmark
When I run :quickmark-add http://localhost:(port)/data/numbers/8.txt quickmarktest
And I run :open quickmarktest
Then data/numbers/8.txt should be loaded