8af5cfb4ac
This really tripped me up yesterday, My "Vim default" is to use tabs. This (where `!···` is a tab) does not work as you'll hope it works: Scenario: Retrying a failed download when the directory didn't exist (issue 2445) When I download http://localhost:(port)/data/downloads/download.bin to <path> And I wait for the error "Download error: No such file or directory: *" And I make the directory <mkdir> And I run :download-retry !···!···And I wait until the download is finished Then the downloaded file <expected> should exist Examples: | path | mkdir | expected | | asd/zxc/ | asd/zxc | asd/zxc/download.bin | Unfortunately, pytest-bdd uses the "Python 2 behaviour" of "expand all tabs to 8 spaces", and doesn't give any errors on strange/inconsistent whitespace. It can cause very confusing errors.
123 lines
4.4 KiB
Gherkin
123 lines
4.4 KiB
Gherkin
# vim: ft=cucumber fileencoding=utf-8 sts=4 sw=4 et:
|
|
|
|
Feature: Opening pages
|
|
|
|
Scenario: :open with URL
|
|
Given I open about:blank
|
|
When I run :open http://localhost:(port)/data/numbers/1.txt
|
|
And I wait until data/numbers/1.txt is loaded
|
|
And I run :tab-only
|
|
Then the session should look like:
|
|
windows:
|
|
- tabs:
|
|
- active: true
|
|
history:
|
|
- url: about:blank
|
|
- active: true
|
|
url: http://localhost:*/data/numbers/1.txt
|
|
|
|
Scenario: :open without URL
|
|
When I set general -> default-page to http://localhost:(port)/data/numbers/11.txt
|
|
And I run :open
|
|
Then data/numbers/11.txt should be loaded
|
|
|
|
Scenario: :open without URL and -t
|
|
When I set general -> default-page to http://localhost:(port)/data/numbers/2.txt
|
|
And I run :open -t
|
|
Then data/numbers/2.txt should be loaded
|
|
|
|
Scenario: :open with invalid URL
|
|
When I set general -> auto-search to false
|
|
And I run :open foo!
|
|
Then the error "Invalid URL" should be shown
|
|
|
|
Scenario: :open with -t and -b
|
|
When I run :open -t -b foo.bar
|
|
Then the error "Only one of -t/-b/-w can be given!" should be shown
|
|
|
|
Scenario: Searching with :open
|
|
When I set general -> auto-search to naive
|
|
And I set searchengines -> DEFAULT to http://localhost:(port)/data/numbers/{}.txt
|
|
And I run :open 3
|
|
Then data/numbers/3.txt should be loaded
|
|
|
|
Scenario: Opening in a new tab
|
|
Given I open about:blank
|
|
When I run :tab-only
|
|
And I run :open -t http://localhost:(port)/data/numbers/4.txt
|
|
And I wait until data/numbers/4.txt is loaded
|
|
Then the following tabs should be open:
|
|
- about:blank
|
|
- data/numbers/4.txt (active)
|
|
|
|
Scenario: Opening in a new background tab
|
|
Given I open about:blank
|
|
When I run :tab-only
|
|
And I run :open -b http://localhost:(port)/data/numbers/5.txt
|
|
And I wait until data/numbers/5.txt is loaded
|
|
Then the following tabs should be open:
|
|
- about:blank (active)
|
|
- data/numbers/5.txt
|
|
|
|
Scenario: :open with count
|
|
Given I open about:blank
|
|
When I run :tab-only
|
|
And I open about:blank in a new tab
|
|
And I run :open http://localhost:(port)/data/numbers/6.txt with count 2
|
|
And I wait until data/numbers/6.txt is loaded
|
|
Then the session should look like:
|
|
windows:
|
|
- tabs:
|
|
- history:
|
|
- url: about:blank
|
|
- active: true
|
|
history:
|
|
- url: about:blank
|
|
- active: true
|
|
url: http://localhost:*/data/numbers/6.txt
|
|
|
|
Scenario: Opening in a new tab (explicit)
|
|
Given I open about:blank
|
|
When I set tabs -> new-tab-position-explicit to next
|
|
And I set tabs -> new-tab-position to prev
|
|
And I run :tab-only
|
|
And I run :open -t http://localhost:(port)/data/numbers/7.txt
|
|
And I wait until data/numbers/7.txt is loaded
|
|
Then the following tabs should be open:
|
|
- about:blank
|
|
- data/numbers/7.txt (active)
|
|
|
|
Scenario: Opening in a new tab (implicit)
|
|
Given I open about:blank
|
|
When I set tabs -> new-tab-position-explicit to next
|
|
And I set tabs -> new-tab-position to prev
|
|
And I run :tab-only
|
|
And I run :open -t -i http://localhost:(port)/data/numbers/8.txt
|
|
And I wait until data/numbers/8.txt is loaded
|
|
Then the following tabs should be open:
|
|
- data/numbers/8.txt (active)
|
|
- about:blank
|
|
|
|
Scenario: Opening in a new window
|
|
Given I open about:blank
|
|
When I run :tab-only
|
|
And I run :open -w http://localhost:(port)/data/numbers/9.txt
|
|
And I wait until data/numbers/9.txt is loaded
|
|
Then the session should look like:
|
|
windows:
|
|
- tabs:
|
|
- active: true
|
|
history:
|
|
- active: true
|
|
url: about:blank
|
|
- tabs:
|
|
- active: true
|
|
history:
|
|
- active: true
|
|
url: http://localhost:*/data/numbers/9.txt
|
|
|
|
Scenario: Opening a quickmark
|
|
When I run :quickmark-add http://localhost:(port)/data/numbers/10.txt quickmarktest
|
|
And I run :open quickmarktest
|
|
Then data/numbers/10.txt should be loaded
|