2017-03-31 17:16:31 +02:00
|
|
|
# vim: ft=cucumber fileencoding=utf-8 sts=4 sw=4 et:
|
|
|
|
|
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
|
|
|
## :jseval
|
|
|
|
|
2015-11-13 07:50:20 +01:00
|
|
|
Scenario: :jseval
|
2017-09-13 22:26:38 +02:00
|
|
|
When I run :jseval console.log("Hello from JS!");
|
2016-09-10 15:50:00 +02:00
|
|
|
And I wait for the javascript message "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
|
|
|
|
|
|
|
Scenario: :jseval without logging
|
2017-09-13 22:26:38 +02:00
|
|
|
When I set content.javascript.log to {"unknown": "none", "info": "none", "warning": "debug", "error": "debug"}
|
2015-11-15 12:23:34 +01:00
|
|
|
And I run :jseval console.log("Hello from JS!");
|
2017-09-13 22:26:38 +02:00
|
|
|
And I set content.javascript.log to {"unknown": "debug", "info": "debug", "warning": "debug", "error": "debug"}
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the message "No output or error" should be shown
|
2016-08-18 19:26:06 +02:00
|
|
|
And "[:*] Hello from JS!" should not be logged
|
2015-11-15 12:23:34 +01:00
|
|
|
|
|
|
|
Scenario: :jseval with --quiet
|
2017-09-13 22:26:38 +02:00
|
|
|
When I run :jseval --quiet console.log("Hello from JS!");
|
2016-09-10 15:50:00 +02:00
|
|
|
And I wait for the javascript message "Hello from JS!"
|
2015-11-15 12:23:34 +01:00
|
|
|
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
|
|
|
|
2016-09-12 15:59:17 +02:00
|
|
|
@qtwebengine_skip
|
|
|
|
Scenario: :jseval with --world on QtWebKit
|
2017-09-13 22:26:38 +02:00
|
|
|
When I run :jseval --world=1 console.log("Hello from JS!");
|
2016-09-12 15:59:17 +02:00
|
|
|
And I wait for the javascript message "Hello from JS!"
|
|
|
|
Then "Ignoring world ID 1" should be logged
|
2017-03-29 10:32:11 +02:00
|
|
|
And "No output or error" should be logged
|
2016-09-12 15:59:17 +02:00
|
|
|
|
2017-02-17 14:11:45 +01:00
|
|
|
@qtwebkit_skip
|
2016-09-12 15:59:17 +02:00
|
|
|
Scenario: :jseval uses separate world without --world
|
2017-09-13 22:26:38 +02:00
|
|
|
When I open data/misc/jseval.html
|
2016-09-12 15:59:17 +02:00
|
|
|
And I run :jseval do_log()
|
|
|
|
Then the javascript message "Hello from the page!" should not be logged
|
|
|
|
And the javascript message "Uncaught ReferenceError: do_log is not defined" should be logged
|
2017-03-29 10:32:11 +02:00
|
|
|
And "No output or error" should be logged
|
2016-09-12 15:59:17 +02:00
|
|
|
|
2017-02-17 14:11:45 +01:00
|
|
|
@qtwebkit_skip
|
2016-09-12 15:59:17 +02:00
|
|
|
Scenario: :jseval using the main world
|
2017-09-13 22:26:38 +02:00
|
|
|
When I open data/misc/jseval.html
|
2016-09-12 15:59:17 +02:00
|
|
|
And I run :jseval --world 0 do_log()
|
|
|
|
Then the javascript message "Hello from the page!" should be logged
|
2017-03-29 10:32:11 +02:00
|
|
|
And "No output or error" should be logged
|
2016-09-12 15:59:17 +02:00
|
|
|
|
2017-02-17 14:11:45 +01:00
|
|
|
@qtwebkit_skip
|
2016-09-12 18:23:23 +02:00
|
|
|
Scenario: :jseval using the main world as name
|
2017-09-13 22:26:38 +02:00
|
|
|
When I open data/misc/jseval.html
|
2016-09-12 18:23:23 +02:00
|
|
|
And I run :jseval --world main do_log()
|
|
|
|
Then the javascript message "Hello from the page!" should be logged
|
2017-03-29 10:32:11 +02:00
|
|
|
And "No output or error" should be logged
|
2016-09-12 18:23:23 +02:00
|
|
|
|
2017-02-24 19:07:30 +01:00
|
|
|
Scenario: :jseval --file using a file that exists as js-code
|
2017-09-13 22:26:38 +02:00
|
|
|
When I run :jseval --file (testdata)/misc/jseval_file.js
|
2017-02-24 19:07:30 +01:00
|
|
|
Then the javascript message "Hello from JS!" should be logged
|
|
|
|
And the javascript message "Hello again from JS!" should be logged
|
2017-03-29 10:32:11 +02:00
|
|
|
And "No output or error" should be logged
|
2017-02-24 19:07:30 +01:00
|
|
|
|
|
|
|
Scenario: :jseval --file using a file that doesn't exist as js-code
|
|
|
|
When I run :jseval --file nonexistentfile
|
|
|
|
Then the error "[Errno 2] No such file or directory: 'nonexistentfile'" should be shown
|
|
|
|
And "No output or error" should not be logged
|
|
|
|
|
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
|
|
|
|
|
2016-11-23 08:12:13 +01:00
|
|
|
@qtwebengine_skip
|
2015-11-18 20:08:25 +01:00
|
|
|
Scenario: Inspector without developer extras
|
2017-06-16 16:22:41 +02:00
|
|
|
When I set content.developer_extras to false
|
2015-11-18 20:08:25 +01:00
|
|
|
And I run :inspector
|
2017-07-04 15:43:54 +02:00
|
|
|
Then the error "Please enable content.developer_extras before using the webinspector!" should be shown
|
2015-11-18 20:08:25 +01:00
|
|
|
|
2016-11-23 08:12:13 +01:00
|
|
|
@qtwebkit_skip
|
|
|
|
Scenario: Inspector without --enable-webengine-inspector
|
|
|
|
When I run :inspector
|
|
|
|
Then the error "Debugging is not enabled. See 'qutebrowser --help' for details." should be shown
|
|
|
|
|
2016-10-05 14:27:57 +02:00
|
|
|
@no_xvfb @posix @qtwebengine_skip
|
2015-11-18 20:08:25 +01:00
|
|
|
Scenario: Inspector smoke test
|
2017-06-16 16:22:41 +02:00
|
|
|
When I set content.developer_extras to true
|
2015-11-18 20:08:25 +01:00
|
|
|
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
|
2016-11-23 08:12:13 +01:00
|
|
|
@qtwebengine_skip
|
2016-01-07 07:12:51 +01:00
|
|
|
Scenario: Inspector without developer extras (after smoke)
|
2017-06-16 16:22:41 +02:00
|
|
|
When I set content.developer_extras to false
|
2016-01-07 07:12:51 +01:00
|
|
|
And I run :inspector
|
2017-07-04 15:43:54 +02:00
|
|
|
Then the error "Please enable content.developer_extras before using the webinspector!" should be shown
|
2016-01-07 07:12:51 +01:00
|
|
|
|
|
|
|
# Different code path as an inspector got created now
|
2016-10-05 14:27:57 +02:00
|
|
|
@no_xvfb @posix @qtwebengine_skip
|
2016-01-07 07:12:51 +01:00
|
|
|
Scenario: Inspector smoke test 2
|
2017-06-16 16:22:41 +02:00
|
|
|
When I set content.developer_extras to true
|
2016-01-07 07:12:51 +01:00
|
|
|
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
|
|
|
|
2017-06-12 18:15:05 +02:00
|
|
|
@flaky
|
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
|
|
|
|
|
2016-09-06 21:43:02 +02:00
|
|
|
# Flaky due to :view-source being async?
|
|
|
|
@qtwebengine_flaky
|
2015-11-24 18:24:33 +01:00
|
|
|
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: []
|
2016-08-19 17:22:07 +02:00
|
|
|
And the page should contain the html "/* Literal.Number.Integer */"
|
2015-11-24 18:24:33 +01:00
|
|
|
|
2016-09-06 21:43:02 +02:00
|
|
|
# Flaky due to :view-source being async?
|
|
|
|
@qtwebengine_flaky
|
2015-11-24 18:24:33 +01:00
|
|
|
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
|
|
|
|
2015-11-28 22:44:05 +01:00
|
|
|
# :home
|
|
|
|
|
|
|
|
Scenario: :home with single page
|
2017-07-02 12:07:27 +02:00
|
|
|
When I set url.start_pages to ["http://localhost:(port)/data/hello2.txt"]
|
2015-11-28 22:44:05 +01:00
|
|
|
And I run :home
|
|
|
|
Then data/hello2.txt should be loaded
|
|
|
|
|
|
|
|
Scenario: :home with multiple pages
|
2017-07-02 12:07:27 +02:00
|
|
|
When I set url.start_pages to ["http://localhost:(port)/data/numbers/1.txt", "http://localhost:(port)/data/numbers/2.txt"]
|
2015-11-28 22:44:05 +01:00
|
|
|
And I run :home
|
|
|
|
Then data/numbers/1.txt should be loaded
|
2015-12-20 20:00:56 +01:00
|
|
|
|
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
|
|
|
|
|
2017-07-08 11:12:43 +02:00
|
|
|
# On Windows/macOS, we get a "QPrintDialog: Cannot be used on non-native
|
2016-01-06 07:54:54 +01:00
|
|
|
# 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-08-18 20:34:03 +02:00
|
|
|
# FIXME:qtwebengine use a finer skipping here
|
|
|
|
@qtwebengine_skip: printing to pdf is not implemented with older Qt versions
|
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
|
|
|
|
2017-02-05 00:13:11 +01:00
|
|
|
## https://github.com/qutebrowser/qutebrowser/issues/504
|
2016-03-31 19:32:30 +02:00
|
|
|
|
|
|
|
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-11-10 22:37:53 +01:00
|
|
|
@js_prompt
|
2016-03-31 19:32:30 +02:00
|
|
|
Scenario: Focusing download widget via Tab (original issue)
|
|
|
|
When I open data/prompt/jsprompt.html
|
2016-08-18 16:13:38 +02:00
|
|
|
And I run :click-element id button
|
2016-03-31 19:32:30 +02:00
|
|
|
And I wait for "Entering mode KeyMode.prompt *" in the log
|
|
|
|
And I press the key "<Tab>"
|
|
|
|
And I press the key "<Ctrl-C>"
|
2017-02-03 23:41:33 +01:00
|
|
|
And I run :leave-mode
|
2016-03-31 19:32:30 +02:00
|
|
|
Then no crash should happen
|
2016-04-19 06:21:20 +02:00
|
|
|
|
|
|
|
## Custom headers
|
|
|
|
|
|
|
|
Scenario: Setting a custom header
|
2017-07-02 12:21:33 +02:00
|
|
|
When I set content.headers.custom to {"X-Qute-Test": "testvalue"}
|
2016-04-19 06:21:20 +02:00
|
|
|
And I open headers
|
|
|
|
Then the header X-Qute-Test should be set to testvalue
|
2016-05-12 03:23:38 +02:00
|
|
|
|
2016-09-07 18:29:19 +02:00
|
|
|
Scenario: DNT header
|
2017-07-02 12:21:33 +02:00
|
|
|
When I set content.headers.do_not_track to true
|
2016-09-07 18:29:19 +02:00
|
|
|
And I open headers
|
|
|
|
Then the header Dnt should be set to 1
|
|
|
|
And the header X-Do-Not-Track should be set to 1
|
|
|
|
|
|
|
|
Scenario: DNT header (off)
|
2017-07-02 12:21:33 +02:00
|
|
|
When I set content.headers.do_not_track to false
|
2016-09-07 18:29:19 +02:00
|
|
|
And I open headers
|
|
|
|
Then the header Dnt should be set to 0
|
|
|
|
And the header X-Do-Not-Track should be set to 0
|
|
|
|
|
2017-07-03 15:57:22 +02:00
|
|
|
Scenario: DNT header (unset)
|
|
|
|
When I set content.headers.do_not_track to <empty>
|
|
|
|
And I open headers
|
|
|
|
Then the header Dnt should be set to <unset>
|
|
|
|
And the header X-Do-Not-Track should be set to <unset>
|
|
|
|
|
2016-09-07 18:29:19 +02:00
|
|
|
Scenario: Accept-Language header
|
2017-07-03 15:46:33 +02:00
|
|
|
When I set content.headers.accept_language to en,de
|
2016-09-07 18:29:19 +02:00
|
|
|
And I open headers
|
|
|
|
Then the header Accept-Language should be set to en,de
|
|
|
|
|
2017-07-13 20:46:37 +02:00
|
|
|
# This still doesn't set window.navigator.language
|
|
|
|
# See https://bugreports.qt.io/browse/QTBUG-61949
|
|
|
|
@qtwebkit_skip
|
|
|
|
Scenario: Accept-Language header (JS)
|
|
|
|
When I set content.headers.accept_language to it,fr
|
|
|
|
And I run :jseval console.log(window.navigator.languages)
|
|
|
|
Then the javascript message "it,fr" should be logged
|
|
|
|
|
2016-11-15 11:32:05 +01:00
|
|
|
Scenario: Setting a custom user-agent header
|
2017-07-02 12:21:33 +02:00
|
|
|
When I set content.headers.user_agent to toaster
|
2016-11-15 11:32:05 +01:00
|
|
|
And I open headers
|
2017-05-16 06:46:45 +02:00
|
|
|
And I run :jseval console.log(window.navigator.userAgent)
|
2016-11-15 11:32:05 +01:00
|
|
|
Then the header User-Agent should be set to toaster
|
2017-05-16 06:46:45 +02:00
|
|
|
And the javascript message "toaster" should be logged
|
2016-11-15 11:32:05 +01:00
|
|
|
|
|
|
|
Scenario: Setting the default user-agent header
|
2017-07-02 12:21:33 +02:00
|
|
|
When I set content.headers.user_agent to <empty>
|
2016-11-15 11:32:05 +01:00
|
|
|
And I open headers
|
2017-05-16 06:46:45 +02:00
|
|
|
And I run :jseval console.log(window.navigator.userAgent)
|
2016-11-15 11:32:05 +01:00
|
|
|
Then the header User-Agent should be set to Mozilla/5.0 *
|
2017-05-16 06:46:45 +02:00
|
|
|
And the javascript message "Mozilla/5.0 *" should be logged
|
2016-11-15 11:32:05 +01:00
|
|
|
|
2017-02-05 00:13:11 +01:00
|
|
|
## https://github.com/qutebrowser/qutebrowser/issues/1523
|
2016-05-26 00:52:36 +02:00
|
|
|
|
|
|
|
Scenario: Completing a single option argument
|
2016-08-09 13:56:26 +02:00
|
|
|
When I run :set-cmd-text -s :--
|
2016-05-26 00:52:36 +02:00
|
|
|
Then no crash should happen
|
2016-06-06 16:10:10 +02:00
|
|
|
|
2017-02-05 00:13:11 +01:00
|
|
|
## https://github.com/qutebrowser/qutebrowser/issues/1386
|
2016-06-06 16:10:10 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2017-03-30 19:37:15 +02:00
|
|
|
Scenario: Multiple leading : in command
|
|
|
|
When I run :::::set-cmd-text ::::message-i "Hello World"
|
|
|
|
And I run :command-accept
|
|
|
|
Then the message "Hello World" should be shown
|
|
|
|
|
|
|
|
Scenario: Whitespace in command
|
|
|
|
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-06 16:10:10 +02:00
|
|
|
# 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
|
|
|
|
2016-08-11 23:37:14 +02:00
|
|
|
@no_xvfb
|
|
|
|
Scenario: :window-only
|
|
|
|
Given I run :tab-only
|
|
|
|
And I open data/hello.txt
|
|
|
|
When I open data/hello2.txt in a new tab
|
|
|
|
And I open data/hello3.txt in a new window
|
|
|
|
And I run :window-only
|
|
|
|
Then the session should look like:
|
|
|
|
windows:
|
|
|
|
- tabs:
|
|
|
|
- active: true
|
|
|
|
history:
|
|
|
|
- url: http://localhost:*/data/hello3.txt
|
|
|
|
|
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
|
2016-08-14 13:41:08 +02:00
|
|
|
|
|
|
|
@xfail_norun
|
|
|
|
Scenario: {url} in clipboard should not be expanded
|
|
|
|
When I open data/hello.txt
|
|
|
|
# FIXME: {url} should be escaped, otherwise it is replaced before it enters clipboard
|
|
|
|
And I put "{url}" into the clipboard
|
|
|
|
And I run :message-info {clipboard}bar{url}
|
|
|
|
Then the message "{url}barhttp://localhost:*/hello.txt" should be shown
|
2016-08-18 15:30:04 +02:00
|
|
|
|
|
|
|
## :click-element
|
|
|
|
|
|
|
|
Scenario: Clicking an element with unknown ID
|
|
|
|
When I open data/click_element.html
|
|
|
|
And I run :click-element id blah
|
2016-11-15 19:43:03 +01:00
|
|
|
Then the error "No element found with id blah!" should be shown
|
2016-08-18 15:30:04 +02:00
|
|
|
|
|
|
|
Scenario: Clicking an element by ID
|
|
|
|
When I open data/click_element.html
|
|
|
|
And I run :click-element id qute-input
|
2017-02-03 22:20:15 +01:00
|
|
|
Then "Entering mode KeyMode.insert (reason: clicking input)" should be logged
|
2016-08-18 15:45:29 +02:00
|
|
|
|
|
|
|
Scenario: Clicking an element with tab target
|
|
|
|
When I open data/click_element.html
|
|
|
|
And I run :tab-only
|
|
|
|
And I run :click-element id link --target=tab
|
|
|
|
Then data/hello.txt should be loaded
|
|
|
|
And the following tabs should be open:
|
|
|
|
- data/click_element.html
|
|
|
|
- data/hello.txt (active)
|
2016-09-04 21:09:15 +02:00
|
|
|
|
2016-10-06 21:02:15 +02:00
|
|
|
## :command-history-{prev,next}
|
2016-10-10 07:34:22 +02:00
|
|
|
|
2016-10-06 21:02:15 +02:00
|
|
|
Scenario: Calling previous command
|
|
|
|
When I run :set-cmd-text :message-info blah
|
|
|
|
And I run :command-accept
|
|
|
|
And I wait for "blah" in the log
|
|
|
|
And I run :set-cmd-text :
|
|
|
|
And I run :command-history-prev
|
|
|
|
And I run :command-accept
|
|
|
|
Then the message "blah" should be shown
|
2017-03-30 19:37:15 +02:00
|
|
|
|
2016-10-06 21:02:15 +02:00
|
|
|
Scenario: Browsing through commands
|
|
|
|
When I run :set-cmd-text :message-info blarg
|
|
|
|
And I run :command-accept
|
|
|
|
And I wait for "blarg" in the log
|
|
|
|
And I run :set-cmd-text :
|
|
|
|
And I run :command-history-prev
|
|
|
|
And I run :command-history-prev
|
|
|
|
And I run :command-history-next
|
2016-10-08 18:14:37 +02:00
|
|
|
And I run :command-history-next
|
2016-10-06 21:02:15 +02:00
|
|
|
And I run :command-accept
|
|
|
|
Then the message "blarg" should be shown
|
2017-03-30 19:37:15 +02:00
|
|
|
|
2016-10-06 21:02:15 +02:00
|
|
|
Scenario: Calling previous command when history is empty
|
|
|
|
Given I have a fresh instance
|
|
|
|
When I run :set-cmd-text :
|
|
|
|
And I run :command-history-prev
|
|
|
|
And I run :command-accept
|
|
|
|
Then the error "No command given" should be shown
|
2016-10-10 07:34:22 +02:00
|
|
|
|
2016-10-06 21:02:15 +02:00
|
|
|
Scenario: Calling next command when there's no next command
|
|
|
|
When I run :set-cmd-text :
|
|
|
|
And I run :command-history-next
|
|
|
|
And I run :command-accept
|
|
|
|
Then the error "No command given" should be shown
|
2016-10-10 07:33:59 +02:00
|
|
|
|
2017-01-20 19:32:16 +01:00
|
|
|
## Modes blacklisted for :enter-mode
|
|
|
|
|
|
|
|
Scenario: Trying to enter command mode with :enter-mode
|
|
|
|
When I run :enter-mode command
|
|
|
|
Then the error "Mode command can't be entered manually!" should be shown
|
2017-02-08 09:41:55 +01:00
|
|
|
|
|
|
|
## Renderer crashes
|
|
|
|
|
2017-03-29 10:45:07 +02:00
|
|
|
# Skipped on Windows as "... has stopped working" hangs.
|
2017-05-19 08:10:17 +02:00
|
|
|
@qtwebkit_skip @no_invalid_lines @posix @qt<5.9
|
2017-02-08 09:41:55 +01:00
|
|
|
Scenario: Renderer crash
|
|
|
|
When I run :open -t chrome://crash
|
|
|
|
Then the error "Renderer process crashed" should be shown
|
|
|
|
|
2017-05-19 08:10:17 +02:00
|
|
|
@qtwebkit_skip @no_invalid_lines @qt<5.9
|
2017-02-08 09:41:55 +01:00
|
|
|
Scenario: Renderer kill
|
|
|
|
When I run :open -t chrome://kill
|
|
|
|
Then the error "Renderer process was killed" should be shown
|
2017-02-08 10:55:42 +01:00
|
|
|
|
2017-05-19 08:10:17 +02:00
|
|
|
# Skipped on Windows as "... has stopped working" hangs.
|
|
|
|
@qtwebkit_skip @no_invalid_lines @posix @qt>=5.9
|
|
|
|
Scenario: Renderer crash (5.9)
|
|
|
|
When I run :open -t chrome://crash
|
|
|
|
Then "Renderer process crashed" should be logged
|
|
|
|
And "* 'Error loading chrome://crash/'" should be logged
|
|
|
|
|
|
|
|
@qtwebkit_skip @no_invalid_lines @qt>=5.9
|
|
|
|
Scenario: Renderer kill (5.9)
|
|
|
|
When I run :open -t chrome://kill
|
|
|
|
Then "Renderer process was killed" should be logged
|
|
|
|
And "* 'Error loading chrome://kill/'" should be logged
|
|
|
|
|
2017-02-08 10:55:42 +01:00
|
|
|
# https://github.com/qutebrowser/qutebrowser/issues/2290
|
|
|
|
@qtwebkit_skip @no_invalid_lines
|
|
|
|
Scenario: Navigating to URL after renderer process is gone
|
|
|
|
When I run :tab-only
|
|
|
|
And I open data/numbers/1.txt
|
|
|
|
And I open data/numbers/2.txt in a new tab
|
|
|
|
And I run :open chrome://kill
|
|
|
|
And I wait for "Renderer process was killed" in the log
|
|
|
|
And I open data/numbers/3.txt
|
|
|
|
Then no crash should happen
|