2015-11-02 07:43:37 +01:00
|
|
|
Feature: Yanking and pasting.
|
|
|
|
:yank and :paste can be used to copy/paste the URL or title from/to the
|
|
|
|
clipboard and primary selection.
|
|
|
|
|
|
|
|
Background:
|
2015-11-12 21:52:39 +01:00
|
|
|
Given I run :tab-only
|
|
|
|
|
|
|
|
#### :yank
|
2015-11-02 07:43:37 +01:00
|
|
|
|
|
|
|
Scenario: Yanking URLs to clipboard
|
2015-11-26 18:37:33 +01:00
|
|
|
When I open data/title.html
|
2015-11-12 21:52:39 +01:00
|
|
|
And I run :yank
|
2015-11-26 18:37:33 +01:00
|
|
|
Then the message "Yanked URL to clipboard: http://localhost:(port)/data/title.html" should be shown
|
|
|
|
And the clipboard should contain "http://localhost:(port)/data/title.html"
|
2015-11-02 07:43:37 +01:00
|
|
|
|
|
|
|
Scenario: Yanking URLs to primary selection
|
2015-11-02 08:07:25 +01:00
|
|
|
When selection is supported
|
2015-11-26 18:37:33 +01:00
|
|
|
And I open data/title.html
|
2015-11-02 08:07:25 +01:00
|
|
|
And I run :yank --sel
|
2015-11-26 18:37:33 +01:00
|
|
|
Then the message "Yanked URL to primary selection: http://localhost:(port)/data/title.html" should be shown
|
|
|
|
And the primary selection should contain "http://localhost:(port)/data/title.html"
|
2015-11-02 07:43:37 +01:00
|
|
|
|
|
|
|
Scenario: Yanking title to clipboard
|
2015-11-26 18:37:33 +01:00
|
|
|
When I open data/title.html
|
2015-11-12 21:52:39 +01:00
|
|
|
And I wait for regex "Changing title for idx \d to 'Test title'" in the log
|
2015-11-05 08:03:03 +01:00
|
|
|
And I run :yank --title
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the message "Yanked title to clipboard: Test title" should be shown
|
2015-11-02 07:43:37 +01:00
|
|
|
And the clipboard should contain "Test title"
|
|
|
|
|
|
|
|
Scenario: Yanking domain to clipboard
|
2015-11-26 18:37:33 +01:00
|
|
|
When I open data/title.html
|
2015-11-12 21:52:39 +01:00
|
|
|
And I run :yank --domain
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the message "Yanked domain to clipboard: http://localhost:(port)" should be shown
|
2015-11-02 07:43:37 +01:00
|
|
|
And the clipboard should contain "http://localhost:(port)"
|
2015-11-11 22:38:43 +01:00
|
|
|
|
2015-11-12 21:52:39 +01:00
|
|
|
#### :paste
|
|
|
|
|
2015-11-11 22:38:43 +01:00
|
|
|
Scenario: Pasting an URL
|
|
|
|
When I put "http://localhost:(port)/data/hello.txt" into the clipboard
|
|
|
|
And I run :paste
|
|
|
|
And I wait until data/hello.txt is loaded
|
|
|
|
Then the requests should be:
|
|
|
|
data/hello.txt
|
|
|
|
|
|
|
|
Scenario: Pasting an URL from primary selection
|
|
|
|
When selection is supported
|
|
|
|
And I put "http://localhost:(port)/data/hello2.txt" into the primary selection
|
|
|
|
And I run :paste --sel
|
|
|
|
And I wait until data/hello2.txt is loaded
|
|
|
|
Then the requests should be:
|
|
|
|
data/hello2.txt
|
2015-11-12 21:52:39 +01:00
|
|
|
|
|
|
|
Scenario: Pasting with empty clipboard
|
|
|
|
When I put "" into the clipboard
|
|
|
|
And I run :paste
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "Clipboard is empty." should be shown
|
2015-11-12 21:52:39 +01:00
|
|
|
|
|
|
|
Scenario: Pasting with empty selection
|
|
|
|
When selection is supported
|
|
|
|
And I put "" into the primary selection
|
|
|
|
And I run :paste --sel
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "Primary selection is empty." should be shown
|
2015-11-12 21:52:39 +01:00
|
|
|
|
|
|
|
Scenario: Pasting in a new tab
|
|
|
|
Given I open about:blank
|
|
|
|
When I run :tab-only
|
|
|
|
And I put "http://localhost:(port)/data/hello.txt" into the clipboard
|
|
|
|
And I run :paste -t
|
|
|
|
And I wait until data/hello.txt is loaded
|
2015-11-26 01:33:56 +01:00
|
|
|
Then the following tabs should be open:
|
|
|
|
- about:blank
|
|
|
|
- data/hello.txt (active)
|
2015-11-12 21:52:39 +01:00
|
|
|
|
|
|
|
Scenario: Pasting in a background tab
|
|
|
|
Given I open about:blank
|
|
|
|
When I run :tab-only
|
|
|
|
And I put "http://localhost:(port)/data/hello.txt" into the clipboard
|
|
|
|
And I run :paste -b
|
|
|
|
And I wait until data/hello.txt is loaded
|
2015-11-26 01:33:56 +01:00
|
|
|
Then the following tabs should be open:
|
|
|
|
- about:blank (active)
|
|
|
|
- data/hello.txt
|
2015-11-12 21:52:39 +01:00
|
|
|
|
|
|
|
Scenario: Pasting in a new window
|
|
|
|
Given I have a fresh instance
|
|
|
|
When I put "http://localhost:(port)/data/hello.txt" into the clipboard
|
|
|
|
And I run :paste -w
|
|
|
|
And I wait until data/hello.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/hello.txt
|
2016-01-06 22:07:19 +01:00
|
|
|
|
|
|
|
Scenario: Pasting an invalid URL
|
|
|
|
When I set general -> auto-search to false
|
|
|
|
And I put "foo bar" into the clipboard
|
|
|
|
And I run :paste
|
|
|
|
Then the error "Invalid URL" should be shown
|
2016-01-09 11:32:12 +01:00
|
|
|
|
|
|
|
Scenario: Pasting multiple urls in a new tab
|
|
|
|
Given I have a fresh instance
|
2016-01-12 11:25:14 +01:00
|
|
|
When I put the following lines into the clipboard:
|
|
|
|
http://localhost:(port)/data/hello.txt
|
|
|
|
http://localhost:(port)/data/hello2.txt
|
|
|
|
http://localhost:(port)/data/hello3.txt
|
2016-01-09 11:32:12 +01:00
|
|
|
And I run :paste -t
|
|
|
|
And I wait until data/hello.txt is loaded
|
|
|
|
And I wait until data/hello2.txt is loaded
|
|
|
|
And I wait until data/hello3.txt is loaded
|
|
|
|
Then the following tabs should be open:
|
|
|
|
- about:blank
|
|
|
|
- data/hello.txt (active)
|
|
|
|
- data/hello2.txt
|
|
|
|
- data/hello3.txt
|
|
|
|
|
|
|
|
Scenario: Pasting multiple urls in a background tab
|
|
|
|
Given I open about:blank
|
|
|
|
When I run :tab-only
|
2016-01-12 09:59:03 +01:00
|
|
|
And I put the following lines into the clipboard:
|
2016-01-12 11:25:14 +01:00
|
|
|
http://localhost:(port)/data/hello.txt
|
|
|
|
http://localhost:(port)/data/hello2.txt
|
|
|
|
http://localhost:(port)/data/hello3.txt
|
2016-01-09 11:32:12 +01:00
|
|
|
And I run :paste -b
|
|
|
|
And I wait until data/hello.txt is loaded
|
|
|
|
And I wait until data/hello2.txt is loaded
|
|
|
|
And I wait until data/hello3.txt is loaded
|
|
|
|
Then the following tabs should be open:
|
|
|
|
- about:blank (active)
|
|
|
|
- data/hello.txt
|
|
|
|
- data/hello2.txt
|
|
|
|
- data/hello3.txt
|
|
|
|
|
|
|
|
Scenario: Pasting multiple urls in new windows
|
|
|
|
Given I have a fresh instance
|
2016-01-12 09:59:03 +01:00
|
|
|
When I put the following lines into the clipboard:
|
2016-01-12 11:25:14 +01:00
|
|
|
http://localhost:(port)/data/hello.txt
|
|
|
|
http://localhost:(port)/data/hello2.txt
|
|
|
|
http://localhost:(port)/data/hello3.txt
|
2016-01-09 11:32:12 +01:00
|
|
|
And I run :paste -w
|
|
|
|
And I wait until data/hello.txt is loaded
|
|
|
|
And I wait until data/hello2.txt is loaded
|
|
|
|
And I wait until data/hello3.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/hello.txt
|
|
|
|
- tabs:
|
|
|
|
- active: true
|
|
|
|
history:
|
|
|
|
- active: true
|
|
|
|
url: http://localhost:*/data/hello2.txt
|
|
|
|
- tabs:
|
|
|
|
- active: true
|
|
|
|
history:
|
|
|
|
- active: true
|
|
|
|
url: http://localhost:*/data/hello3.txt
|