2015-11-09 18:17:13 +01:00
|
|
|
Feature: Using hints
|
|
|
|
|
|
|
|
Scenario: Using :follow-hint outside of hint mode (issue 1105)
|
|
|
|
When I run :follow-hint
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "follow-hint: This command is only allowed in hint mode." should be shown
|
2015-11-09 18:17:13 +01:00
|
|
|
|
|
|
|
Scenario: Using :follow-hint with an invalid index.
|
2016-02-23 18:14:37 +01:00
|
|
|
When I open data/hints/html/simple.html
|
2015-11-09 18:17:13 +01:00
|
|
|
And I run :hint links normal
|
|
|
|
And I run :follow-hint xyz
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "No hint xyz!" should be shown
|
2016-03-30 19:48:47 +02:00
|
|
|
|
2016-04-15 22:37:47 +02:00
|
|
|
### Opening in current or new tab
|
|
|
|
|
2016-03-30 19:48:47 +02:00
|
|
|
Scenario: Following a hint and force to open in current tab.
|
2016-03-30 23:53:18 +02:00
|
|
|
When I open data/hints/link_blank.html
|
2016-03-30 19:48:47 +02:00
|
|
|
And I run :hint links current
|
|
|
|
And I run :follow-hint a
|
|
|
|
And I wait until data/hello.txt is loaded
|
|
|
|
Then the following tabs should be open:
|
|
|
|
- data/hello.txt (active)
|
|
|
|
|
|
|
|
Scenario: Following a hint and allow to open in new tab.
|
|
|
|
When I open data/hints/link_blank.html
|
|
|
|
And I run :hint links normal
|
|
|
|
And I run :follow-hint a
|
|
|
|
And I wait until data/hello.txt is loaded
|
|
|
|
Then the following tabs should be open:
|
|
|
|
- data/hints/link_blank.html
|
|
|
|
- data/hello.txt (active)
|
2016-03-30 23:53:18 +02:00
|
|
|
|
|
|
|
Scenario: Following a hint to link with sub-element and force to open in current tab.
|
|
|
|
When I open data/hints/link_span.html
|
|
|
|
And I run :tab-close
|
|
|
|
And I run :hint links current
|
|
|
|
And I run :follow-hint a
|
|
|
|
And I wait until data/hello.txt is loaded
|
|
|
|
Then the following tabs should be open:
|
|
|
|
- data/hello.txt (active)
|
2016-04-10 20:30:26 +02:00
|
|
|
|
2016-04-30 14:28:58 +02:00
|
|
|
Scenario: Entering and leaving hinting mode (issue 1464)
|
2016-05-20 17:21:05 +02:00
|
|
|
When I open data/hints/html/simple.html
|
2016-04-30 14:28:58 +02:00
|
|
|
And I run :hint
|
|
|
|
And I run :fake-key -g <Esc>
|
|
|
|
Then no crash should happen
|
|
|
|
|
2016-05-20 02:37:57 +02:00
|
|
|
Scenario: Using :hint spawn with flags and -- (issue 797)
|
2016-05-21 13:48:52 +02:00
|
|
|
When I open data/hints/html/simple.html
|
2016-05-20 02:37:57 +02:00
|
|
|
And I run :hint -- all spawn -v echo
|
|
|
|
And I run :follow-hint a
|
|
|
|
Then the message "Command exited successfully." should be shown
|
|
|
|
|
2016-04-10 20:30:26 +02:00
|
|
|
Scenario: Using :hint spawn with flags (issue 797)
|
2016-04-15 23:19:08 +02:00
|
|
|
When I open data/hints/html/simple.html
|
2016-04-10 20:30:26 +02:00
|
|
|
And I run :hint all spawn -v echo
|
|
|
|
And I run :follow-hint a
|
2016-05-20 02:42:22 +02:00
|
|
|
Then the message "Command exited successfully." should be shown
|
2016-05-08 21:59:25 +02:00
|
|
|
|
2016-05-21 13:48:52 +02:00
|
|
|
Scenario: Using :hint spawn with flags and --rapid (issue 797)
|
|
|
|
When I open data/hints/html/simple.html
|
|
|
|
And I run :hint --rapid all spawn -v echo
|
|
|
|
And I run :follow-hint a
|
|
|
|
Then the message "Command exited successfully." should be shown
|
|
|
|
|
2016-05-30 16:18:03 +02:00
|
|
|
@posix
|
|
|
|
Scenario: Using :hint spawn with flags passed to the command (issue 797)
|
|
|
|
When I open data/hints/html/simple.html
|
|
|
|
And I run :hint --rapid all spawn -v echo -e foo
|
|
|
|
And I run :follow-hint a
|
|
|
|
Then the message "Command exited successfully." should be shown
|
|
|
|
|
2016-05-21 13:48:52 +02:00
|
|
|
Scenario: Using :hint run
|
|
|
|
When I open data/hints/html/simple.html
|
|
|
|
And I run :hint all run message-info {hint-url}
|
|
|
|
And I run :follow-hint a
|
|
|
|
Then the message "http://localhost:(port)/data/hello.txt" should be shown
|
|
|
|
|
|
|
|
Scenario: Using :hint fill
|
|
|
|
When I open data/hints/html/simple.html
|
|
|
|
And I run :hint all fill :message-info {hint-url}
|
|
|
|
And I run :follow-hint a
|
|
|
|
And I press the key "<Enter>"
|
|
|
|
Then the message "http://localhost:(port)/data/hello.txt" should be shown
|
|
|
|
|
2016-05-25 02:25:34 +02:00
|
|
|
@posix
|
|
|
|
Scenario: Using :hint userscript
|
|
|
|
When I open data/hints/html/simple.html
|
|
|
|
And I run :hint all userscript (testdata)/userscripts/echo_hint_text
|
|
|
|
And I run :follow-hint a
|
|
|
|
Then the message "Follow me!" should be shown
|
2016-05-08 21:59:25 +02:00
|
|
|
|
|
|
|
Scenario: Yanking to primary selection without it being supported (#1336)
|
|
|
|
When selection is not supported
|
|
|
|
And I run :debug-set-fake-clipboard
|
2016-05-20 17:21:05 +02:00
|
|
|
And I open data/hints/html/simple.html
|
2016-05-08 21:59:25 +02:00
|
|
|
And I run :hint links yank-primary
|
|
|
|
And I run :follow-hint a
|
|
|
|
Then the clipboard should contain "http://localhost:(port)/data/hello.txt"
|
2016-05-20 17:09:16 +02:00
|
|
|
|
2016-06-04 02:38:46 +02:00
|
|
|
Scenario: Using hint --rapid to hit multiple buttons
|
|
|
|
When I open data/hints/buttons.html
|
|
|
|
And I run :hint --rapid
|
|
|
|
And I run :follow-hint s
|
|
|
|
And I run :follow-hint d
|
|
|
|
And I run :follow-hint f
|
|
|
|
Then the javascript message "beep!" should be logged
|
|
|
|
And the javascript message "bop!" should be logged
|
|
|
|
And the javascript message "boop!" should be logged
|
|
|
|
|
2016-06-09 10:48:01 +02:00
|
|
|
Scenario: Using :hint run with an URL containing spaces
|
|
|
|
When I open data/hints/html/with_spaces.html
|
|
|
|
And I run :hint all run message-info {hint-url}
|
|
|
|
And I run :follow-hint a
|
|
|
|
Then the message "http://localhost:(port)/data/hello.txt" should be shown
|
|
|
|
|
2016-06-09 17:43:33 +02:00
|
|
|
Scenario: Clicking an invalid link
|
|
|
|
When I open data/invalid_link.html
|
|
|
|
And I run :hint all
|
|
|
|
And I run :follow-hint a
|
|
|
|
Then the error "Invalid link clicked - *" should be shown
|
|
|
|
|
2016-02-24 23:15:13 +01:00
|
|
|
### iframes
|
|
|
|
|
|
|
|
Scenario: Using :follow-hint inside an iframe
|
|
|
|
When I open data/hints/iframe.html
|
|
|
|
And I run :hint links normal
|
|
|
|
And I run :follow-hint a
|
2016-03-16 20:59:46 +01:00
|
|
|
Then "acceptNavigationRequest, url http://localhost:*/data/hello.txt, type NavigationTypeLinkClicked, *" should be logged
|
2016-02-24 23:15:13 +01:00
|
|
|
|
2016-06-06 17:26:09 +02:00
|
|
|
### FIXME currenly skipped, see https://github.com/The-Compiler/qutebrowser/issues/1525
|
2016-05-24 22:23:42 +02:00
|
|
|
@xfail_norun
|
2016-02-24 23:15:13 +01:00
|
|
|
Scenario: Using :follow-hint inside a scrolled iframe
|
|
|
|
When I open data/hints/iframe_scroll.html
|
|
|
|
And I run :hint all normal
|
|
|
|
And I run :follow-hint a
|
|
|
|
And I run :scroll bottom
|
|
|
|
And I run :hint links normal
|
|
|
|
And I run :follow-hint a
|
2016-03-16 20:59:46 +01:00
|
|
|
Then "acceptNavigationRequest, url http://localhost:*/data/hello2.txt, type NavigationTypeLinkClicked, *" should be logged
|
2016-03-16 21:47:58 +01:00
|
|
|
|
|
|
|
Scenario: Opening a link inside a specific iframe
|
|
|
|
When I open data/hints/iframe_target.html
|
|
|
|
And I run :hint links normal
|
|
|
|
And I run :follow-hint a
|
|
|
|
Then "acceptNavigationRequest, url http://localhost:*/data/hello.txt, type NavigationTypeLinkClicked, *" should be logged
|
|
|
|
|
|
|
|
Scenario: Opening a link with specific target frame in a new tab
|
|
|
|
When I open data/hints/iframe_target.html
|
|
|
|
And I run :hint links tab
|
|
|
|
And I run :follow-hint a
|
2016-06-06 18:26:04 +02:00
|
|
|
And I wait until data/hello.txt is loaded
|
2016-03-16 21:47:58 +01:00
|
|
|
Then the following tabs should be open:
|
|
|
|
- data/hints/iframe_target.html
|
|
|
|
- data/hello.txt (active)
|
2016-06-07 11:06:39 +02:00
|
|
|
|
|
|
|
### hints -> auto-follow-timeout
|
|
|
|
|
|
|
|
Scenario: Ignoring key presses after auto-following hints
|
|
|
|
When I set hints -> auto-follow-timeout to 200
|
|
|
|
And I set hints -> mode to number
|
|
|
|
And I run :bind --force , message-error "This should not happen"
|
|
|
|
And I open data/hints/html/simple.html
|
|
|
|
And I run :hint all
|
|
|
|
And I press the key "f"
|
|
|
|
And I wait until data/hello.txt is loaded
|
|
|
|
And I press the key ","
|
|
|
|
# Waiting here so we don't affect the next test
|
|
|
|
And I wait for "Releasing inhibition state of normal mode." in the log
|
|
|
|
Then "Ignoring key ',', because the normal mode is currently inhibited." should be logged
|
|
|
|
|
|
|
|
Scenario: Turning off auto-follow-timeout
|
|
|
|
When I set hints -> auto-follow-timeout to 0
|
|
|
|
And I set hints -> mode to number
|
|
|
|
And I run :bind --force , message-info "Keypress worked!"
|
|
|
|
And I open data/hints/html/simple.html
|
|
|
|
And I run :hint all
|
|
|
|
And I press the key "f"
|
|
|
|
And I wait until data/hello.txt is loaded
|
|
|
|
And I press the key ","
|
|
|
|
Then the message "Keypress worked!" should be shown
|
2016-06-07 13:26:40 +02:00
|
|
|
|
|
|
|
### Number hint mode
|
|
|
|
|
|
|
|
# https://github.com/The-Compiler/qutebrowser/issues/308
|
|
|
|
Scenario: Renumbering hints when filtering
|
|
|
|
When I open data/hints/number.html
|
|
|
|
And I set hints -> mode to number
|
|
|
|
And I run :hint all
|
|
|
|
And I press the key "s"
|
|
|
|
And I run :follow-hint 1
|
|
|
|
Then data/numbers/7.txt should be loaded
|
2016-06-07 13:56:27 +02:00
|
|
|
|
|
|
|
# https://github.com/The-Compiler/qutebrowser/issues/576
|
|
|
|
Scenario: Keeping hint filter in rapid mode
|
|
|
|
When I open data/hints/number.html
|
|
|
|
And I set hints -> mode to number
|
|
|
|
And I run :hint all tab-bg --rapid
|
|
|
|
And I press the key "t"
|
|
|
|
And I run :follow-hint 0
|
|
|
|
And I run :follow-hint 1
|
|
|
|
Then data/numbers/2.txt should be loaded
|
|
|
|
And data/numbers/3.txt should be loaded
|
2016-06-07 14:15:32 +02:00
|
|
|
|
|
|
|
# https://github.com/The-Compiler/qutebrowser/issues/1186
|
|
|
|
Scenario: Keeping hints filter when using backspace
|
|
|
|
When I open data/hints/issue1186.html
|
|
|
|
And I set hints -> mode to number
|
|
|
|
And I run :hint all
|
|
|
|
And I press the key "x"
|
|
|
|
And I press the key "0"
|
|
|
|
And I press the key "<Backspace>"
|
|
|
|
And I run :follow-hint 11
|
|
|
|
Then the error "No hint 11!" should be shown
|
2016-06-07 14:24:53 +02:00
|
|
|
|
|
|
|
# https://github.com/The-Compiler/qutebrowser/issues/674#issuecomment-165096744
|
|
|
|
Scenario: Multi-word matching
|
|
|
|
When I open data/hints/number.html
|
|
|
|
And I set hints -> mode to number
|
|
|
|
And I set hints -> auto-follow to true
|
|
|
|
And I set hints -> auto-follow-timeout to 0
|
|
|
|
And I run :hint all
|
|
|
|
And I press the keys "ten pos"
|
|
|
|
Then data/numbers/11.txt should be loaded
|
2016-06-07 15:13:30 +02:00
|
|
|
|
|
|
|
Scenario: Scattering is ignored with number hints
|
|
|
|
When I open data/hints/number.html
|
|
|
|
And I set hints -> mode to number
|
|
|
|
And I set hints -> scatter to true
|
|
|
|
And I run :hint all
|
|
|
|
And I run :follow-hint 00
|
|
|
|
Then data/numbers/1.txt should be loaded
|
2016-06-07 18:34:46 +02:00
|
|
|
|
|
|
|
# https://github.com/The-Compiler/qutebrowser/issues/1559
|
|
|
|
Scenario: Filtering all hints in number mode
|
2016-06-09 17:11:44 +02:00
|
|
|
When I open data/hints/number.html
|
|
|
|
And I set hints -> mode to number
|
|
|
|
And I run :hint all
|
|
|
|
And I press the key "2"
|
|
|
|
And I wait for "Leaving mode KeyMode.hint (reason: all filtered)" in the log
|
|
|
|
Then no crash should happen
|