2015-11-10 06:33:47 +01:00
|
|
|
Feature: Various utility commands.
|
|
|
|
|
2015-11-13 23:43:28 +01:00
|
|
|
## :set-cmd-text
|
|
|
|
|
2015-11-10 06:33:47 +01:00
|
|
|
Scenario: :set-cmd-text and :command-accept
|
|
|
|
When I run :set-cmd-text :message-info "Hello World"
|
|
|
|
And I run :command-accept
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the message "Hello World" should be shown
|
2015-11-10 06:33:47 +01:00
|
|
|
|
|
|
|
Scenario: :set-cmd-text with two commands
|
|
|
|
When I run :set-cmd-text :message-info test ;; message-error error
|
|
|
|
And I run :command-accept
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the message "test" should be shown
|
|
|
|
And the error "error" should be shown
|
2015-11-10 06:33:47 +01:00
|
|
|
|
2015-11-10 19:22:13 +01:00
|
|
|
Scenario: :set-cmd-text with URL replacement
|
|
|
|
When I open data/hello.txt
|
2016-05-14 17:44:05 +02:00
|
|
|
And I run :set-cmd-text :message-info {url}
|
2015-11-10 19:22:13 +01:00
|
|
|
And I run :command-accept
|
2016-05-12 17:46:46 +02:00
|
|
|
Then the message "http://localhost:*/hello.txt" should be shown
|
2015-11-10 19:22:13 +01:00
|
|
|
|
2016-05-14 17:44:05 +02:00
|
|
|
Scenario: :set-cmd-text with URL replacement with encoded spaces
|
|
|
|
When I open data/title with spaces.html
|
|
|
|
And I run :set-cmd-text :message-info {url}
|
|
|
|
And I run :command-accept
|
|
|
|
Then the message "http://localhost:*/title%20with%20spaces.html" should be shown
|
|
|
|
|
|
|
|
Scenario: :set-cmd-text with URL replacement with decoded spaces
|
|
|
|
When I open data/title with spaces.html
|
|
|
|
And I run :set-cmd-text :message-info "> {url:pretty} <"
|
|
|
|
And I run :command-accept
|
|
|
|
Then the message "> http://localhost:*/title with spaces.html <" should be shown
|
|
|
|
|
2015-11-10 19:22:13 +01:00
|
|
|
Scenario: :set-cmd-text with -s and -a
|
|
|
|
When I run :set-cmd-text -s :message-info "foo
|
|
|
|
And I run :set-cmd-text -a bar"
|
|
|
|
And I run :command-accept
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the message "foo bar" should be shown
|
2015-11-10 19:22:13 +01:00
|
|
|
|
|
|
|
Scenario: :set-cmd-text with -a but without text
|
|
|
|
When I run :set-cmd-text -a foo
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "No current text!" should be shown
|
2015-11-10 19:22:13 +01:00
|
|
|
|
2015-11-10 06:33:47 +01:00
|
|
|
Scenario: :set-cmd-text with invalid command
|
|
|
|
When I run :set-cmd-text foo
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "Invalid command text 'foo'." should be shown
|
2015-11-10 06:33:47 +01:00
|
|
|
|
2015-11-13 23:43:28 +01:00
|
|
|
## :message-*
|
|
|
|
|
2015-11-10 06:33:47 +01:00
|
|
|
Scenario: :message-error
|
|
|
|
When I run :message-error "Hello World"
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "Hello World" should be shown
|
2015-11-10 06:33:47 +01:00
|
|
|
|
|
|
|
Scenario: :message-info
|
|
|
|
When I run :message-info "Hello World"
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the message "Hello World" should be shown
|
2015-11-10 06:33:47 +01:00
|
|
|
|
|
|
|
Scenario: :message-warning
|
|
|
|
When I run :message-warning "Hello World"
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the warning "Hello World" should be shown
|
2015-11-13 07:50:20 +01:00
|
|
|
|
2015-11-13 23:43:28 +01:00
|
|
|
## :jseval
|
|
|
|
|
2015-11-13 07:50:20 +01:00
|
|
|
Scenario: :jseval
|
2015-11-29 18:37:11 +01:00
|
|
|
When I set general -> log-javascript-console to info
|
2015-11-13 07:50:20 +01:00
|
|
|
And I run :jseval console.log("Hello from JS!");
|
|
|
|
And I wait for "[:0] Hello from JS!" in the log
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the message "No output or error" should be shown
|
2015-11-15 12:23:34 +01:00
|
|
|
|
|
|
|
Scenario: :jseval without logging
|
2015-11-29 18:37:11 +01:00
|
|
|
When I set general -> log-javascript-console to none
|
2015-11-15 12:23:34 +01:00
|
|
|
And I run :jseval console.log("Hello from JS!");
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the message "No output or error" should be shown
|
2015-11-15 12:23:34 +01:00
|
|
|
And "[:0] Hello from JS!" should not be logged
|
|
|
|
|
|
|
|
Scenario: :jseval with --quiet
|
2015-11-29 18:37:11 +01:00
|
|
|
When I set general -> log-javascript-console to info
|
2015-11-15 12:23:34 +01:00
|
|
|
And I run :jseval --quiet console.log("Hello from JS!");
|
|
|
|
And I wait for "[:0] Hello from JS!" in the log
|
|
|
|
Then "No output or error" should not be logged
|
|
|
|
|
|
|
|
Scenario: :jseval with a value
|
|
|
|
When I run :jseval "foo"
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the message "foo" should be shown
|
2015-11-15 12:23:34 +01:00
|
|
|
|
|
|
|
Scenario: :jseval with a long, truncated value
|
|
|
|
When I run :jseval Array(5002).join("x")
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the message "x* [...trimmed...]" should be shown
|
2015-11-15 12:23:54 +01:00
|
|
|
|
|
|
|
# :debug-webaction
|
|
|
|
|
|
|
|
Scenario: :debug-webaction with valid value
|
|
|
|
Given I open data/backforward/1.txt
|
|
|
|
When I open data/backforward/2.txt
|
|
|
|
And I run :tab-only
|
|
|
|
And I run :debug-webaction Back
|
|
|
|
And I wait until data/backforward/1.txt is loaded
|
|
|
|
Then the session should look like:
|
|
|
|
windows:
|
|
|
|
- tabs:
|
|
|
|
- history:
|
|
|
|
- active: true
|
|
|
|
url: http://localhost:*/data/backforward/1.txt
|
|
|
|
- url: http://localhost:*/data/backforward/2.txt
|
|
|
|
|
|
|
|
Scenario: :debug-webaction with invalid value
|
|
|
|
When I open data/hello.txt
|
|
|
|
And I run :debug-webaction blah
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "blah is not a valid web action!" should be shown
|
2015-11-15 12:23:54 +01:00
|
|
|
|
|
|
|
Scenario: :debug-webaction with non-webaction member
|
|
|
|
When I open data/hello.txt
|
|
|
|
And I run :debug-webaction PermissionUnknown
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "PermissionUnknown is not a valid web action!" should be shown
|
2015-11-18 20:08:25 +01:00
|
|
|
|
|
|
|
# :inspect
|
|
|
|
|
|
|
|
Scenario: Inspector without developer extras
|
|
|
|
When I set general -> developer-extras to false
|
|
|
|
And I run :inspector
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "Please enable developer-extras before using the webinspector!" should be shown
|
2015-11-18 20:08:25 +01:00
|
|
|
|
2016-02-16 20:36:23 +01:00
|
|
|
@no_xvfb @posix
|
2015-11-18 20:08:25 +01:00
|
|
|
Scenario: Inspector smoke test
|
|
|
|
When I set general -> developer-extras to true
|
|
|
|
And I run :inspector
|
tests: Make inspector smoke test more reliable.
Before we didn't wait until the inspector window was hidden, which caused the
following tests to fail on our OS X buildbot:
==================================== ERRORS ====================================
_________ ERROR at teardown of test_fakekey_sending_key_to_the_website _________
[...]
tests/integration/testprocess.py:186: InvalidLine
----------------------------- Captured stdout call -----------------------------
[...]
INVALID: Traceback (most recent call last):
IGNORED: File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/app.py", line 109, in <lambda>
IGNORED: target_arg=target_arg))
IGNORED: File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/app.py", line 263, in process_pos_args
IGNORED: commandrunner.run_safely_init(cmd[1:])
IGNORED: File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/commands/runners.py", line 266, in run_safely_init
IGNORED: self.run(text, count)
IGNORED: File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/commands/runners.py", line 249, in run
IGNORED: result.cmd.run(self._win_id, args)
IGNORED: File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/commands/command.py", line 505, in run
IGNORED: self.handler(*posargs, **kwargs)
IGNORED: File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/browser/commands.py", line 1781, in fake_key
IGNORED: tab='current')
IGNORED: File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/utils/objreg.py", line 215, in get
IGNORED: reg = _get_registry(scope, window, tab)
IGNORED: File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/utils/objreg.py", line 202, in _get_registry
IGNORED: return _get_tab_registry(window, tab)
IGNORED: File "/Users/buildbot/buildbot/slave/osx/build/qutebrowser/utils/objreg.py", line 152, in _get_tab_registry
IGNORED: raise RegistryUnavailableError('tab')
INVALID: qutebrowser.utils.objreg.RegistryUnavailableError: tab
[...]
While this is a real issue, this test shouldn't affect the next one.
Since we have to wait for windows getting focused but Xvfb doesn't do that, we
skip this tests when running via Xvfb.
2015-11-24 16:17:26 +01:00
|
|
|
And I wait for "Focus object changed: <PyQt5.QtWebKitWidgets.QWebView object at *>" in the log
|
2015-11-18 20:08:25 +01:00
|
|
|
And I run :inspector
|
2015-11-24 16:54:35 +01:00
|
|
|
And I wait for "Focus object changed: *" in the log
|
2015-11-18 20:08:25 +01:00
|
|
|
Then no crash should happen
|
2015-11-20 07:05:16 +01:00
|
|
|
|
2016-01-07 07:12:51 +01:00
|
|
|
# Different code path as an inspector got created now
|
|
|
|
Scenario: Inspector without developer extras (after smoke)
|
|
|
|
When I set general -> developer-extras to false
|
|
|
|
And I run :inspector
|
|
|
|
Then the error "Please enable developer-extras before using the webinspector!" should be shown
|
|
|
|
|
|
|
|
# Different code path as an inspector got created now
|
2016-02-16 20:36:23 +01:00
|
|
|
@no_xvfb @posix
|
2016-01-07 07:12:51 +01:00
|
|
|
Scenario: Inspector smoke test 2
|
|
|
|
When I set general -> developer-extras to true
|
|
|
|
And I run :inspector
|
|
|
|
And I wait for "Focus object changed: <PyQt5.QtWebKitWidgets.QWebView object at *>" in the log
|
|
|
|
And I run :inspector
|
|
|
|
And I wait for "Focus object changed: *" in the log
|
|
|
|
Then no crash should happen
|
|
|
|
|
2015-11-23 14:37:54 +01:00
|
|
|
# :stop/:reload
|
2015-11-21 14:23:44 +01:00
|
|
|
|
|
|
|
Scenario: :stop
|
2015-11-22 17:07:54 +01:00
|
|
|
Given I have a fresh instance
|
2015-11-21 14:23:44 +01:00
|
|
|
# We can't use "When I open" because we don't want to wait for load
|
|
|
|
# finished
|
2015-11-23 19:43:11 +01:00
|
|
|
When I run :open http://localhost:(port)/custom/redirect-later?delay=-1
|
2015-11-21 14:23:44 +01:00
|
|
|
And I wait for "emitting: cur_load_status_changed('loading') (tab *)" in the log
|
|
|
|
And I wait 1s
|
2015-11-21 15:14:32 +01:00
|
|
|
And I run :stop
|
2015-12-18 20:24:03 +01:00
|
|
|
And I open custom/redirect-later-continue in a new tab
|
2015-11-23 19:43:11 +01:00
|
|
|
And I wait 1s
|
2015-11-23 20:00:25 +01:00
|
|
|
Then the unordered requests should be:
|
2015-11-23 19:43:11 +01:00
|
|
|
custom/redirect-later-continue
|
|
|
|
custom/redirect-later?delay=-1
|
2015-11-21 14:23:44 +01:00
|
|
|
# no request on / because we stopped the redirect
|
2015-11-23 14:37:54 +01:00
|
|
|
|
2016-01-06 07:15:20 +01:00
|
|
|
Scenario: :stop with wrong count
|
|
|
|
When I open data/hello.txt
|
|
|
|
And I run :tab-only
|
|
|
|
And I run :stop with count 2
|
|
|
|
Then no crash should happen
|
|
|
|
|
2015-11-23 14:37:54 +01:00
|
|
|
Scenario: :reload
|
2016-01-05 22:46:52 +01:00
|
|
|
When I open data/reload.txt
|
2015-11-23 14:37:54 +01:00
|
|
|
And I run :reload
|
2016-01-05 22:46:52 +01:00
|
|
|
And I wait until data/reload.txt is loaded
|
2015-11-23 14:37:54 +01:00
|
|
|
Then the requests should be:
|
2016-01-05 22:46:52 +01:00
|
|
|
data/reload.txt
|
|
|
|
data/reload.txt
|
2015-11-23 14:37:54 +01:00
|
|
|
|
|
|
|
Scenario: :reload with force
|
|
|
|
When I open headers
|
|
|
|
And I run :reload --force
|
2015-11-23 19:44:53 +01:00
|
|
|
And I wait until headers is loaded
|
2015-11-23 14:37:54 +01:00
|
|
|
Then the header Cache-Control should be set to no-cache
|
2015-11-24 18:24:33 +01:00
|
|
|
|
2016-01-06 07:15:20 +01:00
|
|
|
Scenario: :reload with wrong count
|
|
|
|
When I open data/hello.txt
|
|
|
|
And I run :tab-only
|
|
|
|
And I run :reload with count 2
|
|
|
|
Then no crash should happen
|
|
|
|
|
2015-11-24 18:24:33 +01:00
|
|
|
# :view-source
|
|
|
|
|
|
|
|
Scenario: :view-source
|
|
|
|
Given I open data/hello.txt
|
|
|
|
When I run :tab-only
|
|
|
|
And I run :view-source
|
|
|
|
Then the session should look like:
|
|
|
|
windows:
|
|
|
|
- tabs:
|
|
|
|
- history:
|
|
|
|
- active: true
|
|
|
|
url: http://localhost:*/data/hello.txt
|
|
|
|
- active: true
|
|
|
|
history: []
|
|
|
|
And the page source should look like misc/hello.txt.html
|
|
|
|
|
|
|
|
Scenario: :view-source on source page.
|
|
|
|
When I open data/hello.txt
|
|
|
|
And I run :view-source
|
|
|
|
And I run :view-source
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "Already viewing source!" should be shown
|
2015-11-24 18:36:51 +01:00
|
|
|
|
|
|
|
# :debug-console
|
2015-11-24 19:24:39 +01:00
|
|
|
|
2016-02-16 20:36:23 +01:00
|
|
|
@no_xvfb
|
2015-11-24 18:36:51 +01:00
|
|
|
Scenario: :debug-console smoke test
|
|
|
|
When I run :debug-console
|
|
|
|
And I wait for "Focus object changed: <qutebrowser.misc.consolewidget.ConsoleLineEdit *>" in the log
|
|
|
|
And I run :debug-console
|
|
|
|
And I wait for "Focus object changed: *" in the log
|
|
|
|
Then no crash should happen
|
2015-11-28 22:34:19 +01:00
|
|
|
|
|
|
|
# :help
|
|
|
|
|
|
|
|
Scenario: :help without topic
|
|
|
|
When I run :tab-only
|
|
|
|
And I run :help
|
2015-12-02 22:22:31 +01:00
|
|
|
And I wait until qute://help/index.html is loaded
|
2015-11-28 22:34:19 +01:00
|
|
|
Then the following tabs should be open:
|
|
|
|
- qute://help/index.html (active)
|
|
|
|
|
|
|
|
Scenario: :help with invalid topic
|
|
|
|
When I run :help foo
|
|
|
|
Then the error "Invalid help topic foo!" should be shown
|
|
|
|
|
|
|
|
Scenario: :help with command
|
2016-01-04 20:10:03 +01:00
|
|
|
When the documentation is up to date
|
|
|
|
And I run :tab-only
|
2015-11-28 22:34:19 +01:00
|
|
|
And I run :help :back
|
2015-12-02 22:22:31 +01:00
|
|
|
And I wait until qute://help/commands.html#back is loaded
|
2015-11-28 22:34:19 +01:00
|
|
|
Then the following tabs should be open:
|
|
|
|
- qute://help/commands.html#back (active)
|
|
|
|
|
|
|
|
Scenario: :help with invalid command
|
|
|
|
When I run :help :foo
|
|
|
|
Then the error "Invalid command foo!" should be shown
|
|
|
|
|
|
|
|
Scenario: :help with setting
|
2016-01-04 20:10:03 +01:00
|
|
|
When the documentation is up to date
|
|
|
|
And I run :tab-only
|
2015-11-28 22:34:19 +01:00
|
|
|
And I run :help general->editor
|
2015-12-02 22:22:31 +01:00
|
|
|
And I wait until qute://help/settings.html#general-editor is loaded
|
2015-11-28 22:34:19 +01:00
|
|
|
Then the following tabs should be open:
|
|
|
|
- qute://help/settings.html#general-editor (active)
|
|
|
|
|
|
|
|
Scenario: :help with invalid setting (2 arrows)
|
|
|
|
When I run :help general->editor->foo
|
|
|
|
Then the error "Invalid help topic general->editor->foo!" should be shown
|
|
|
|
|
|
|
|
Scenario: :help with invalid setting (unknown section)
|
|
|
|
When I run :help foo->bar
|
|
|
|
Then the error "Invalid section foo!" should be shown
|
|
|
|
|
|
|
|
Scenario: :help with invalid setting (unknown option)
|
|
|
|
When I run :help general->bar
|
|
|
|
Then the error "Invalid option bar!" should be shown
|
|
|
|
|
|
|
|
Scenario: :help with -t
|
|
|
|
When I open about:blank
|
|
|
|
And I run :tab-only
|
|
|
|
And I run :help -t
|
2015-12-02 22:22:31 +01:00
|
|
|
And I wait until qute://help/index.html is loaded
|
2015-11-28 22:34:19 +01:00
|
|
|
Then the following tabs should be open:
|
|
|
|
- about:blank
|
|
|
|
- qute://help/index.html (active)
|
2015-11-28 22:44:05 +01:00
|
|
|
|
|
|
|
# :home
|
|
|
|
|
|
|
|
Scenario: :home with single page
|
|
|
|
When I set general -> startpage to http://localhost:(port)/data/hello2.txt
|
|
|
|
And I run :home
|
|
|
|
Then data/hello2.txt should be loaded
|
|
|
|
|
|
|
|
Scenario: :home with multiple pages
|
|
|
|
When I set general -> startpage to http://localhost:(port)/data/numbers/1.txt,http://localhost:(port)/data/numbers/2.txt
|
|
|
|
And I run :home
|
|
|
|
Then data/numbers/1.txt should be loaded
|
2015-12-20 20:00:56 +01:00
|
|
|
|
|
|
|
# pdfjs support
|
|
|
|
|
|
|
|
Scenario: pdfjs is used for pdf files
|
|
|
|
Given pdfjs is available
|
|
|
|
When I set content -> enable-pdfjs to true
|
|
|
|
And I open data/misc/test.pdf
|
|
|
|
Then the javascript message "PDF * [*] (PDF.js: *)" should be logged
|
|
|
|
|
|
|
|
Scenario: pdfjs is not used when disabled
|
|
|
|
When I set content -> enable-pdfjs to false
|
|
|
|
And I set storage -> prompt-download-directory to false
|
|
|
|
And I open data/misc/test.pdf
|
|
|
|
Then "Download finished" should be logged
|
2016-01-06 07:15:34 +01:00
|
|
|
|
2016-02-18 16:17:35 +01:00
|
|
|
Scenario: Downloading a pdf via pdf.js button (issue 1214)
|
|
|
|
Given pdfjs is available
|
2016-02-22 17:39:34 +01:00
|
|
|
# WORKAROUND to prevent the "Painter ended with 2 saved states" warning
|
|
|
|
# Might be related to https://bugreports.qt.io/browse/QTBUG-13524 and
|
|
|
|
# a weird interaction with the previous test.
|
2016-02-28 15:26:18 +01:00
|
|
|
And I have a fresh instance
|
|
|
|
When I set content -> enable-pdfjs to true
|
2016-02-18 16:17:35 +01:00
|
|
|
And I set completion -> download-path-suggestion to filename
|
|
|
|
And I set storage -> prompt-download-directory to true
|
|
|
|
And I open data/misc/test.pdf
|
|
|
|
And I wait for "[qute://pdfjs/*] PDF * (PDF.js: *)" in the log
|
|
|
|
And I run :jseval document.getElementById("download").click()
|
2016-07-06 23:16:38 +02:00
|
|
|
And I wait for "Asking question <qutebrowser.utils.usertypes.Question default='test.pdf' mode=<PromptMode.download: 5> text='Save file to:'>, *" in the log
|
2016-02-18 16:17:35 +01:00
|
|
|
And I run :leave-mode
|
|
|
|
Then no crash should happen
|
|
|
|
|
2016-01-06 07:15:34 +01:00
|
|
|
# :print
|
|
|
|
|
|
|
|
# Disabled because it causes weird segfaults and QPainter warnings in Qt...
|
2016-01-14 07:53:00 +01:00
|
|
|
@xfail_norun
|
2016-01-06 07:15:34 +01:00
|
|
|
Scenario: print preview
|
|
|
|
When I open data/hello.txt
|
|
|
|
And I run :print --preview
|
|
|
|
And I wait for "Focus object changed: *" in the log
|
|
|
|
And I run :debug-pyeval QApplication.instance().activeModalWidget().close()
|
|
|
|
Then no crash should happen
|
|
|
|
|
2016-01-06 07:54:54 +01:00
|
|
|
# On Windows/OS X, we get a "QPrintDialog: Cannot be used on non-native
|
|
|
|
# printers" qWarning.
|
2016-01-06 18:25:22 +01:00
|
|
|
#
|
|
|
|
# Disabled because it causes weird segfaults and QPainter warnings in Qt...
|
2016-01-14 07:53:00 +01:00
|
|
|
@xfail_norun
|
2016-01-06 07:15:34 +01:00
|
|
|
Scenario: print
|
|
|
|
When I open data/hello.txt
|
|
|
|
And I run :print
|
2016-01-06 08:29:53 +01:00
|
|
|
And I wait for "Focus object changed: *" in the log or skip the test
|
2016-01-06 07:15:34 +01:00
|
|
|
And I run :debug-pyeval QApplication.instance().activeModalWidget().close()
|
|
|
|
Then no crash should happen
|
2016-01-06 07:15:42 +01:00
|
|
|
|
2016-07-12 13:29:32 +02:00
|
|
|
Scenario: print --pdf
|
2016-07-12 02:08:24 +02:00
|
|
|
When I open data/hello.txt
|
|
|
|
And I run :print --pdf (tmpdir)/hello.pdf
|
|
|
|
And I wait for "Print to file: *" in the log or skip the test
|
2016-07-12 13:28:43 +02:00
|
|
|
Then the PDF hello.pdf should exist in the tmpdir
|
2016-07-12 02:08:24 +02:00
|
|
|
|
2016-01-06 07:15:42 +01:00
|
|
|
# :pyeval
|
|
|
|
|
|
|
|
Scenario: Running :pyeval
|
|
|
|
When I run :debug-pyeval 1+1
|
|
|
|
And I wait until qute:pyeval is loaded
|
|
|
|
Then the page should contain the plaintext "2"
|
|
|
|
|
2016-01-06 07:42:33 +01:00
|
|
|
Scenario: Causing exception in :pyeval
|
|
|
|
When I run :debug-pyeval 1/0
|
|
|
|
And I wait until qute:pyeval is loaded
|
|
|
|
Then the page should contain the plaintext "ZeroDivisionError"
|
|
|
|
|
2016-01-06 07:15:42 +01:00
|
|
|
Scenario: Running :pyeval with --quiet
|
|
|
|
When I run :debug-pyeval --quiet 1+1
|
|
|
|
Then "pyeval output: 2" should be logged
|
2016-05-12 17:46:46 +02:00
|
|
|
|
2016-03-31 19:32:30 +02:00
|
|
|
## https://github.com/The-Compiler/qutebrowser/issues/504
|
|
|
|
|
|
|
|
Scenario: Focusing download widget via Tab
|
|
|
|
When I open about:blank
|
|
|
|
And I press the key "<Tab>"
|
|
|
|
And I press the key "<Ctrl-C>"
|
|
|
|
Then no crash should happen
|
|
|
|
|
2016-06-30 14:47:55 +02:00
|
|
|
@pyqt>=5.3.1
|
2016-03-31 19:32:30 +02:00
|
|
|
Scenario: Focusing download widget via Tab (original issue)
|
|
|
|
When I open data/prompt/jsprompt.html
|
|
|
|
And I run :hint
|
|
|
|
And I run :follow-hint a
|
|
|
|
And I wait for "Entering mode KeyMode.prompt *" in the log
|
|
|
|
And I press the key "<Tab>"
|
|
|
|
And I press the key "<Ctrl-C>"
|
|
|
|
Then no crash should happen
|
2016-04-19 06:21:20 +02:00
|
|
|
|
|
|
|
## Custom headers
|
|
|
|
|
|
|
|
Scenario: Setting a custom header
|
|
|
|
When I set network -> custom-headers to {"X-Qute-Test": "testvalue"}
|
|
|
|
And I open headers
|
|
|
|
Then the header X-Qute-Test should be set to testvalue
|
2016-05-12 03:23:38 +02:00
|
|
|
|
|
|
|
## :messages
|
|
|
|
|
|
|
|
Scenario: Showing error messages
|
|
|
|
When I run :message-error the-error-message
|
|
|
|
And I run :message-warning the-warning-message
|
|
|
|
And I run :message-info the-info-message
|
|
|
|
And I run :messages
|
2016-05-29 17:07:37 +02:00
|
|
|
Then qute://log?level=error should be loaded
|
|
|
|
And the error "the-error-message" should be shown
|
2016-05-12 03:23:38 +02:00
|
|
|
And the warning "the-warning-message" should be shown
|
|
|
|
And the page should contain the plaintext "the-error-message"
|
2016-05-12 13:47:20 +02:00
|
|
|
And the page should not contain the plaintext "the-warning-message"
|
|
|
|
And the page should not contain the plaintext "the-info-message"
|
2016-05-12 03:23:38 +02:00
|
|
|
|
|
|
|
Scenario: Showing messages of type 'warning' or greater
|
|
|
|
When I run :message-error the-error-message
|
|
|
|
And I run :message-warning the-warning-message
|
|
|
|
And I run :message-info the-info-message
|
|
|
|
And I run :messages warning
|
2016-05-29 17:07:37 +02:00
|
|
|
Then qute://log?level=warning should be loaded
|
|
|
|
And the error "the-error-message" should be shown
|
2016-05-12 03:23:38 +02:00
|
|
|
And the warning "the-warning-message" should be shown
|
|
|
|
And the page should contain the plaintext "the-error-message"
|
|
|
|
And the page should contain the plaintext "the-warning-message"
|
2016-05-12 13:47:20 +02:00
|
|
|
And the page should not contain the plaintext "the-info-message"
|
2016-05-12 03:23:38 +02:00
|
|
|
|
|
|
|
Scenario: Showing messages of type 'info' or greater
|
|
|
|
When I run :message-error the-error-message
|
|
|
|
And I run :message-warning the-warning-message
|
|
|
|
And I run :message-info the-info-message
|
|
|
|
And I run :messages info
|
2016-05-29 17:07:37 +02:00
|
|
|
Then qute://log?level=info should be loaded
|
|
|
|
And the error "the-error-message" should be shown
|
2016-05-12 03:23:38 +02:00
|
|
|
And the warning "the-warning-message" should be shown
|
|
|
|
And the page should contain the plaintext "the-error-message"
|
|
|
|
And the page should contain the plaintext "the-warning-message"
|
|
|
|
And the page should contain the plaintext "the-info-message"
|
2016-05-12 13:47:20 +02:00
|
|
|
|
|
|
|
Scenario: Showing messages of an invalid level
|
|
|
|
When I run :messages cataclysmic
|
|
|
|
Then the error "Invalid log level cataclysmic!" should be shown
|
Fix running qute:log and qute:plainlog
This failed because dict.get('level') returned None with no level
parameter, and the subsequent [0] raised:
Traceback (most recent call last):
File ".../qutebrowser/utils/utils.py", line 624, in wrapper
return func(*args, **kwargs)
File ".../qutebrowser/browser/network/networkmanager.py", line 445, in createRequest
op, req, outgoing_data)
File ".../qutebrowser/browser/network/qutescheme.py", line 107, in createRequest
data = handler(self._win_id, request)
File ".../qutebrowser/browser/network/qutescheme.py", line 189, in qute_log
level = urllib.parse.parse_qs(request.url().query()).get('level')[0]
TypeError: 'NoneType' object is not subscriptable
2016-05-15 11:33:30 +02:00
|
|
|
|
|
|
|
Scenario: Using qute:log directly
|
|
|
|
When I open qute:log
|
|
|
|
Then no crash should happen
|
|
|
|
|
|
|
|
Scenario: Using qute:plainlog directly
|
|
|
|
When I open qute:plainlog
|
|
|
|
Then no crash should happen
|
2016-05-15 11:50:29 +02:00
|
|
|
|
|
|
|
Scenario: Using :messages without messages
|
|
|
|
Given I have a fresh instance
|
|
|
|
When I run :messages
|
2016-05-29 17:07:37 +02:00
|
|
|
Then qute://log?level=error should be loaded
|
|
|
|
And the page should contain the plaintext "No messages to show."
|
2016-05-26 00:52:36 +02:00
|
|
|
|
2016-08-05 15:13:36 +02:00
|
|
|
Scenario: Using :debug-log-capacity
|
|
|
|
When I run :debug-log-capacity 100
|
|
|
|
And I run :message-info oldstuff
|
|
|
|
And I run :repeat 10 :message-info otherstuff
|
|
|
|
And I run :message-info newstuff
|
|
|
|
And I open qute:log
|
|
|
|
Then the page should contain the plaintext "newstuff"
|
|
|
|
And the page should not contain the plaintext "oldstuff"
|
|
|
|
|
2016-05-26 00:52:36 +02:00
|
|
|
## https://github.com/The-Compiler/qutebrowser/issues/1523
|
|
|
|
|
|
|
|
Scenario: Completing a single option argument
|
|
|
|
When I run :set-cmd-text -s :--
|
|
|
|
Then no crash should happen
|
2016-06-06 16:10:10 +02:00
|
|
|
|
|
|
|
## https://github.com/The-Compiler/qutebrowser/issues/1386
|
|
|
|
|
|
|
|
Scenario: Partial commandline matching with startup command
|
|
|
|
When I run :message-i "Hello World" (invalid command)
|
|
|
|
Then the error "message-i: no such command" should be shown
|
|
|
|
|
|
|
|
# We can't run :message-i as startup command, so we use
|
|
|
|
# :set-cmd-text
|
|
|
|
|
|
|
|
Scenario: Partial commandline matching
|
|
|
|
When I run :set-cmd-text :message-i "Hello World"
|
|
|
|
And I run :command-accept
|
|
|
|
Then the message "Hello World" should be shown
|
2016-06-08 16:34:42 +02:00
|
|
|
|
|
|
|
## https://github.com/The-Compiler/qutebrowser/issues/1219
|
|
|
|
|
|
|
|
Scenario: Sharing cookies with private browsing
|
|
|
|
When I set general -> private-browsing to true
|
|
|
|
And I open cookies/set?qute-test=42 without waiting
|
|
|
|
And I wait until cookies is loaded
|
|
|
|
And I open cookies in a new tab
|
|
|
|
Then the cookie qute-test should be set to 42
|
2016-07-03 22:32:07 +02:00
|
|
|
|
2016-08-02 14:17:39 +02:00
|
|
|
## https://github.com/The-Compiler/qutebrowser/issues/1742
|
|
|
|
|
|
|
|
Scenario: Private browsing is activated in QtWebKit without restart
|
|
|
|
When I set general -> private-browsing to true
|
|
|
|
And I open data/javascript/localstorage.html
|
2016-08-02 15:18:25 +02:00
|
|
|
Then the page should contain the plaintext "Local storage status: not working"
|
2016-08-02 14:17:39 +02:00
|
|
|
|
2016-07-03 22:32:07 +02:00
|
|
|
Scenario: :repeat-command
|
|
|
|
Given I open data/scroll.html
|
|
|
|
And I run :tab-only
|
|
|
|
When I run :scroll down
|
|
|
|
And I run :repeat-command
|
|
|
|
And I run :scroll up
|
|
|
|
Then the page should be scrolled vertically
|
|
|
|
|
|
|
|
Scenario: :repeat-command with count
|
|
|
|
Given I open data/scroll.html
|
|
|
|
And I run :tab-only
|
|
|
|
When I run :scroll down with count 3
|
|
|
|
And I run :scroll up
|
|
|
|
And I run :repeat-command with count 2
|
|
|
|
Then the page should not be scrolled
|
|
|
|
|
|
|
|
Scenario: :repeat-command with not-normal command inbetween
|
|
|
|
Given I open data/scroll.html
|
|
|
|
And I run :tab-only
|
|
|
|
When I run :scroll down with count 3
|
|
|
|
And I run :scroll up
|
|
|
|
And I run :prompt-accept
|
|
|
|
And I run :repeat-command with count 2
|
|
|
|
Then the page should not be scrolled
|
|
|
|
And the error "prompt-accept: This command is only allowed in prompt/yesno mode." should be shown
|
2016-07-13 15:24:45 +02:00
|
|
|
|
|
|
|
Scenario: :repeat-command with mode-switching command
|
|
|
|
Given I open data/hints/link_blank.html
|
|
|
|
And I run :tab-only
|
|
|
|
When I run :hint
|
|
|
|
And I run :leave-mode
|
|
|
|
And I run :repeat-command
|
|
|
|
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-08-10 19:42:03 +02:00
|
|
|
|
|
|
|
## Variables
|
|
|
|
|
|
|
|
Scenario: {url} as part of an argument
|
|
|
|
When I open data/hello.txt
|
|
|
|
And I run :message-info foo{url}
|
|
|
|
Then the message "foohttp://localhost:*/hello.txt" should be shown
|
|
|
|
|
|
|
|
Scenario: Multiple variables in an argument
|
|
|
|
When I open data/hello.txt
|
|
|
|
And I put "foo" into the clipboard
|
|
|
|
And I run :message-info {clipboard}bar{url}
|
|
|
|
Then the message "foobarhttp://localhost:*/hello.txt" should be shown
|