2017-03-31 17:16:31 +02:00
|
|
|
# vim: ft=cucumber fileencoding=utf-8 sts=4 sw=4 et:
|
|
|
|
|
2015-11-26 23:42:43 +01:00
|
|
|
Feature: Caret mode
|
|
|
|
In caret mode, the user can select and yank text using the keyboard.
|
|
|
|
|
|
|
|
Background:
|
|
|
|
Given I open data/caret.html
|
2016-09-30 22:55:51 +02:00
|
|
|
And I run :tab-only ;; enter-mode caret
|
2015-11-26 23:42:43 +01:00
|
|
|
|
|
|
|
# document
|
|
|
|
|
|
|
|
Scenario: Selecting the entire document
|
|
|
|
When I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-document
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain:
|
|
|
|
one two three
|
|
|
|
eins zwei drei
|
|
|
|
|
|
|
|
four five six
|
|
|
|
vier fünf sechs
|
|
|
|
|
|
|
|
Scenario: Moving to end and to start of document
|
|
|
|
When I run :move-to-end-of-document
|
|
|
|
And I run :move-to-start-of-document
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-word
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "one"
|
|
|
|
|
|
|
|
Scenario: Moving to end and to start of document (with selection)
|
|
|
|
When I run :move-to-end-of-document
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-start-of-document
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain:
|
|
|
|
one two three
|
|
|
|
eins zwei drei
|
|
|
|
|
|
|
|
four five six
|
|
|
|
vier fünf sechs
|
|
|
|
|
|
|
|
# block
|
|
|
|
|
|
|
|
Scenario: Selecting a block
|
|
|
|
When I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-next-block
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain:
|
|
|
|
one two three
|
|
|
|
eins zwei drei
|
|
|
|
|
|
|
|
Scenario: Moving back to the end of previous block (with selection)
|
|
|
|
When I run :move-to-end-of-next-block with count 2
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-prev-block
|
|
|
|
And I run :move-to-prev-word
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain:
|
|
|
|
drei
|
|
|
|
|
|
|
|
four five six
|
|
|
|
|
|
|
|
Scenario: Moving back to the end of previous block
|
|
|
|
When I run :move-to-end-of-next-block with count 2
|
|
|
|
And I run :move-to-end-of-prev-block
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-prev-word
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "drei"
|
|
|
|
|
|
|
|
Scenario: Moving back to the start of previous block (with selection)
|
|
|
|
When I run :move-to-end-of-next-block with count 2
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-start-of-prev-block
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain:
|
|
|
|
eins zwei drei
|
|
|
|
|
|
|
|
four five six
|
|
|
|
|
|
|
|
Scenario: Moving back to the start of previous block
|
|
|
|
When I run :move-to-end-of-next-block with count 2
|
|
|
|
And I run :move-to-start-of-prev-block
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-next-word
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "eins "
|
|
|
|
|
|
|
|
Scenario: Moving to the start of next block (with selection)
|
|
|
|
When I run :toggle-selection
|
|
|
|
And I run :move-to-start-of-next-block
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "one two three\n"
|
|
|
|
|
|
|
|
Scenario: Moving to the start of next block
|
|
|
|
When I run :move-to-start-of-next-block
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-word
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "eins"
|
|
|
|
|
|
|
|
# line
|
|
|
|
|
|
|
|
Scenario: Selecting a line
|
|
|
|
When I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-line
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "one two three"
|
|
|
|
|
|
|
|
Scenario: Moving and selecting a line
|
|
|
|
When I run :move-to-next-line
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-line
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "eins zwei drei"
|
|
|
|
|
|
|
|
Scenario: Selecting next line
|
|
|
|
When I run :toggle-selection
|
|
|
|
And I run :move-to-next-line
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "one two three\n"
|
|
|
|
|
|
|
|
Scenario: Moving to end and to start of line
|
|
|
|
When I run :move-to-end-of-line
|
|
|
|
And I run :move-to-start-of-line
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-word
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "one"
|
|
|
|
|
|
|
|
Scenario: Selecting a line (backwards)
|
|
|
|
When I run :move-to-end-of-line
|
|
|
|
And I run :toggle-selection
|
|
|
|
When I run :move-to-start-of-line
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "one two three"
|
|
|
|
|
|
|
|
Scenario: Selecting previous line
|
|
|
|
When I run :move-to-next-line
|
|
|
|
And I run :toggle-selection
|
|
|
|
When I run :move-to-prev-line
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "one two three\n"
|
|
|
|
|
|
|
|
Scenario: Moving to previous line
|
|
|
|
When I run :move-to-next-line
|
|
|
|
When I run :move-to-prev-line
|
|
|
|
And I run :toggle-selection
|
|
|
|
When I run :move-to-next-line
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "one two three\n"
|
|
|
|
|
|
|
|
# word
|
|
|
|
|
|
|
|
Scenario: Selecting a word
|
|
|
|
When I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-word
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "one"
|
|
|
|
|
|
|
|
Scenario: Moving to end and selecting a word
|
|
|
|
When I run :move-to-end-of-word
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-word
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain " two"
|
|
|
|
|
|
|
|
Scenario: Moving to next word and selecting a word
|
|
|
|
When I run :move-to-next-word
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-word
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "two"
|
|
|
|
|
|
|
|
Scenario: Moving to next word and selecting until next word
|
|
|
|
When I run :move-to-next-word
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-next-word
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "two "
|
|
|
|
|
|
|
|
Scenario: Moving to previous word and selecting a word
|
|
|
|
When I run :move-to-end-of-word
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-prev-word
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "one"
|
|
|
|
|
|
|
|
Scenario: Moving to previous word
|
|
|
|
When I run :move-to-end-of-word
|
|
|
|
And I run :move-to-prev-word
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-word
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "one"
|
|
|
|
|
|
|
|
# char
|
|
|
|
|
|
|
|
Scenario: Selecting a char
|
|
|
|
When I run :toggle-selection
|
|
|
|
And I run :move-to-next-char
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "o"
|
|
|
|
|
|
|
|
Scenario: Moving and selecting a char
|
|
|
|
When I run :move-to-next-char
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-next-char
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "n"
|
|
|
|
|
|
|
|
Scenario: Selecting previous char
|
|
|
|
When I run :move-to-end-of-word
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-prev-char
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "e"
|
|
|
|
|
|
|
|
Scenario: Moving to previous char
|
|
|
|
When I run :move-to-end-of-word
|
|
|
|
And I run :move-to-prev-char
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-word
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the clipboard should contain "e"
|
|
|
|
|
2016-08-06 03:55:51 +02:00
|
|
|
# :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
|
2016-08-06 03:55:51 +02:00
|
|
|
Scenario: :yank selection without selection
|
|
|
|
When I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the message "Nothing to yank" should be shown.
|
|
|
|
|
2016-08-06 03:55:51 +02:00
|
|
|
Scenario: :yank selection message
|
2015-11-26 23:42:43 +01:00
|
|
|
When I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-word
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the message "3 chars yanked to clipboard" should be shown.
|
|
|
|
|
2016-08-06 03:55:51 +02:00
|
|
|
Scenario: :yank selection message with one char
|
2015-11-26 23:42:43 +01:00
|
|
|
When I run :toggle-selection
|
|
|
|
And I run :move-to-next-char
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the message "1 char yanked to clipboard" should be shown.
|
|
|
|
|
2016-08-06 03:55:51 +02:00
|
|
|
Scenario: :yank selection with primary selection
|
2015-11-26 23:42:43 +01:00
|
|
|
When selection is supported
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-word
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection --sel
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the message "3 chars yanked to primary selection" should be shown.
|
|
|
|
And the primary selection should contain "one"
|
|
|
|
|
2016-08-06 03:55:51 +02:00
|
|
|
Scenario: :yank selection with --keep
|
2015-11-26 23:42:43 +01:00
|
|
|
When I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-word
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection --keep
|
2015-11-26 23:42:43 +01:00
|
|
|
And I run :move-to-end-of-word
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection --keep
|
2015-11-26 23:42:43 +01:00
|
|
|
Then the message "3 chars yanked to clipboard" should be shown.
|
|
|
|
And the message "7 chars yanked to clipboard" should be shown.
|
|
|
|
And the clipboard should contain "one two"
|
2016-01-06 22:13:09 +01:00
|
|
|
|
|
|
|
# :drop-selection
|
|
|
|
|
|
|
|
Scenario: :drop-selection
|
|
|
|
When I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-word
|
|
|
|
And I run :drop-selection
|
2016-08-06 03:55:51 +02:00
|
|
|
And I run :yank selection
|
2016-01-06 22:13:09 +01:00
|
|
|
Then the message "Nothing to yank" should be shown.
|
2016-01-06 22:59:42 +01:00
|
|
|
|
|
|
|
# :follow-selected
|
|
|
|
|
|
|
|
Scenario: :follow-selected without a selection
|
|
|
|
When I run :follow-selected
|
|
|
|
Then no crash should happen
|
|
|
|
|
|
|
|
Scenario: :follow-selected with text
|
|
|
|
When I run :move-to-next-word
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-word
|
|
|
|
And I run :follow-selected
|
|
|
|
Then no crash should happen
|
|
|
|
|
|
|
|
Scenario: :follow-selected with link (with JS)
|
2017-06-16 16:22:41 +02:00
|
|
|
When I set content.javascript.enabled to true
|
2016-01-06 22:59:42 +01:00
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-word
|
|
|
|
And I run :follow-selected
|
|
|
|
Then data/hello.txt should be loaded
|
|
|
|
|
|
|
|
Scenario: :follow-selected with link (without JS)
|
2017-06-16 16:22:41 +02:00
|
|
|
When I set content.javascript.enabled to false
|
2016-01-06 22:59:42 +01:00
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-word
|
|
|
|
And I run :follow-selected
|
|
|
|
Then data/hello.txt should be loaded
|
2016-01-06 23:22:18 +01:00
|
|
|
|
2016-01-06 23:29:16 +01:00
|
|
|
Scenario: :follow-selected with --tab (with JS)
|
2017-06-16 16:22:41 +02:00
|
|
|
When I set content.javascript.enabled to true
|
2016-01-06 23:29:16 +01:00
|
|
|
And I run :tab-only
|
|
|
|
And I run :enter-mode caret
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-word
|
|
|
|
And I run :follow-selected --tab
|
|
|
|
Then data/hello.txt should be loaded
|
|
|
|
And the following tabs should be open:
|
|
|
|
- data/caret.html
|
|
|
|
- data/hello.txt (active)
|
|
|
|
|
|
|
|
Scenario: :follow-selected with --tab (without JS)
|
2017-06-16 16:22:41 +02:00
|
|
|
When I set content.javascript.enabled to false
|
2016-01-06 23:29:16 +01:00
|
|
|
And I run :tab-only
|
2016-01-06 23:22:18 +01:00
|
|
|
And I run :enter-mode caret
|
|
|
|
And I run :toggle-selection
|
|
|
|
And I run :move-to-end-of-word
|
|
|
|
And I run :follow-selected --tab
|
|
|
|
Then data/hello.txt should be loaded
|
|
|
|
And the following tabs should be open:
|
|
|
|
- data/caret.html
|
|
|
|
- data/hello.txt (active)
|
2018-02-22 04:15:26 +01:00
|
|
|
|
2018-07-28 09:52:45 +02:00
|
|
|
@flaky
|
2018-05-25 21:37:30 +02:00
|
|
|
Scenario: :follow-selected with link tabbing (without JS)
|
|
|
|
When I set content.javascript.enabled to false
|
2018-06-09 21:11:22 +02:00
|
|
|
And I run :leave-mode
|
|
|
|
And I run :jseval document.activeElement.blur();
|
2018-05-25 21:37:30 +02:00
|
|
|
And I run :fake-key <tab>
|
|
|
|
And I run :follow-selected
|
|
|
|
Then data/hello.txt should be loaded
|
|
|
|
|
|
|
|
Scenario: :follow-selected with link tabbing (with JS)
|
|
|
|
When I set content.javascript.enabled to true
|
2018-06-09 21:11:22 +02:00
|
|
|
And I run :leave-mode
|
|
|
|
And I run :jseval document.activeElement.blur();
|
2018-05-25 21:37:30 +02:00
|
|
|
And I run :fake-key <tab>
|
|
|
|
And I run :follow-selected
|
|
|
|
Then data/hello.txt should be loaded
|
|
|
|
|
|
|
|
Scenario: :follow-selected with link tabbing in a tab (without JS)
|
|
|
|
When I set content.javascript.enabled to false
|
2018-06-09 21:11:22 +02:00
|
|
|
And I run :leave-mode
|
|
|
|
And I run :jseval document.activeElement.blur();
|
2018-05-25 21:37:30 +02:00
|
|
|
And I run :fake-key <tab>
|
|
|
|
And I run :follow-selected --tab
|
|
|
|
Then data/hello.txt should be loaded
|
|
|
|
|
2018-07-24 19:56:34 +02:00
|
|
|
@flaky
|
2018-05-25 21:37:30 +02:00
|
|
|
Scenario: :follow-selected with link tabbing in a tab (with JS)
|
|
|
|
When I set content.javascript.enabled to true
|
2018-06-09 21:11:22 +02:00
|
|
|
And I run :leave-mode
|
|
|
|
And I run :jseval document.activeElement.blur();
|
2018-05-25 21:37:30 +02:00
|
|
|
And I run :fake-key <tab>
|
|
|
|
And I run :follow-selected --tab
|
|
|
|
Then data/hello.txt should be loaded
|
|
|
|
|
2018-02-22 04:15:26 +01:00
|
|
|
# Search + caret mode
|
|
|
|
|
2018-02-23 00:33:46 +01:00
|
|
|
# https://bugreports.qt.io/browse/QTBUG-60673
|
2018-02-26 01:00:15 +01:00
|
|
|
@qtbug60673
|
2018-02-22 04:15:26 +01:00
|
|
|
Scenario: yanking a searched line
|
|
|
|
When I run :leave-mode
|
|
|
|
And I run :search fiv
|
|
|
|
And I wait for "search found fiv" in the log
|
|
|
|
And I run :enter-mode caret
|
|
|
|
And I run :move-to-end-of-line
|
|
|
|
And I run :yank selection
|
|
|
|
Then the clipboard should contain "five six"
|
|
|
|
|
2018-02-26 01:00:15 +01:00
|
|
|
@qtbug60673
|
2018-02-22 04:15:26 +01:00
|
|
|
Scenario: yanking a searched line with multiple matches
|
|
|
|
When I run :leave-mode
|
|
|
|
And I run :search w
|
|
|
|
And I wait for "search found w" in the log
|
|
|
|
And I run :search-next
|
|
|
|
And I wait for "next_result found w" in the log
|
|
|
|
And I run :enter-mode caret
|
|
|
|
And I run :move-to-end-of-line
|
|
|
|
And I run :yank selection
|
|
|
|
Then the clipboard should contain "wei drei"
|