Adjust test settings

This commit is contained in:
Florian Bruhin 2017-06-16 16:22:41 +02:00
parent c2a2845ee7
commit d0904a9f67
39 changed files with 404 additions and 409 deletions

View File

@ -27,7 +27,7 @@ import configparser
from PyQt5.QtCore import pyqtSignal, QObject, QUrl, QSettings
from qutebrowser.config import configdata, configexc, configtypes
from qutebrowser.utils import utils, objreg, message, standarddir
from qutebrowser.utils import utils, objreg, message, standarddir, log
from qutebrowser.commands import cmdexc, cmdutils
@ -262,6 +262,7 @@ class NewConfigManager(QObject):
raise configexc.NoOptionError(name)
self._values[name] = opt.typ.from_str(value)
self.changed.emit(name)
log.config.debug("Config option changed: {} = {}".format(name, value))
def dump_userconfig(self):
"""Get the part of the config which was changed by the user.

View File

@ -284,21 +284,21 @@ Feature: Caret mode
Then no crash should happen
Scenario: :follow-selected with link (with JS)
When I set content -> allow-javascript to true
When I set content.javascript.enabled to true
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)
When I set content -> allow-javascript to false
When I set content.javascript.enabled to false
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 --tab (with JS)
When I set content -> allow-javascript to true
When I set content.javascript.enabled to true
And I run :tab-only
And I run :enter-mode caret
And I run :toggle-selection
@ -310,7 +310,7 @@ Feature: Caret mode
- data/hello.txt (active)
Scenario: :follow-selected with --tab (without JS)
When I set content -> allow-javascript to false
When I set content.javascript.enabled to false
And I run :tab-only
And I run :enter-mode caret
And I run :toggle-selection

View File

@ -60,17 +60,19 @@ Feature: Using completion
And I run :command-accept
Then the error "Session hello not found!" should be shown
Scenario: Using option completion
When I run :set-cmd-text -s :set colors
Then the completion model should be SettingOptionCompletionModel
# FIXME:conf
Scenario: Using value completion
When I run :set-cmd-text -s :set colors statusbar.bg
Then the completion model should be SettingValueCompletionModel
# Scenario: Using option completion
# When I run :set-cmd-text -s :set colors
# Then the completion model should be SettingOptionCompletionModel
# Scenario: Using value completion
# When I run :set-cmd-text -s :set colors statusbar.bg
# Then the completion model should be SettingValueCompletionModel
Scenario: Updating the completion in realtime
Given I have a fresh instance
And I set completion -> quick-complete to false
And I set completion.quick to false
When I open data/hello.txt
And I run :set-cmd-text -s :buffer
And I run :completion-item-focus next
@ -85,12 +87,12 @@ Feature: Using completion
- data/hello3.txt (active)
Scenario: Updating the value completion in realtime
Given I set colors -> statusbar.bg to green
Given I set colors.statusbar.bg to green
When I run :set-cmd-text -s :set colors statusbar.bg
And I set colors -> statusbar.bg to yellow
And I set colors.statusbar.bg to yellow
And I run :completion-item-focus next
And I run :completion-item-focus next
And I set colors -> statusbar.bg to red
And I set colors.statusbar.bg to red
And I run :command-accept
Then colors -> statusbar.bg should be yellow

View File

@ -115,8 +115,8 @@ def pytest_runtest_makereport(item, call):
## Given
@bdd.given(bdd.parsers.parse("I set {sect} -> {opt} to {value}"))
def set_setting_given(quteproc, httpbin, sect, opt, value):
@bdd.given(bdd.parsers.parse("I set {opt} to {value}"))
def set_setting_given(quteproc, httpbin, opt, value):
"""Set a qutebrowser setting.
This is available as "Given:" step so it can be used as "Background:".
@ -124,7 +124,7 @@ def set_setting_given(quteproc, httpbin, sect, opt, value):
if value == '<empty>':
value = ''
value = value.replace('(port)', str(httpbin.port))
quteproc.set_setting(sect, opt, value)
quteproc.set_setting(opt, value)
@bdd.given(bdd.parsers.parse("I open {path}"))
@ -157,7 +157,7 @@ def fresh_instance(quteproc):
@bdd.given("I clean up open tabs")
def clean_open_tabs(quteproc):
"""Clean up open windows and tabs."""
quteproc.set_setting('tabs', 'last-close', 'blank')
quteproc.set_setting('tabs.last_close', 'blank')
quteproc.send_cmd(':window-only')
quteproc.send_cmd(':tab-only --force')
quteproc.send_cmd(':tab-close --force')
@ -226,13 +226,13 @@ def open_path(quteproc, httpbin, path):
wait=wait)
@bdd.when(bdd.parsers.parse("I set {sect} -> {opt} to {value}"))
def set_setting(quteproc, httpbin, sect, opt, value):
@bdd.when(bdd.parsers.parse("I set {opt} to {value}"))
def set_setting(quteproc, httpbin, opt, value):
"""Set a qutebrowser setting."""
if value == '<empty>':
value = ''
value = value.replace('(port)', str(httpbin.port))
quteproc.set_setting(sect, opt, value)
quteproc.set_setting(opt, value)
@bdd.when(bdd.parsers.parse("I run {command}"))

View File

@ -5,25 +5,25 @@ Feature: Downloading things from a website.
Background:
Given I set up a temporary download dir
And I clean old downloads
And I set ui -> remove-finished-downloads to -1
And I set downloads.remove_finished to -1
## starting downloads
Scenario: Clicking an unknown link
When I set storage -> prompt-download-directory to false
When I set downloads.location.prompt to false
And I open data/downloads/downloads.html
And I run :click-element id download
And I wait until the download is finished
Then the downloaded file download.bin should exist
Scenario: Using :download
When I set storage -> prompt-download-directory to false
When I set downloads.location.prompt to false
When I run :download http://localhost:(port)/data/downloads/download.bin
And I wait until the download is finished
Then the downloaded file download.bin should exist
Scenario: Using hints
When I set storage -> prompt-download-directory to false
When I set downloads.location.prompt to false
And I open data/downloads/downloads.html
And I hint with args "links download" and follow a
And I wait until the download is finished
@ -31,7 +31,7 @@ Feature: Downloading things from a website.
Scenario: Using rapid hints
# We don't expect any prompts with rapid hinting even if this is true
When I set storage -> prompt-download-directory to true
When I set downloads.location.prompt to true
And I open data/downloads/downloads.html
And I hint with args "--rapid links download" and follow a
And I run :follow-hint s
@ -43,7 +43,7 @@ Feature: Downloading things from a website.
## Regression tests
Scenario: Downloading which redirects with closed tab (issue 889)
When I set tabs -> last-close to blank
When I set tabs.last_close to blank
And I open data/downloads/issue889.html
And I hint with args "links download" and follow a
And I run :tab-close
@ -51,7 +51,7 @@ Feature: Downloading things from a website.
Then no crash should happen
Scenario: Downloading with error in closed tab (issue 889)
When I set tabs -> last-close to blank
When I set tabs.last_close to blank
And I open data/downloads/issue889.html
And I hint with args "links download" and follow s
And I run :tab-close
@ -61,16 +61,16 @@ Feature: Downloading things from a website.
Then no crash should happen
Scenario: Downloading a link without path information (issue 1243)
When I set completion -> download-path-suggestion to filename
And I set storage -> prompt-download-directory to true
When I set downloads.location.suggestion to filename
And I set downloads.location.prompt to true
And I open data/downloads/issue1243.html
And I hint with args "links download" and follow a
And I wait for "Asking question <qutebrowser.utils.usertypes.Question default='qutebrowser-download' mode=<PromptMode.download: 5> text=* title='Save file to:'>, *" in the log
Then the error "Download error: No handler found for qute://!" should be shown
Scenario: Downloading a data: link (issue 1214)
When I set completion -> download-path-suggestion to filename
And I set storage -> prompt-download-directory to true
When I set downloads.location.suggestion to filename
And I set downloads.location.prompt to true
And I open data/data_link.html
And I hint with args "links download" and follow a
And I wait for "Asking question <qutebrowser.utils.usertypes.Question default='binary blob' mode=<PromptMode.download: 5> text=* title='Save file to:'>, *" in the log
@ -79,15 +79,15 @@ Feature: Downloading things from a website.
Scenario: Downloading with SSL errors (issue 1413)
When I clear SSL errors
And I set network -> ssl-strict to ask
And I set storage -> prompt-download-directory to false
And I set content.ssl_strict to ask
And I set downloads.location.prompt to false
And I download an SSL page
And I wait for "Entering mode KeyMode.* (reason: question asked)" in the log
And I run :prompt-accept
Then the error "Download error: SSL handshake failed" should be shown
Scenario: Closing window with remove-finished-downloads timeout (issue 1242)
When I set ui -> remove-finished-downloads to 500
When I set downloads.remove_finished to 500
And I open data/downloads/download.bin in a new window without waiting
And I wait until the download is finished
And I run :close
@ -96,8 +96,8 @@ Feature: Downloading things from a website.
Scenario: Quitting with finished downloads and confirm-quit=downloads (issue 846)
Given I have a fresh instance
When I set storage -> prompt-download-directory to false
And I set ui -> confirm-quit to downloads
When I set downloads.location.prompt to false
And I set confirm_quit to downloads
And I open data/downloads/download.bin without waiting
And I wait until the download is finished
And I run :close
@ -106,7 +106,7 @@ Feature: Downloading things from a website.
# https://github.com/qutebrowser/qutebrowser/issues/2134
@qtwebengine_skip
Scenario: Downloading, then closing a tab
When I set storage -> prompt-download-directory to false
When I set downloads.location.prompt to false
And I open about:blank
And I open data/downloads/issue2134.html in a new tab
# This needs to be a download connected to the tabs QNAM
@ -139,7 +139,7 @@ Feature: Downloading things from a website.
@windows
Scenario: Downloading a file to a reserved path
When I set storage -> prompt-download-directory to true
When I set downloads.location.prompt to true
And I open data/downloads/download.bin without waiting
And I wait for "Asking question <qutebrowser.utils.usertypes.Question default='*' mode=<PromptMode.download: 5> text='Please enter a location for <b>http://localhost:*/data/downloads/download.bin</b>' title='Save file to:'>, *" in the log
And I run :prompt-accept COM1
@ -148,7 +148,7 @@ Feature: Downloading things from a website.
@windows
Scenario: Downloading a file to a drive-relative working directory
When I set storage -> prompt-download-directory to true
When I set downloads.location.prompt to true
And I open data/downloads/download.bin without waiting
And I wait for "Asking question <qutebrowser.utils.usertypes.Question default='*' mode=<PromptMode.download: 5> text='Please enter a location for <b>http://localhost:*/data/downloads/download.bin</b>' title='Save file to:'>, *" in the log
And I run :prompt-accept C:foobar
@ -259,7 +259,7 @@ Feature: Downloading things from a website.
@qtwebengine_skip: https://github.com/qutebrowser/qutebrowser/issues/2288
Scenario: Overwriting existing mhtml file
When I set storage -> prompt-download-directory to true
When I set downloads.location.prompt to true
And I open data/title.html
And I run :download --mhtml
And I wait for "Asking question <qutebrowser.utils.usertypes.Question default='*' mode=<PromptMode.download: 5> text='Please enter a location for <b>http://localhost:*/data/title.html</b>' title='Save file to:'>, *" in the log
@ -274,7 +274,7 @@ Feature: Downloading things from a website.
Then the downloaded file Test title.mhtml should exist
Scenario: Opening a mhtml download directly
When I set storage -> prompt-download-directory to true
When I set downloads.location.prompt to true
And I open html
And I run :download --mhtml
And I wait for the download prompt for "*"
@ -407,7 +407,7 @@ Feature: Downloading things from a website.
Then "Opening *download.bin* with [*python*]" should be logged
Scenario: Opening a download with default-open-dispatcher set and override
When I set general -> default-open-dispatcher to cat
When I set downloads.open_dispatcher to cat
And I open data/downloads/download.bin without waiting
And I wait until the download is finished
And I open the download
@ -430,7 +430,7 @@ Feature: Downloading things from a website.
## opening a file directly (prompt-open-download)
Scenario: Opening a download directly
When I set storage -> prompt-download-directory to true
When I set downloads.location.prompt to true
And I open data/downloads/download.bin without waiting
And I wait for the download prompt for "*"
And I directly open the download
@ -440,7 +440,7 @@ Feature: Downloading things from a website.
# https://github.com/qutebrowser/qutebrowser/issues/1728
Scenario: Cancelling a download that should be opened
When I set storage -> prompt-download-directory to true
When I set downloads.location.prompt to true
And I run :download http://localhost:(port)/drip?numbytes=128&duration=5
And I wait for the download prompt for "*"
And I directly open the download
@ -450,7 +450,7 @@ Feature: Downloading things from a website.
# https://github.com/qutebrowser/qutebrowser/issues/1725
Scenario: Directly open a download with a very long filename
When I set storage -> prompt-download-directory to true
When I set downloads.location.prompt to true
And I open data/downloads/issue1725.html
And I run :click-element id long-link
And I wait for the download prompt for "*"
@ -458,32 +458,32 @@ Feature: Downloading things from a website.
And I wait until the download is finished
Then "Opening * with [*python*]" should be logged
## completion -> download-path-suggestion
## downloads.location.suggestion
Scenario: completion -> download-path-suggestion = path
When I set storage -> prompt-download-directory to true
And I set completion -> download-path-suggestion to path
Scenario: downloads.location.suggestion = path
When I set downloads.location.prompt to true
And I set downloads.location.suggestion to path
And I open data/downloads/download.bin without waiting
Then the download prompt should be shown with "(tmpdir)/downloads/"
Scenario: completion -> download-path-suggestion = filename
When I set storage -> prompt-download-directory to true
And I set completion -> download-path-suggestion to filename
Scenario: downloads.location.suggestion = filename
When I set downloads.location.prompt to true
And I set downloads.location.suggestion to filename
And I open data/downloads/download.bin without waiting
Then the download prompt should be shown with "download.bin"
Scenario: completion -> download-path-suggestion = both
When I set storage -> prompt-download-directory to true
And I set completion -> download-path-suggestion to both
Scenario: downloads.location.suggestion = both
When I set downloads.location.prompt to true
And I set downloads.location.suggestion to both
And I open data/downloads/download.bin without waiting
Then the download prompt should be shown with "(tmpdir)/downloads/download.bin"
## storage -> remember-download-directory
## downloads.location.remember
Scenario: Remembering the last download directory
When I set storage -> prompt-download-directory to true
And I set completion -> download-path-suggestion to both
And I set storage -> remember-download-directory to true
When I set downloads.location.prompt to true
And I set downloads.location.suggestion to both
And I set downloads.location.remember to true
And I open data/downloads/download.bin without waiting
And I wait for the download prompt for "*/download.bin"
And I run :prompt-accept (tmpdir)(dirsep)downloads(dirsep)subdir
@ -491,9 +491,9 @@ Feature: Downloading things from a website.
Then the download prompt should be shown with "(tmpdir)/downloads/subdir/download2.bin"
Scenario: Not remembering the last download directory
When I set storage -> prompt-download-directory to true
And I set completion -> download-path-suggestion to both
And I set storage -> remember-download-directory to false
When I set downloads.location.prompt to true
And I set downloads.location.suggestion to both
And I set downloads.location.remember to false
And I open data/downloads/download.bin without waiting
And I wait for the download prompt for "(tmpdir)/downloads/download.bin"
And I run :prompt-accept (tmpdir)(dirsep)downloads(dirsep)subdir
@ -503,9 +503,9 @@ Feature: Downloading things from a website.
# https://github.com/qutebrowser/qutebrowser/issues/2173
Scenario: Remembering the temporary download directory (issue 2173)
When I set storage -> prompt-download-directory to true
And I set completion -> download-path-suggestion to both
And I set storage -> remember-download-directory to true
When I set downloads.location.prompt to true
And I set downloads.location.suggestion to both
And I set downloads.location.remember to true
And I open data/downloads/download.bin without waiting
And I wait for the download prompt for "*"
And I run :prompt-accept (tmpdir)(dirsep)downloads
@ -518,7 +518,7 @@ Feature: Downloading things from a website.
# Overwriting files
Scenario: Not overwriting an existing file
When I set storage -> prompt-download-directory to false
When I set downloads.location.prompt to false
And I run :download http://localhost:(port)/data/downloads/download.bin
And I wait until the download is finished
And I run :download http://localhost:(port)/data/downloads/download2.bin --dest download.bin
@ -527,7 +527,7 @@ Feature: Downloading things from a website.
Then the downloaded file download.bin should be 1 bytes big
Scenario: Overwriting an existing file
When I set storage -> prompt-download-directory to false
When I set downloads.location.prompt to false
And I run :download http://localhost:(port)/data/downloads/download.bin
And I wait until the download is finished
And I run :download http://localhost:(port)/data/downloads/download2.bin --dest download.bin
@ -538,7 +538,7 @@ Feature: Downloading things from a website.
@linux
Scenario: Not overwriting a special file
When I set storage -> prompt-download-directory to false
When I set downloads.location.prompt to false
And I run :download http://localhost:(port)/data/downloads/download.bin --dest fifo
And I wait for "Entering mode KeyMode.yesno *" in the log
And I run :prompt-accept no
@ -547,26 +547,26 @@ Feature: Downloading things from a website.
## Redirects
Scenario: Downloading with infinite redirect
When I set storage -> prompt-download-directory to false
When I set downloads.location.prompt to false
And I run :download http://localhost:(port)/redirect/12 --dest redirection
Then the error "Download error: Maximum redirection count reached!" should be shown
And "Deleted *redirection" should be logged
And the downloaded file redirection should not exist
Scenario: Downloading with redirect to itself
When I set storage -> prompt-download-directory to false
When I set downloads.location.prompt to false
And I run :download http://localhost:(port)/custom/redirect-self
And I wait until the download is finished
Then the downloaded file redirect-self should exist
Scenario: Downloading with absolute redirect
When I set storage -> prompt-download-directory to false
When I set downloads.location.prompt to false
And I run :download http://localhost:(port)/absolute-redirect/1
And I wait until the download is finished
Then the downloaded file 1 should exist
Scenario: Downloading with relative redirect
When I set storage -> prompt-download-directory to false
When I set downloads.location.prompt to false
And I run :download http://localhost:(port)/relative-redirect/1
And I wait until the download is finished
Then the downloaded file 1 should exist
@ -574,25 +574,25 @@ Feature: Downloading things from a website.
## Other
Scenario: Download without a content-size
When I set storage -> prompt-download-directory to false
When I set downloads.location.prompt to false
When I run :download http://localhost:(port)/custom/content-size
And I wait until the download is finished
Then the downloaded file content-size should exist
@posix
Scenario: Downloading to unwritable destination
When I set storage -> prompt-download-directory to false
When I set downloads.location.prompt to false
And I run :download http://localhost:(port)/data/downloads/download.bin --dest (tmpdir)/downloads/unwritable
Then the error "Download error: Permission denied" should be shown
Scenario: Downloading 20MB file
When I set storage -> prompt-download-directory to false
When I set downloads.location.prompt to false
And I run :download http://localhost:(port)/custom/twenty-mb
And I wait until the download is finished
Then the downloaded file twenty-mb should be 20971520 bytes big
Scenario: Downloading 20MB file with late prompt confirmation
When I set storage -> prompt-download-directory to true
When I set downloads.location.prompt to true
And I run :download http://localhost:(port)/custom/twenty-mb
And I wait 1s
And I run :prompt-accept
@ -600,16 +600,16 @@ Feature: Downloading things from a website.
Then the downloaded file twenty-mb should be 20971520 bytes big
Scenario: Downloading invalid URL
When I set storage -> prompt-download-directory to false
And I set general -> auto-search to false
When I set downloads.location.prompt to false
And I set auto_search to false
And I run :download foo!
Then the error "Invalid URL" should be shown
@qtwebengine_todo: pdfjs is not implemented yet
Scenario: Downloading via pdfjs
Given pdfjs is available
When I set storage -> prompt-download-directory to false
And I set content -> enable-pdfjs to true
When I set downloads.location.prompt to false
And I set content.enable_pdfjs to true
And I open data/misc/test.pdf
And I wait for the javascript message "PDF * [*] (PDF.js: *)"
And I run :click-element id download
@ -617,7 +617,7 @@ Feature: Downloading things from a website.
Then the downloaded file test.pdf should exist
Scenario: Answering a question for a cancelled download (#415)
When I set storage -> prompt-download-directory to true
When I set downloads.location.prompt to true
And I run :download http://localhost:(port)/data/downloads/download.bin
And I wait for "Asking question <qutebrowser.utils.usertypes.Question default='*' mode=<PromptMode.download: 5> text=* title='Save file to:'>, *" in the log
And I run :download http://localhost:(port)/data/downloads/download2.bin
@ -629,7 +629,7 @@ Feature: Downloading things from a website.
And the downloaded file download2.bin should not exist
Scenario: Downloading a file with unknown size
When I set storage -> prompt-download-directory to false
When I set downloads.location.prompt to false
And I open stream-bytes/1024 without waiting
And I wait until the download is finished
Then the downloaded file 1024 should exist
@ -643,7 +643,7 @@ Feature: Downloading things from a website.
@qtwebengine_skip: We can't get the UA from the page there
Scenario: user-agent when using hints
When I set hints -> mode to number
When I set hints.mode to number
And I open /
And I run :hint links download
And I press the keys "us" # user-agent
@ -653,6 +653,6 @@ Feature: Downloading things from a website.
@qtwebengine_skip: Handled by QtWebEngine, not by us
Scenario: Downloading a "Internal server error" with disposition: inline (#2304)
When I set storage -> prompt-download-directory to false
When I set downloads.location.prompt to false
And I open custom/500-inline
Then the error "Download error: *INTERNAL SERVER ERROR" should be shown

View File

@ -54,7 +54,7 @@ Feature: Opening external editors
Then the error "Only one of -t/-b/-w can be given!" should be shown
Scenario: Editing a URL with invalid URL
When I set general -> auto-search to false
When I set auto_search to false
And I open data/hello.txt
And I set up a fake editor replacing "http://localhost:(port)/data/hello.txt" by "foo!"
And I run :edit-url

View File

@ -197,7 +197,7 @@ Feature: Using hints
Then the error "No elements found." should be shown
Scenario: Clicking input with existing text
When I set general -> log-javascript-console to info
When I set content.javascript.log to info
And I open data/hints/input.html
And I run :click-element id qute-input-existing
And I wait for "Entering mode KeyMode.insert *" in the log
@ -241,12 +241,12 @@ Feature: Using hints
And I hint with args "all current" and follow a
Then no crash should happen
### hints -> auto-follow-timeout
### hints.auto_follow-timeout
@not_osx
Scenario: Ignoring key presses after auto-following hints
When I set hints -> auto-follow-timeout to 1000
And I set hints -> mode to number
When I set hints.auto_follow_timeout to 1000
And I set hints.mode to number
And I run :bind --force , message-error "This error message was triggered via a keybinding which should have been inhibited"
And I open data/hints/html/simple.html
And I hint with args "all"
@ -258,8 +258,8 @@ Feature: Using hints
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
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 hint with args "all"
@ -272,7 +272,7 @@ Feature: Using hints
Scenario: Hinting with a too short dictionary
When I open data/hints/short_dict.html
And I set hints -> mode to word
And I set hints.mode to word
# Test letter fallback
And I hint with args "all" and follow d
Then the error "Not enough words in the dictionary." should be shown
@ -280,8 +280,8 @@ Feature: Using hints
Scenario: Dictionary file does not exist
When I open data/hints/html/simple.html
And I set hints -> dictionary to no_words
And I set hints -> mode to word
And I set hints.dictionary to no_words
And I set hints.mode to word
And I run :hint
And I wait for "hints: *" in the log
And I press the key "a"
@ -293,7 +293,7 @@ Feature: Using hints
# https://github.com/qutebrowser/qutebrowser/issues/308
Scenario: Renumbering hints when filtering
When I open data/hints/number.html
And I set hints -> mode to number
And I set hints.mode to number
And I hint with args "all"
And I press the key "s"
And I run :follow-hint 1
@ -303,7 +303,7 @@ Feature: Using hints
@qtwebengine_flaky
Scenario: Keeping hint filter in rapid mode
When I open data/hints/number.html
And I set hints -> mode to number
And I set hints.mode to number
And I hint with args "all tab-bg --rapid"
And I press the key "t"
And I run :follow-hint 0
@ -314,7 +314,7 @@ Feature: Using hints
# https://github.com/qutebrowser/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 set hints.mode to number
And I hint with args "all"
And I press the key "x"
And I press the key "0"
@ -325,24 +325,24 @@ Feature: Using hints
# https://github.com/qutebrowser/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 unique-match
And I set hints -> auto-follow-timeout to 0
And I set hints.mode to number
And I set hints.auto_follow to unique-match
And I set hints.auto_follow_timeout to 0
And I hint with args "all"
And I press the keys "ten pos"
Then data/numbers/11.txt should be loaded
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 set hints.mode to number
And I set hints.scatter to true
And I hint with args "all" and follow 00
Then data/numbers/1.txt should be loaded
# https://github.com/qutebrowser/qutebrowser/issues/1559
Scenario: Filtering all hints in number mode
When I open data/hints/number.html
And I set hints -> mode to number
And I set hints.mode to number
And I hint with args "all"
And I press the key "2"
And I wait for "Leaving mode KeyMode.hint (reason: all filtered)" in the log
@ -351,7 +351,7 @@ Feature: Using hints
# https://github.com/qutebrowser/qutebrowser/issues/1657
Scenario: Using rapid number hinting twice
When I open data/hints/number.html
And I set hints -> mode to number
And I set hints.mode to number
And I hint with args "--rapid"
And I run :leave-mode
And I hint with args "--rapid" and follow 00
@ -359,7 +359,7 @@ Feature: Using hints
Scenario: Using a specific hints mode
When I open data/hints/number.html
And I set hints -> mode to letter
And I set hints.mode to letter
And I hint with args "--mode number all"
And I press the key "s"
And I run :follow-hint 1
@ -367,128 +367,128 @@ Feature: Using hints
### auto-follow option
Scenario: Using hints -> auto-follow == 'always' in letter mode
Scenario: Using hints.auto_follow = 'always' in letter mode
When I open data/hints/html/simple.html
And I set hints -> mode to letter
And I set hints -> auto-follow to always
And I set hints.mode to letter
And I set hints.auto_follow to always
And I hint with args "all"
Then data/hello.txt should be loaded
# unique-match is actually the same as full-match in letter mode
Scenario: Using hints -> auto-follow == 'unique-match' in letter mode
Scenario: Using hints.auto_follow = 'unique-match' in letter mode
When I open data/hints/html/simple.html
And I set hints -> mode to letter
And I set hints -> auto-follow to unique-match
And I set hints.mode to letter
And I set hints.auto_follow to unique-match
And I hint with args "all"
And I press the key "a"
Then data/hello.txt should be loaded
Scenario: Using hints -> auto-follow == 'full-match' in letter mode
Scenario: Using hints.auto_follow = 'full-match' in letter mode
When I open data/hints/html/simple.html
And I set hints -> mode to letter
And I set hints -> auto-follow to full-match
And I set hints.mode to letter
And I set hints.auto_follow to full-match
And I hint with args "all"
And I press the key "a"
Then data/hello.txt should be loaded
Scenario: Using hints -> auto-follow == 'never' without Enter in letter mode
Scenario: Using hints.auto_follow = 'never' without Enter in letter mode
When I open data/hints/html/simple.html
And I set hints -> mode to letter
And I set hints -> auto-follow to never
And I set hints.mode to letter
And I set hints.auto_follow to never
And I hint with args "all"
And I press the key "a"
Then "Leaving mode KeyMode.hint (reason: followed)" should not be logged
Scenario: Using hints -> auto-follow == 'never' in letter mode
Scenario: Using hints.auto_follow = 'never' in letter mode
When I open data/hints/html/simple.html
And I set hints -> mode to letter
And I set hints -> auto-follow to never
And I set hints.mode to letter
And I set hints.auto_follow to never
And I hint with args "all"
And I press the key "a"
And I press the key "<Enter>"
Then data/hello.txt should be loaded
Scenario: Using hints -> auto-follow == 'always' in number mode
Scenario: Using hints.auto_follow = 'always' in number mode
When I open data/hints/html/simple.html
And I set hints -> mode to number
And I set hints -> auto-follow to always
And I set hints.mode to number
And I set hints.auto_follow to always
And I hint with args "all"
Then data/hello.txt should be loaded
Scenario: Using hints -> auto-follow == 'unique-match' in number mode
Scenario: Using hints.auto_follow = 'unique-match' in number mode
When I open data/hints/html/simple.html
And I set hints -> mode to number
And I set hints -> auto-follow to unique-match
And I set hints.mode to number
And I set hints.auto_follow to unique-match
And I hint with args "all"
And I press the key "f"
Then data/hello.txt should be loaded
Scenario: Using hints -> auto-follow == 'full-match' in number mode
Scenario: Using hints.auto_follow = 'full-match' in number mode
When I open data/hints/html/simple.html
And I set hints -> mode to number
And I set hints -> auto-follow to full-match
And I set hints.mode to number
And I set hints.auto_follow to full-match
And I hint with args "all"
# this actually presses the keys one by one
And I press the key "follow me!"
Then data/hello.txt should be loaded
Scenario: Using hints -> auto-follow == 'never' without Enter in number mode
Scenario: Using hints.auto_follow = 'never' without Enter in number mode
When I open data/hints/html/simple.html
And I set hints -> mode to number
And I set hints -> auto-follow to never
And I set hints.mode to number
And I set hints.auto_follow to never
And I hint with args "all"
# this actually presses the keys one by one
And I press the key "follow me!"
Then "Leaving mode KeyMode.hint (reason: followed)" should not be logged
Scenario: Using hints -> auto-follow == 'never' in number mode
Scenario: Using hints.auto_follow = 'never' in number mode
When I open data/hints/html/simple.html
And I set hints -> mode to number
And I set hints -> auto-follow to never
And I set hints.mode to number
And I set hints.auto_follow to never
And I hint with args "all"
# this actually presses the keys one by one
And I press the key "follow me!"
And I press the key "<Enter>"
Then data/hello.txt should be loaded
Scenario: Using hints -> auto-follow == 'always' in word mode
Scenario: Using hints.auto_follow = 'always' in word mode
When I open data/hints/html/simple.html
And I set hints -> mode to word
And I set hints -> auto-follow to always
And I set hints.mode to word
And I set hints.auto_follow to always
And I hint with args "all"
Then data/hello.txt should be loaded
Scenario: Using hints -> auto-follow == 'unique-match' in word mode
Scenario: Using hints.auto_follow = 'unique-match' in word mode
When I open data/hints/html/simple.html
And I set hints -> mode to word
And I set hints -> auto-follow to unique-match
And I set hints.mode to word
And I set hints.auto_follow to unique-match
And I hint with args "all"
# the link gets "hello" as the hint
And I press the key "h"
Then data/hello.txt should be loaded
Scenario: Using hints -> auto-follow == 'full-match' in word mode
Scenario: Using hints.auto_follow = 'full-match' in word mode
When I open data/hints/html/simple.html
And I set hints -> mode to word
And I set hints -> auto-follow to full-match
And I set hints.mode to word
And I set hints.auto_follow to full-match
And I hint with args "all"
# this actually presses the keys one by one
And I press the key "hello"
Then data/hello.txt should be loaded
Scenario: Using hints -> auto-follow == 'never' without Enter in word mode
Scenario: Using hints.auto_follow = 'never' without Enter in word mode
When I open data/hints/html/simple.html
And I set hints -> mode to word
And I set hints -> auto-follow to never
And I set hints.mode to word
And I set hints.auto_follow to never
And I hint with args "all"
# this actually presses the keys one by one
And I press the key "hello"
Then "Leaving mode KeyMode.hint (reason: followed)" should not be logged
Scenario: Using hints -> auto-follow == 'never' in word mode
Scenario: Using hints.auto_follow = 'never' in word mode
When I open data/hints/html/simple.html
And I set hints -> mode to word
And I set hints -> auto-follow to never
And I set hints.mode to word
And I set hints.auto_follow to never
And I hint with args "all"
# this actually presses the keys one by one
And I press the key "hello"

View File

@ -109,7 +109,7 @@ Feature: Page history
@qtwebengine_skip @qtwebkit_ng_skip
Scenario: Opening a valid URL which turns out invalid
When I set general -> auto-search to true
When I set auto_search to true
And I run :open http://foo%40bar@baz
Then "QFSFileEngine::open: No file name specified" should be logged
And "Error while loading : Host not found" should be logged

View File

@ -7,7 +7,7 @@ Feature: Invoking a new process
Given I clean up open tabs
Scenario: Using new-instance-open-target = tab
When I set general -> new-instance-open-target to tab
When I set new_instance_open_target to tab
And I open data/title.html
And I open data/search.html as a URL
Then the following tabs should be open:
@ -15,7 +15,7 @@ Feature: Invoking a new process
- data/search.html (active)
Scenario: Using new-instance-open-target = tab-bg
When I set general -> new-instance-open-target to tab-bg
When I set new_instance_open_target to tab-bg
And I open data/title.html
And I open data/search.html as a URL
Then the following tabs should be open:
@ -23,7 +23,7 @@ Feature: Invoking a new process
- data/search.html
Scenario: Using new-instance-open-target = window
When I set general -> new-instance-open-target to window
When I set new_instance_open_target to window
And I open data/title.html
And I open data/search.html as a URL
Then the session should look like:
@ -36,9 +36,9 @@ Feature: Invoking a new process
- history:
- url: http://localhost:*/data/search.html
Scenario: Using new-instance-open-target.window = last-opened
When I set general -> new-instance-open-target to tab
And I set general -> new-instance-open-target.window to last-opened
Scenario: Using new-instance-open-target_window = last-opened
When I set new_instance_open_target to tab
And I set new_instance_open_target_window to last-opened
And I open data/title.html
And I open data/search.html in a new window
And I open data/hello.txt as a URL
@ -54,9 +54,9 @@ Feature: Invoking a new process
- history:
- url: http://localhost:*/data/hello.txt
Scenario: Using new-instance-open-target.window = first-opened
When I set general -> new-instance-open-target to tab
And I set general -> new-instance-open-target.window to first-opened
Scenario: Using new-instance-open-target_window = first-opened
When I set new_instance_open_target to tab
And I set new_instance_open_target_window to first-opened
And I open data/title.html
And I open data/search.html in a new window
And I open data/hello.txt as a URL
@ -74,9 +74,9 @@ Feature: Invoking a new process
# issue #1060
Scenario: Using target.window = first-opened after tab-detach
When I set general -> new-instance-open-target to tab
And I set general -> new-instance-open-target.window to first-opened
Scenario: Using target_window = first-opened after tab-detach
When I set new_instance_open_target to tab
And I set new_instance_open_target_window to first-opened
And I open data/title.html
And I open data/search.html in a new tab
And I run :tab-detach
@ -95,8 +95,8 @@ Feature: Invoking a new process
- url: http://localhost:*/data/search.html
Scenario: Opening a new qutebrowser instance with no parameters
When I set general -> new-instance-open-target to tab
And I set general -> startpage to http://localhost:(port)/data/hello.txt
When I set new_instance_open_target to tab
And I set start_page to http://localhost:(port)/data/hello.txt
And I open data/title.html
And I spawn a new window
And I wait until data/hello.txt is loaded

View File

@ -5,7 +5,7 @@ Feature: Javascript stuff
Integration with javascript.
Scenario: Using console.log
When I set general -> log-javascript-console to debug
When I set content.javascript.log to debug
And I open data/javascript/consolelog.html
Then the javascript message "console.log works!" should be logged
@ -57,20 +57,20 @@ Feature: Javascript stuff
Scenario: Opening window without user interaction with javascript-can-open-windows-automatically set to true
When I open data/hello.txt
And I set content -> javascript-can-open-windows-automatically to true
And I set content.javascript_can_open_windows_automatically to true
And I run :tab-only
And I run :jseval if (window.open('about:blank')) { console.log('window opened'); } else { console.log('error while opening window'); }
Then the javascript message "window opened" should be logged
Scenario: Opening window without user interaction with javascript-can-open-windows-automatically set to false
When I open data/hello.txt
And I set content -> javascript-can-open-windows-automatically to false
And I set content.javascript_can_open_windows_automatically to false
And I run :tab-only
And I run :jseval if (window.open('about:blank')) { console.log('window opened'); } else { console.log('error while opening window'); }
Then the javascript message "error while opening window" should be logged
Scenario: Executing jseval when javascript is disabled
When I set content -> allow-javascript to false
When I set content.javascript.enabled to false
And I run :jseval console.log('jseval executed')
And I set content -> allow-javascript to true
Then the javascript message "jseval executed" should be logged

View File

@ -121,8 +121,8 @@ Feature: Keyboard input
Scenario: Forwarding all keys
When I open data/keyinput/log.html
And I set general -> log-javascript-console to info
And I set input -> forward-unbound-keys to all
And I set content.javascript.log to info
And I set input.forward_unbound_keys to all
And I press the key ","
And I press the key "<F1>"
# ,
@ -134,8 +134,8 @@ Feature: Keyboard input
Scenario: Forwarding special keys
When I open data/keyinput/log.html
And I set general -> log-javascript-console to info
And I set input -> forward-unbound-keys to auto
And I set content.javascript.log to info
And I set input.forward_unbound_keys to auto
And I press the key "x"
And I press the key "<F1>"
# <F1>
@ -147,8 +147,8 @@ Feature: Keyboard input
Scenario: Forwarding no keys
When I open data/keyinput/log.html
And I set general -> log-javascript-console to info
And I set input -> forward-unbound-keys to none
And I set content.javascript.log to info
And I set input.forward_unbound_keys to none
And I press the key "<F1>"
# <F1>
Then the javascript message "key press: 112" should not be logged
@ -161,7 +161,7 @@ Feature: Keyboard input
Then the error "Could not parse 'blub': Got unknown key." should be shown
Scenario: :fake-key sending key to the website
When I set general -> log-javascript-console to info
When I set content.javascript.log to info
And I open data/keyinput/log.html
And I run :fake-key x
Then the javascript message "key press: 88" should be logged
@ -170,7 +170,7 @@ Feature: Keyboard input
@no_xvfb @posix @qtwebengine_skip
Scenario: :fake-key sending key to the website with other window focused
When I open data/keyinput/log.html
And I set general -> developer-extras to true
And I set content.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 :fake-key x
@ -179,14 +179,14 @@ Feature: Keyboard input
Then the error "No focused webview!" should be shown
Scenario: :fake-key sending special key to the website
When I set general -> log-javascript-console to info
When I set content.javascript.log to info
And I open data/keyinput/log.html
And I run :fake-key <Escape>
Then the javascript message "key press: 27" should be logged
And the javascript message "key release: 27" should be logged
Scenario: :fake-key sending keychain to the website
When I set general -> log-javascript-console to info
When I set content.javascript.log to info
And I open data/keyinput/log.html
And I run :fake-key xy
Then the javascript message "key press: 88" should be logged

View File

@ -50,19 +50,19 @@ Feature: Various utility commands.
## :jseval
Scenario: :jseval
When I set general -> log-javascript-console to info
When I set content.javascript.log to info
And I run :jseval console.log("Hello from JS!");
And I wait for the javascript message "Hello from JS!"
Then the message "No output or error" should be shown
Scenario: :jseval without logging
When I set general -> log-javascript-console to none
When I set content.javascript.log to none
And I run :jseval console.log("Hello from JS!");
Then the message "No output or error" should be shown
And "[:*] Hello from JS!" should not be logged
Scenario: :jseval with --quiet
When I set general -> log-javascript-console to info
When I set content.javascript.log to info
And I run :jseval --quiet console.log("Hello from JS!");
And I wait for the javascript message "Hello from JS!"
Then "No output or error" should not be logged
@ -77,7 +77,7 @@ Feature: Various utility commands.
@qtwebengine_skip
Scenario: :jseval with --world on QtWebKit
When I set general -> log-javascript-console to info
When I set content.javascript.log to info
And I run :jseval --world=1 console.log("Hello from JS!");
And I wait for the javascript message "Hello from JS!"
Then "Ignoring world ID 1" should be logged
@ -85,7 +85,7 @@ Feature: Various utility commands.
@qtwebkit_skip
Scenario: :jseval uses separate world without --world
When I set general -> log-javascript-console to info
When I set content.javascript.log to info
And I open data/misc/jseval.html
And I run :jseval do_log()
Then the javascript message "Hello from the page!" should not be logged
@ -94,7 +94,7 @@ Feature: Various utility commands.
@qtwebkit_skip
Scenario: :jseval using the main world
When I set general -> log-javascript-console to info
When I set content.javascript.log to info
And I open data/misc/jseval.html
And I run :jseval --world 0 do_log()
Then the javascript message "Hello from the page!" should be logged
@ -102,14 +102,14 @@ Feature: Various utility commands.
@qtwebkit_skip
Scenario: :jseval using the main world as name
When I set general -> log-javascript-console to info
When I set content.javascript.log to info
And I open data/misc/jseval.html
And I run :jseval --world main do_log()
Then the javascript message "Hello from the page!" should be logged
And "No output or error" should be logged
Scenario: :jseval --file using a file that exists as js-code
When I set general -> log-javascript-console to info
When I set content.javascript.log to info
And I run :jseval --file (testdata)/misc/jseval_file.js
Then the javascript message "Hello from JS!" should be logged
And the javascript message "Hello again from JS!" should be logged
@ -150,7 +150,7 @@ Feature: Various utility commands.
@qtwebengine_skip
Scenario: Inspector without developer extras
When I set general -> developer-extras to false
When I set content.developer_extras to false
And I run :inspector
Then the error "Please enable developer-extras before using the webinspector!" should be shown
@ -161,7 +161,7 @@ Feature: Various utility commands.
@no_xvfb @posix @qtwebengine_skip
Scenario: Inspector smoke test
When I set general -> developer-extras to true
When I set content.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
@ -171,14 +171,14 @@ Feature: Various utility commands.
# Different code path as an inspector got created now
@qtwebengine_skip
Scenario: Inspector without developer extras (after smoke)
When I set general -> developer-extras to false
When I set content.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
@no_xvfb @posix @qtwebengine_skip
Scenario: Inspector smoke test 2
When I set general -> developer-extras to true
When I set content.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
@ -339,12 +339,12 @@ Feature: Various utility commands.
# :home
Scenario: :home with single page
When I set general -> startpage to http://localhost:(port)/data/hello2.txt
When I set start_page 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
When I set start_page 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
@ -353,14 +353,14 @@ Feature: Various utility commands.
@qtwebengine_skip: pdfjs is not implemented yet
Scenario: pdfjs is used for pdf files
Given pdfjs is available
When I set content -> enable-pdfjs to true
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
@qtwebengine_todo: pdfjs is not implemented yet
Scenario: pdfjs is not used when disabled
When I set content -> enable-pdfjs to false
And I set storage -> prompt-download-directory to false
When I set content.enable_pdfjs to false
And I set downloads.location.prompt to false
And I open data/misc/test.pdf
Then "Download test.pdf finished" should be logged
@ -371,9 +371,9 @@ Feature: Various utility commands.
# Might be related to https://bugreports.qt.io/browse/QTBUG-13524 and
# a weird interaction with the previous test.
And I have a fresh instance
When I set content -> enable-pdfjs to true
And I set completion -> download-path-suggestion to filename
And I set storage -> prompt-download-directory to true
When I set content.enable_pdfjs to true
And I set downloads.location.suggestion to filename
And I set downloads.location.prompt 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()
@ -448,36 +448,36 @@ Feature: Various utility commands.
## Custom headers
Scenario: Setting a custom header
When I set network -> custom-headers to {"X-Qute-Test": "testvalue"}
When I set content.custom_headers to {"X-Qute-Test": "testvalue"}
And I open headers
Then the header X-Qute-Test should be set to testvalue
Scenario: DNT header
When I set network -> do-not-track to true
When I set content.do_not_track to true
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)
When I set network -> do-not-track to false
When I set content.do_not_track to false
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
Scenario: Accept-Language header
When I set network -> accept-language to en,de
When I set content.accept_language to en,de
And I open headers
Then the header Accept-Language should be set to en,de
Scenario: Setting a custom user-agent header
When I set network -> user-agent to toaster
When I set content.user_agent to toaster
And I open headers
And I run :jseval console.log(window.navigator.userAgent)
Then the header User-Agent should be set to toaster
And the javascript message "toaster" should be logged
Scenario: Setting the default user-agent header
When I set network -> user-agent to <empty>
When I set content.user_agent to <empty>
And I open headers
And I run :jseval console.log(window.navigator.userAgent)
Then the header User-Agent should be set to Mozilla/5.0 *

View File

@ -98,7 +98,7 @@ Feature: Using :navigate
Then data/numbers/3.txt should be loaded
Scenario: Setting url-incdec-segments
When I set general -> url-incdec-segments to anchor
When I set url_incdec_segments to anchor
And I open data/numbers/1.txt
And I run :navigate increment
Then the error "No number found in URL!" should be shown

View File

@ -17,17 +17,17 @@ Feature: Opening pages
url: http://localhost:*/data/numbers/1.txt
Scenario: :open without URL
When I set general -> default-page to http://localhost:(port)/data/numbers/11.txt
When I set default_page to http://localhost:(port)/data/numbers/11.txt
And I run :open
Then data/numbers/11.txt should be loaded
Scenario: :open without URL and -t
When I set general -> default-page to http://localhost:(port)/data/numbers/2.txt
When I set default_page to http://localhost:(port)/data/numbers/2.txt
And I run :open -t
Then data/numbers/2.txt should be loaded
Scenario: :open with invalid URL
When I set general -> auto-search to false
When I set auto_search to false
And I run :open foo!
Then the error "Invalid URL" should be shown
@ -36,8 +36,8 @@ Feature: Opening pages
Then the error "Only one of -t/-b/-w/-p can be given!" should be shown
Scenario: Searching with :open
When I set general -> auto-search to naive
And I set searchengines -> DEFAULT to http://localhost:(port)/data/numbers/{}.txt
When I set auto_search to naive
And I set searchengines.DEFAULT to http://localhost:(port)/data/numbers/{}.txt
And I run :open 3
Then data/numbers/3.txt should be loaded
@ -78,8 +78,8 @@ Feature: Opening pages
Scenario: Opening in a new tab (explicit)
Given I open about:blank
When I set tabs -> new-tab-position-explicit to next
And I set tabs -> new-tab-position to prev
When I set tabs.new_tab_position_explicit to next
And I set tabs.new_tab_position to prev
And I run :tab-only
And I run :open -t http://localhost:(port)/data/numbers/7.txt
And I wait until data/numbers/7.txt is loaded
@ -89,8 +89,8 @@ Feature: Opening pages
Scenario: Opening in a new tab (implicit)
Given I open about:blank
When I set tabs -> new-tab-position-explicit to next
And I set tabs -> new-tab-position to prev
When I set tabs.new_tab_position_explicit to next
And I set tabs.new_tab_position to prev
And I run :tab-only
And I run :open -t -i http://localhost:(port)/data/numbers/8.txt
And I wait until data/numbers/8.txt is loaded

View File

@ -47,7 +47,7 @@ Feature: Using private browsing
When I open cookies/set?qute-test=42 without waiting in a private window
And I wait until cookies is loaded
And I open cookies in a new tab
And I set general -> private-browsing to false
And I set content.private_browsing to false
Then the cookie qute-test should be set to 42
Scenario: Opening private window with :navigate increment
@ -124,7 +124,7 @@ Feature: Using private browsing
# https://github.com/qutebrowser/qutebrowser/issues/2638
Scenario: Turning off javascript with private browsing
When I set content -> allow-javascript to false
When I set content.javascript.enabled to false
And I open data/javascript/consolelog.html in a private window
Then the javascript message "console.log works!" should not be logged

View File

@ -4,7 +4,7 @@ Feature: Prompts
Various prompts (javascript, SSL errors, authentification, etc.)
Background:
Given I set general -> log-javascript-console to debug
Given I set content.javascript.log to debug
# Javascript
@ -15,8 +15,8 @@ Feature: Prompts
And I run :prompt-accept
Then the javascript message "Alert done" should be logged
Scenario: Using content -> ignore-javascript-alert
When I set content -> ignore-javascript-alert to true
Scenario: Using content.javascript.alert
When I set content.javascript.alert to false
And I open data/prompt/jsalert.html
And I run :click-element id button
Then the javascript message "Alert done" should be logged
@ -72,7 +72,7 @@ Feature: Prompts
@qtwebengine_skip: QtWebEngine refuses to load anything with a JS question
Scenario: Blocking question interrupted by blocking one
When I set content -> ignore-javascript-alert to false
When I set content.ignore_javascript_alert to false
And I open data/prompt/jsalert.html
And I run :click-element id button
And I wait for a prompt
@ -88,8 +88,8 @@ Feature: Prompts
@qtwebengine_skip: QtWebEngine refuses to load anything with a JS question
Scenario: Blocking question interrupted by async one
When I set content -> ignore-javascript-alert to false
And I set content -> notifications to ask
When I set content.ignore_javascript_alert to false
And I set content.notifications to ask
And I open data/prompt/jsalert.html
And I run :click-element id button
And I wait for a prompt
@ -105,7 +105,7 @@ Feature: Prompts
@qtwebengine_todo: Notifications are not implemented in QtWebEngine
Scenario: Async question interrupted by async one
When I set content -> notifications to ask
When I set content.notifications to ask
And I open data/prompt/notifications.html in a new tab
And I run :click-element id button
And I wait for a prompt
@ -120,8 +120,8 @@ Feature: Prompts
@qtwebengine_todo: Notifications are not implemented in QtWebEngine
Scenario: Async question interrupted by blocking one
When I set content -> notifications to ask
And I set content -> ignore-javascript-alert to false
When I set content.notifications to ask
And I set content.ignore_javascript_alert to false
And I open data/prompt/notifications.html in a new tab
And I run :click-element id button
And I wait for a prompt
@ -161,8 +161,8 @@ Feature: Prompts
Then the javascript message "Prompt reply: clipboard test" should be logged
@js_prompt
Scenario: Using content -> ignore-javascript-prompt
When I set content -> ignore-javascript-prompt to true
Scenario: Using content.javascript.prompt
When I set content.javascript.prompt to false
And I open data/prompt/jsprompt.html
And I run :click-element id button
Then the javascript message "Prompt reply: null" should be logged
@ -171,7 +171,7 @@ Feature: Prompts
Scenario: SSL error with ssl-strict = false
When I clear SSL errors
And I set network -> ssl-strict to false
And I set content.ssl_strict to false
And I load an SSL page
And I wait until the SSL page finished loading
Then the error "Certificate error: *" should be shown
@ -180,13 +180,13 @@ Feature: Prompts
@issue2478
Scenario: SSL error with ssl-strict = true
When I clear SSL errors
And I set network -> ssl-strict to true
And I set content.ssl_strict to true
And I load an SSL page
Then a SSL error page should be shown
Scenario: SSL error with ssl-strict = ask -> yes
When I clear SSL errors
And I set network -> ssl-strict to ask
And I set content.ssl_strict to ask
And I load an SSL page
And I wait for a prompt
And I run :prompt-accept yes
@ -196,7 +196,7 @@ Feature: Prompts
@issue2478
Scenario: SSL error with ssl-strict = ask -> no
When I clear SSL errors
And I set network -> ssl-strict to ask
And I set content.ssl_strict to ask
And I load an SSL page
And I wait for a prompt
And I run :prompt-accept no
@ -205,7 +205,7 @@ Feature: Prompts
@issue2478
Scenario: SSL error with ssl-strict = ask -> abort
When I clear SSL errors
And I set network -> ssl-strict to ask
And I set content.ssl_strict to ask
And I load an SSL page
And I wait for a prompt
And I run :leave-mode
@ -214,21 +214,21 @@ Feature: Prompts
# Geolocation
Scenario: Always rejecting geolocation
When I set content -> geolocation to false
When I set content.geolocation to false
And I open data/prompt/geolocation.html in a new tab
And I run :click-element id button
Then the javascript message "geolocation permission denied" should be logged
@ci @not_osx @qt!=5.8
Scenario: Always accepting geolocation
When I set content -> geolocation to true
When I set content.geolocation to true
And I open data/prompt/geolocation.html in a new tab
And I run :click-element id button
Then the javascript message "geolocation permission denied" should not be logged
@ci @not_osx @qt!=5.8
Scenario: geolocation with ask -> true
When I set content -> geolocation to ask
When I set content.geolocation to ask
And I open data/prompt/geolocation.html in a new tab
And I run :click-element id button
And I wait for a prompt
@ -236,7 +236,7 @@ Feature: Prompts
Then the javascript message "geolocation permission denied" should not be logged
Scenario: geolocation with ask -> false
When I set content -> geolocation to ask
When I set content.geolocation to ask
And I open data/prompt/geolocation.html in a new tab
And I run :click-element id button
And I wait for a prompt
@ -244,7 +244,7 @@ Feature: Prompts
Then the javascript message "geolocation permission denied" should be logged
Scenario: geolocation with ask -> abort
When I set content -> geolocation to ask
When I set content.geolocation to ask
And I open data/prompt/geolocation.html in a new tab
And I run :click-element id button
And I wait for a prompt
@ -255,21 +255,21 @@ Feature: Prompts
@qtwebengine_todo: Notifications are not implemented in QtWebEngine
Scenario: Always rejecting notifications
When I set content -> notifications to false
When I set content.notifications to false
And I open data/prompt/notifications.html in a new tab
And I run :click-element id button
Then the javascript message "notification permission denied" should be logged
@qtwebengine_todo: Notifications are not implemented in QtWebEngine
Scenario: Always accepting notifications
When I set content -> notifications to true
When I set content.notifications to true
And I open data/prompt/notifications.html in a new tab
And I run :click-element id button
Then the javascript message "notification permission granted" should be logged
@qtwebengine_todo: Notifications are not implemented in QtWebEngine
Scenario: notifications with ask -> false
When I set content -> notifications to ask
When I set content.notifications to ask
And I open data/prompt/notifications.html in a new tab
And I run :click-element id button
And I wait for a prompt
@ -278,7 +278,7 @@ Feature: Prompts
@qtwebengine_todo: Notifications are not implemented in QtWebEngine
Scenario: notifications with ask -> true
When I set content -> notifications to ask
When I set content.notifications to ask
And I open data/prompt/notifications.html in a new tab
And I run :click-element id button
And I wait for a prompt
@ -288,7 +288,7 @@ Feature: Prompts
# This actually gives us a denied rather than an aborted
@xfail_norun
Scenario: notifications with ask -> abort
When I set content -> notifications to ask
When I set content.notifications to ask
And I open data/prompt/notifications.html in a new tab
And I run :click-element id button
And I wait for a prompt
@ -297,7 +297,7 @@ Feature: Prompts
@qtwebengine_todo: Notifications are not implemented in QtWebEngine
Scenario: answering notification after closing tab
When I set content -> notifications to ask
When I set content.notifications to ask
And I open data/prompt/notifications.html in a new tab
And I run :click-element id button
And I wait for a prompt
@ -369,7 +369,7 @@ Feature: Prompts
# :prompt-accept with value argument
Scenario: Javascript alert with value
When I set content -> ignore-javascript-alert to false
When I set content.ignore_javascript_alert to false
And I open data/prompt/jsalert.html
And I run :click-element id button
And I wait for a prompt
@ -380,7 +380,7 @@ Feature: Prompts
@js_prompt
Scenario: Javascript prompt with value
When I set content -> ignore-javascript-prompt to false
When I set content.ignore_javascript_prompt to false
And I open data/prompt/jsprompt.html
And I run :click-element id button
And I wait for a prompt
@ -487,8 +487,8 @@ Feature: Prompts
# https://github.com/qutebrowser/qutebrowser/pull/2054#issuecomment-258285544
@qtwebengine_todo: Notifications are not implemented in QtWebEngine
Scenario: Interrupting SSL prompt during a notification prompt
When I set content -> notifications to ask
And I set network -> ssl-strict to ask
When I set content.notifications to ask
And I set content.ssl_strict to ask
And I open data/prompt/notifications.html in a new tab
And I run :click-element id button
And I wait for a prompt

View File

@ -22,7 +22,7 @@ Feature: Searching on a page
Then "Bar" should be found
Scenario: Searching with --reverse
When I set general -> ignore-case to true
When I set ignore_case to true
And I run :search -r foo
And I wait for "search found foo with flags FindBackward" in the log
Then "Foo" should be found
@ -55,25 +55,25 @@ Feature: Searching on a page
## ignore-case
Scenario: Searching text with ignore-case = true
When I set general -> ignore-case to true
When I set ignore_case to true
And I run :search bar
And I wait for "search found bar" in the log
Then "Bar" should be found
Scenario: Searching text with ignore-case = false
When I set general -> ignore-case to false
When I set ignore_case to false
And I run :search bar
And I wait for "search found bar with flags FindCaseSensitively" in the log
Then "bar" should be found
Scenario: Searching text with ignore-case = smart (lower-case)
When I set general -> ignore-case to smart
When I set ignore_case to smart
And I run :search bar
And I wait for "search found bar" in the log
Then "Bar" should be found
Scenario: Searching text with ignore-case = smart (upper-case)
When I set general -> ignore-case to smart
When I set ignore_case to smart
And I run :search Foo
And I wait for "search found Foo with flags FindCaseSensitively" in the log
Then "Foo" should be found # even though foo was first
@ -81,7 +81,7 @@ Feature: Searching on a page
## :search-next
Scenario: Jumping to next match
When I set general -> ignore-case to true
When I set ignore_case to true
And I run :search foo
And I wait for "search found foo" in the log
And I run :search-next
@ -89,7 +89,7 @@ Feature: Searching on a page
Then "Foo" should be found
Scenario: Jumping to next match with count
When I set general -> ignore-case to true
When I set ignore_case to true
And I run :search baz
And I wait for "search found baz" in the log
And I run :search-next with count 2
@ -97,7 +97,7 @@ Feature: Searching on a page
Then "BAZ" should be found
Scenario: Jumping to next match with --reverse
When I set general -> ignore-case to true
When I set ignore_case to true
And I run :search --reverse foo
And I wait for "search found foo with flags FindBackward" in the log
And I run :search-next
@ -121,7 +121,7 @@ Feature: Searching on a page
# https://github.com/qutebrowser/qutebrowser/issues/2438
Scenario: Jumping to next match after clearing
When I set general -> ignore-case to true
When I set ignore_case to true
And I run :search foo
And I wait for "search found foo" in the log
And I run :search
@ -132,7 +132,7 @@ Feature: Searching on a page
## :search-prev
Scenario: Jumping to previous match
When I set general -> ignore-case to true
When I set ignore_case to true
And I run :search foo
And I wait for "search found foo" in the log
And I run :search-next
@ -142,7 +142,7 @@ Feature: Searching on a page
Then "foo" should be found
Scenario: Jumping to previous match with count
When I set general -> ignore-case to true
When I set ignore_case to true
And I run :search baz
And I wait for "search found baz" in the log
And I run :search-next
@ -154,7 +154,7 @@ Feature: Searching on a page
Then "baz" should be found
Scenario: Jumping to previous match with --reverse
When I set general -> ignore-case to true
When I set ignore_case to true
And I run :search --reverse foo
And I wait for "search found foo with flags FindBackward" in the log
And I run :search-next

View File

@ -3,32 +3,24 @@
Feature: Setting settings.
Background:
Given I set ui -> message-timeout to 100
Given I set messages.timeout to 100
Scenario: Using :set
When I run :set colors statusbar.bg magenta
Then colors -> statusbar.bg should be magenta
Scenario: Only a section
When I run :set colors
Then the error "set: Either both section and option have to be given, or neither!" should be shown
When I run :set colors.statusbar.bg magenta
Then colors.statusbar.bg should be magenta
Scenario: Without value
When I run :set colors statusbar.bg
When I run :set colors.statusbar.bg
Then the error "set: The following arguments are required: value" should be shown
Scenario: Invalid section
When I run :set blah blub foo
Then the error "set: Section 'blah' does not exist!" should be shown
Scenario: Invalid option
When I run :set general blub foo
When I run :set blub foo
Then the error "set: No option 'blub' in section 'general'" should be shown
Scenario: Toggling an option
When I run :set general auto-save-config false
And I run :set general auto-save-config!
Then general -> auto-save-config should be true
When I run :set auto_save.config false
And I run :set auto_save.config!
Then auto_save_config should be true
Scenario: Toggling a non-bool option
When I run :set colors statusbar.bg!
@ -37,22 +29,22 @@ Feature: Setting settings.
Scenario: Cycling an option
When I run :set colors statusbar.bg magenta
And I run :set colors statusbar.bg green magenta blue yellow
Then colors -> statusbar.bg should be blue
Then colors.statusbar.bg should be blue
Scenario: Cycling an option through the end of the list
When I run :set colors statusbar.bg yellow
And I run :set colors statusbar.bg green magenta blue yellow
Then colors -> statusbar.bg should be green
Then colors.statusbar.bg should be green
Scenario: Cycling an option that's not on the list
When I run :set colors statusbar.bg red
And I run :set colors statusbar.bg green magenta blue yellow
Then colors -> statusbar.bg should be green
Then colors.statusbar.bg should be green
Scenario: Cycling through a single option
When I run :set colors statusbar.bg red
And I run :set colors statusbar.bg red
Then colors -> statusbar.bg should be red
Then colors.statusbar.bg should be red
Scenario: Getting an option
When I run :set colors statusbar.bg magenta
@ -64,19 +56,19 @@ Feature: Setting settings.
Then the message "colors statusbar.bg = red" should be shown
Scenario: Using ! and -p
When I run :set general auto-save-config false
And I run :set -p general auto-save-config!
Then the message "general auto-save-config = true" should be shown
When I run :set general auto_save_config false
And I run :set -p auto_save_config!
Then the message "auto_save_config = true" should be shown
Scenario: Setting an invalid value
When I run :set general auto-save-config blah
When I run :set general auto_save_config blah
Then the error "set: Invalid value 'blah' - must be a boolean!" should be shown
Scenario: Setting a temporary option
# We don't actually check if the option is temporary as this isn't easy
# to check.
When I run :set -t colors statusbar.bg green
Then colors -> statusbar.bg should be green
Then colors.statusbar.bg should be green
# qute://settings isn't actually implemented on QtWebEngine, but this works
# (and displays a page saying it's not available)
@ -87,7 +79,7 @@ Feature: Setting settings.
- qute://settings (active)
Scenario: Focusing input fields in qute://settings and entering valid value
When I set general -> ignore-case to false
When I set ignore_case to false
And I open qute://settings
# scroll to the right - the table does not fit in the default screen
And I run :scroll-perc -x 100
@ -98,7 +90,7 @@ Feature: Setting settings.
And I press the key "<Escape>"
# an explicit Tab to unfocus the input field seems to stabilize the tests
And I press the key "<Tab>"
Then general -> ignore-case should be true
Then ignore-case should be true
Scenario: Focusing input fields in qute://settings and entering invalid value
When I open qute://settings

View File

@ -5,7 +5,7 @@ Feature: Tab management
Background:
Given I clean up open tabs
And I set tabs -> tabs-are-windows to false
And I set tabs.tabs_are_windows to false
# :tab-close
@ -38,7 +38,7 @@ Feature: Tab management
- data/numbers/3.txt (active)
Scenario: :tab-close with select-on-remove = next
When I set tabs -> select-on-remove to next
When I set tabs.select_on_remove to next
And I open data/numbers/1.txt
And I open data/numbers/2.txt in a new tab
And I open data/numbers/3.txt in a new tab
@ -49,7 +49,7 @@ Feature: Tab management
- data/numbers/3.txt (active)
Scenario: :tab-close with select-on-remove = prev
When I set tabs -> select-on-remove to prev
When I set tabs.select_on_remove to prev
And I open data/numbers/1.txt
And I open data/numbers/2.txt in a new tab
And I open data/numbers/3.txt in a new tab
@ -60,7 +60,7 @@ Feature: Tab management
- data/numbers/3.txt
Scenario: :tab-close with select-on-remove = last-used
When I set tabs -> select-on-remove to last-used
When I set tabs.select_on_remove to last-used
And I open data/numbers/1.txt
And I open data/numbers/2.txt in a new tab
And I open data/numbers/3.txt in a new tab
@ -73,7 +73,7 @@ Feature: Tab management
- data/numbers/4.txt (active)
Scenario: :tab-close with select-on-remove = prev and --next
When I set tabs -> select-on-remove to prev
When I set tabs.select_on_remove to prev
And I open data/numbers/1.txt
And I open data/numbers/2.txt in a new tab
And I open data/numbers/3.txt in a new tab
@ -84,7 +84,7 @@ Feature: Tab management
- data/numbers/3.txt (active)
Scenario: :tab-close with select-on-remove = next and --prev
When I set tabs -> select-on-remove to next
When I set tabs.select_on_remove to next
And I open data/numbers/1.txt
And I open data/numbers/2.txt in a new tab
And I open data/numbers/3.txt in a new tab
@ -95,7 +95,7 @@ Feature: Tab management
- data/numbers/3.txt
Scenario: :tab-close with select-on-remove = prev and --opposite
When I set tabs -> select-on-remove to prev
When I set tabs.select_on_remove to prev
And I open data/numbers/1.txt
And I open data/numbers/2.txt in a new tab
And I open data/numbers/3.txt in a new tab
@ -106,7 +106,7 @@ Feature: Tab management
- data/numbers/3.txt (active)
Scenario: :tab-close with select-on-remove = next and --opposite
When I set tabs -> select-on-remove to next
When I set tabs.select_on_remove to next
And I open data/numbers/1.txt
And I open data/numbers/2.txt in a new tab
And I open data/numbers/3.txt in a new tab
@ -117,12 +117,12 @@ Feature: Tab management
- data/numbers/3.txt
Scenario: :tab-close with select-on-remove = last-used and --opposite
When I set tabs -> select-on-remove to last-used
When I set tabs.select_on_remove to last-used
And I run :tab-close --opposite
Then the error "-o is not supported with 'tabs->select-on-remove' set to 'last-used'!" should be shown
Scenario: :tab-close should restore selection behavior
When I set tabs -> select-on-remove to next
When I set tabs.select_on_remove to next
And I open data/numbers/1.txt
And I open data/numbers/2.txt in a new tab
And I open data/numbers/3.txt in a new tab
@ -321,19 +321,19 @@ Feature: Tab management
- data/numbers/3.txt (active)
Scenario: :tab-prev on first tab without wrap
When I set tabs -> wrap to false
When I set tabs.wrap to false
And I open data/numbers/1.txt
And I run :tab-prev
Then the error "First tab" should be shown
Scenario: :tab-next with last tab without wrap
When I set tabs -> wrap to false
When I set tabs.wrap to false
And I open data/numbers/1.txt
And I run :tab-next
Then the error "Last tab" should be shown
Scenario: :tab-prev on first tab with wrap
When I set tabs -> wrap to true
When I set tabs.wrap to true
And I open data/numbers/1.txt
And I open data/numbers/2.txt in a new tab
And I open data/numbers/3.txt in a new tab
@ -345,7 +345,7 @@ Feature: Tab management
- data/numbers/3.txt (active)
Scenario: :tab-next with last tab with wrap
When I set tabs -> wrap to true
When I set tabs.wrap to true
And I open data/numbers/1.txt
And I open data/numbers/2.txt in a new tab
And I open data/numbers/3.txt in a new tab
@ -356,7 +356,7 @@ Feature: Tab management
- data/numbers/3.txt
Scenario: :tab-next with last tab, wrap and count
When I set tabs -> wrap to true
When I set tabs.wrap to true
And I open data/numbers/1.txt
And I open data/numbers/2.txt in a new tab
And I open data/numbers/3.txt in a new tab
@ -483,7 +483,7 @@ Feature: Tab management
- data/numbers/2.txt
Scenario: :tab-move with relative position and too big count.
When I set tabs -> wrap to false
When I set tabs.wrap to false
And I open data/numbers/1.txt
And I open data/numbers/2.txt in a new tab
And I open data/numbers/3.txt in a new tab
@ -492,7 +492,7 @@ Feature: Tab management
Then the error "Can't move tab to position 4!" should be shown
Scenario: :tab-move with relative position (positive) and wrap
When I set tabs -> wrap to true
When I set tabs.wrap to true
And I open data/numbers/1.txt
And I open data/numbers/2.txt in a new tab
And I open data/numbers/3.txt in a new tab
@ -503,7 +503,7 @@ Feature: Tab management
- data/numbers/2.txt
Scenario: :tab-move with relative position (negative), wrap and count
When I set tabs -> wrap to true
When I set tabs.wrap to true
And I open data/numbers/1.txt
And I open data/numbers/2.txt in a new tab
And I open data/numbers/3.txt in a new tab
@ -600,7 +600,7 @@ Feature: Tab management
Scenario: Cloning with tabs-are-windows = true
When I open data/title.html
And I set tabs -> tabs-are-windows to true
And I set tabs.tabs_are_windows to true
And I run :tab-clone
And I wait until data/title.html is loaded
Then the session should look like:
@ -690,7 +690,7 @@ Feature: Tab management
Scenario: Undo with auto-created last tab
When I open data/hello.txt
And I run :tab-only
And I set tabs -> last-close to blank
And I set tabs.last_close to blank
And I run :tab-close
And I wait until about:blank is loaded
And I run :undo
@ -703,7 +703,7 @@ Feature: Tab management
When I open data/hello.txt
And I open data/hello2.txt
And I run :tab-only
And I set tabs -> last-close to blank
And I set tabs.last_close to blank
And I run :tab-close
And I wait until about:blank is loaded
And I run :undo
@ -714,8 +714,8 @@ Feature: Tab management
Scenario: Undo with auto-created last tab (startpage)
When I open data/hello.txt
And I run :tab-only
And I set tabs -> last-close to startpage
And I set general -> startpage to http://localhost:(port)/data/numbers/4.txt,http://localhost:(port)/data/numbers/5.txt
And I set tabs.last_close to startpage
And I set start_page to http://localhost:(port)/data/numbers/4.txt,http://localhost:(port)/data/numbers/5.txt
And I run :tab-close
And I wait until data/numbers/4.txt is loaded
And I run :undo
@ -726,8 +726,8 @@ Feature: Tab management
Scenario: Undo with auto-created last tab (default-page)
When I open data/hello.txt
And I run :tab-only
And I set tabs -> last-close to default-page
And I set general -> default-page to http://localhost:(port)/data/numbers/6.txt
And I set tabs.last_close to default-page
And I set default_page to http://localhost:(port)/data/numbers/6.txt
And I run :tab-close
And I wait until data/numbers/6.txt is loaded
And I run :undo
@ -738,8 +738,8 @@ Feature: Tab management
Scenario: Double-undo with single tab on last-close default page
Given I have a fresh instance
When I open about:blank
And I set tabs -> last-close to default-page
And I set general -> default-page to about:blank
And I set tabs.last_close to default-page
And I set default_page to about:blank
And I run :undo
And I run :undo
Then the error "Nothing to undo!" should be shown
@ -799,7 +799,7 @@ Feature: Tab management
@qtwebengine_skip: Waits for an earlier about:blank and fails
Scenario: last-close = blank
When I open data/hello.txt
And I set tabs -> last-close to blank
And I set tabs.last_close to blank
And I run :tab-only
And I run :tab-close
And I wait until about:blank is loaded
@ -807,8 +807,8 @@ Feature: Tab management
- about:blank (active)
Scenario: last-close = startpage
When I set general -> startpage to http://localhost:(port)/data/numbers/7.txt,http://localhost:(port)/data/numbers/8.txt
And I set tabs -> last-close to startpage
When I set start_page to http://localhost:(port)/data/numbers/7.txt,http://localhost:(port)/data/numbers/8.txt
And I set tabs.last_close to startpage
And I open data/hello.txt
And I run :tab-only
And I run :tab-close
@ -817,8 +817,8 @@ Feature: Tab management
- data/numbers/7.txt (active)
Scenario: last-close = default-page
When I set general -> default-page to http://localhost:(port)/data/numbers/9.txt
And I set tabs -> last-close to default-page
When I set default_page to http://localhost:(port)/data/numbers/9.txt
And I set tabs.last_close to default-page
And I open data/hello.txt
And I run :tab-only
And I run :tab-close
@ -828,7 +828,7 @@ Feature: Tab management
Scenario: last-close = close
When I open data/hello.txt
And I set tabs -> last-close to close
And I set tabs.last_close to close
And I run :tab-only
And I run :tab-close
Then qutebrowser should quit
@ -836,7 +836,7 @@ Feature: Tab management
# tab settings
Scenario: opening links with tabs->background-tabs true
When I set tabs -> background-tabs to true
When I set tabs.background_tabs to true
And I open data/hints/html/simple.html
And I hint with args "all tab" and follow a
And I wait until data/hello.txt is loaded
@ -845,8 +845,8 @@ Feature: Tab management
- data/hello.txt
Scenario: opening tab with tabs->new-tab-position prev
When I set tabs -> new-tab-position to prev
And I set tabs -> background-tabs to false
When I set tabs.new_tab_position to prev
And I set tabs.background_tabs to false
And I open about:blank
And I open data/hints/html/simple.html in a new tab
And I run :click-element id link --target=tab
@ -857,8 +857,8 @@ Feature: Tab management
- data/hints/html/simple.html
Scenario: opening tab with tabs->new-tab-position next
When I set tabs -> new-tab-position to next
And I set tabs -> background-tabs to false
When I set tabs.new_tab_position to next
And I set tabs.background_tabs to false
And I open about:blank
And I open data/hints/html/simple.html in a new tab
And I run :click-element id link --target=tab
@ -869,8 +869,8 @@ Feature: Tab management
- data/hello.txt (active)
Scenario: opening tab with tabs->new-tab-position first
When I set tabs -> new-tab-position to first
And I set tabs -> background-tabs to false
When I set tabs.new_tab_position to first
And I set tabs.background_tabs to false
And I open about:blank
And I open data/hints/html/simple.html in a new tab
And I run :click-element id link --target=tab
@ -881,8 +881,8 @@ Feature: Tab management
- data/hints/html/simple.html
Scenario: opening tab with tabs->new-tab-position last
When I set tabs -> new-tab-position to last
And I set tabs -> background-tabs to false
When I set tabs.new_tab_position to last
And I set tabs.background_tabs to false
And I open data/hints/html/simple.html
And I open about:blank in a new tab
And I run :tab-focus last
@ -1011,21 +1011,21 @@ Feature: Tab management
# Other
Scenario: Using :tab-next after closing last tab (#1448)
When I set tabs -> last-close to close
When I set tabs.last_close to close
And I run :tab-only
And I run :tab-close ;; tab-next
Then qutebrowser should quit
And no crash should happen
Scenario: Using :tab-prev after closing last tab (#1448)
When I set tabs -> last-close to close
When I set tabs.last_close to close
And I run :tab-only
And I run :tab-close ;; tab-prev
Then qutebrowser should quit
And no crash should happen
Scenario: Opening link with tabs-are-windows set (#2162)
When I set tabs -> tabs-are-windows to true
When I set tabs.tabs_are_windows to true
And I open data/hints/html/simple.html
And I hint with args "all tab-fg" and follow a
And I wait until data/hello.txt is loaded

View File

@ -17,6 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
import json
import pytest_bdd as bdd
bdd.scenarios('adblock.feature')
@ -26,4 +28,4 @@ bdd.scenarios('adblock.feature')
def set_up_blocking(quteproc, lists, httpbin):
url = 'http://localhost:{}/data/adblock/'.format(httpbin.port)
urls = [url + item.strip() for item in lists.split(',')]
quteproc.set_setting('content', 'host-block-lists', ','.join(urls))
quteproc.set_setting('content.host_blocking.lists', json.dumps(urls))

View File

@ -34,9 +34,9 @@ PROMPT_MSG = ("Asking question <qutebrowser.utils.usertypes.Question "
def temporary_download_dir(quteproc, tmpdir):
download_dir = tmpdir / 'downloads'
download_dir.ensure(dir=True)
quteproc.set_setting('storage', 'prompt-download-directory', 'false')
quteproc.set_setting('storage', 'remember-download-directory', 'false')
quteproc.set_setting('storage', 'download-directory', str(download_dir))
quteproc.set_setting('downloads.location.prompt', 'false')
quteproc.set_setting('downloads.location.remember', 'false')
quteproc.set_setting('downloads.location.directory', str(download_dir))
(download_dir / 'subdir').ensure(dir=True)
try:
os.mkfifo(str(download_dir / 'fifo'))

View File

@ -42,7 +42,7 @@ def set_up_editor_replacement(quteproc, httpbin, tmpdir, text, replacement):
f.write(data)
""".format(text=text, replacement=replacement)))
editor = '"{}" "{}" {{}}'.format(sys.executable, script)
quteproc.set_setting('general', 'editor', editor)
quteproc.set_setting('editor.command', editor)
@bdd.when(bdd.parsers.parse('I set up a fake editor returning "{text}"'))
@ -56,4 +56,4 @@ def set_up_editor(quteproc, httpbin, tmpdir, text):
f.write({text!r})
""".format(text=text)))
editor = '"{}" "{}" {{}}'.format(sys.executable, script)
quteproc.set_setting('general', 'editor', editor)
quteproc.set_setting('editor.command', editor)

View File

@ -43,4 +43,4 @@ def set_up_word_hints(tmpdir, quteproc):
twelve
thirteen
"""))
quteproc.set_setting('hints', 'dictionary', str(dict_file))
quteproc.set_setting('hints.dictionary', str(dict_file))

View File

@ -25,7 +25,7 @@ bdd.scenarios('open.feature')
def test_open_s(quteproc, ssl_server):
"""Test :open with -s."""
quteproc.set_setting('network', 'ssl-strict', 'false')
quteproc.set_setting('content.ssl_strict', 'false')
quteproc.send_cmd(':open -s http://localhost:{}/'.format(ssl_server.port))
quteproc.mark_expected(category='message',
loglevel=logging.ERROR,

View File

@ -20,7 +20,7 @@ Feature: quickmarks and bookmarks
Then the error "Title must be provided if url has been provided" should be shown
Scenario: Saving a bookmark with an invalid url
When I set general -> auto-search to false
When I set auto_search to false
And I run :bookmark-add foo! "some example title"
Then the error "Invalid URL" should be shown

View File

@ -82,12 +82,14 @@ Feature: Miscellaneous utility commands exposed to the user.
When I run :debug-all-objects
Then "*Qt widgets - *Qt objects - *" should be logged
## :debug-cache-stats
# ## :debug-cache-stats
Scenario: :debug-cache-stats
When I run :debug-cache-stats
Then "config: CacheInfo(*)" should be logged
And "style: CacheInfo(*)" should be logged
# # FIXME:conf
# Scenario: :debug-cache-stats
# When I run :debug-cache-stats
# Then "config: CacheInfo(*)" should be logged
# And "style: CacheInfo(*)" should be logged
## :debug-console

View File

@ -145,7 +145,7 @@ Feature: Yanking and pasting.
url: http://localhost:*/data/hello.txt
Scenario: Pasting an invalid URL
When I set general -> auto-search to false
When I set auto_search to false
And I put "foo bar" into the clipboard
And I run :open {clipboard}
Then the error "Invalid URL" should be shown
@ -168,8 +168,8 @@ Feature: Yanking and pasting.
- data/hello3.txt
Scenario: Pasting multiline text
When I set general -> auto-search to true
And I set searchengines -> DEFAULT to http://localhost:(port)/data/hello.txt?q={}
When I set auto_search to true
And I set searchengines.DEFAULT to http://localhost:(port)/data/hello.txt?q={}
And I put the following lines into the clipboard:
this url:
http://qutebrowser.org
@ -181,8 +181,8 @@ Feature: Yanking and pasting.
- data/hello.txt?q=this%20url%3A%0Ahttp%3A//qutebrowser.org%0Ashould%20not%20open (active)
Scenario: Pasting multiline whose first line looks like a URI
When I set general -> auto-search to true
And I set searchengines -> DEFAULT to http://localhost:(port)/data/hello.txt?q={}
When I set auto_search to true
And I set searchengines.DEFAULT to http://localhost:(port)/data/hello.txt?q={}
And I put the following lines into the clipboard:
text:
should open
@ -255,7 +255,7 @@ Feature: Yanking and pasting.
#### :insert-text
Scenario: Inserting text into an empty text field
When I set general -> log-javascript-console to info
When I set content.javascript.log to info
And I open data/paste_primary.html
And I run :click-element id qute-textarea
And I wait for "Entering mode KeyMode.insert (reason: clicking input)" in the log
@ -264,8 +264,8 @@ Feature: Yanking and pasting.
Then the javascript message "textarea contents: Hello world" should be logged
Scenario: Inserting text into an empty text field with javascript disabled
When I set general -> log-javascript-console to info
And I set content -> allow-javascript to false
When I set content.javascript.log to info
And I set content.javascript.enabled to false
And I open data/paste_primary.html
And I run :click-element id qute-textarea
And I wait for "Entering mode KeyMode.insert (reason: clicking input)" in the log
@ -273,12 +273,12 @@ Feature: Yanking and pasting.
And I wait for "Inserting text into element *" in the log
And I run :jseval console.log("textarea contents: " + document.getElementById('qute-textarea').value);
# Enable javascript again for the other tests
And I set content -> allow-javascript to true
And I set content.javascript.enabled to true
# Compare
Then the javascript message "textarea contents: Hello world" should be logged
Scenario: Inserting text into a text field at specific position
When I set general -> log-javascript-console to info
When I set content.javascript.log to info
And I open data/paste_primary.html
And I set the text field to "one two three four"
And I run :click-element id qute-textarea
@ -293,7 +293,7 @@ Feature: Yanking and pasting.
@qtwebengine_osx_xfail
Scenario: Inserting text into a text field with undo
When I set general -> log-javascript-console to info
When I set content.javascript.log to info
And I open data/paste_primary.html
And I run :click-element id qute-textarea
And I wait for "Entering mode KeyMode.insert (reason: clicking input)" in the log

View File

@ -4,7 +4,7 @@ Feature: Zooming in and out
Background:
Given I open data/hello.txt
And I set ui -> zoom-levels to 50%,90%,100%,110%,120%
And I set zoom.levels to 50%,90%,100%,110%,120%
And I run :tab-only
Scenario: Zooming in
@ -62,7 +62,7 @@ Feature: Zooming in and out
And the zoom should be 40%
Scenario: Resetting zoom
When I set ui -> default-zoom to 42%
When I set zoom.default to 42%
And I run :zoom 50
And I run :zoom
Then the message "Zoom level: 42%" should be shown
@ -84,7 +84,7 @@ Feature: Zooming in and out
# Fixed in QtWebEngine branch
@xfail
Scenario: Zooming in with cloned tab
When I set ui -> default-zoom to 100%
When I set zoom.default to 100%
And I run :zoom-in
And I wait for "Zoom level: 110%" in the log
And I run :tab-clone
@ -96,7 +96,7 @@ Feature: Zooming in and out
# https://github.com/qutebrowser/qutebrowser/issues/2183
@qtwebengine_flaky
Scenario: Setting a default zoom
When I set ui -> default-zoom to 200%
When I set zoom.default to 200%
And I open data/hello.txt in a new tab
And I run :tab-only
Then the zoom should be 200%

View File

@ -451,15 +451,15 @@ class QuteProc(testprocess.Process):
def _after_start(self):
"""Adjust some qutebrowser settings after starting."""
settings = [
('ui', 'message-timeout', '0'),
('general', 'auto-save-interval', '0'),
('general', 'new-instance-open-target.window', 'last-opened')
('messages.timeout', '0'),
('auto_save.interval', '0'),
('new_instance_open_target_window', 'last-opened')
]
if not self.request.config.webengine:
settings.append(('network', 'ssl-strict', 'false'))
settings.append(('content.ssl_strict', 'false'))
for sect, opt, value in settings:
self.set_setting(sect, opt, value)
for opt, value in settings:
self.set_setting(opt, value)
def after_test(self):
"""Handle unexpected/skip logging and clean up after each test."""
@ -524,28 +524,27 @@ class QuteProc(testprocess.Process):
self.wait_for(category='commands', module='command',
function='run', message='command called: *')
def get_setting(self, sect, opt):
def get_setting(self, opt):
"""Get the value of a qutebrowser setting."""
self.send_cmd(':set {} {}?'.format(sect, opt))
self.send_cmd(':set {}?'.format(opt))
msg = self.wait_for(loglevel=logging.INFO, category='message',
message='{} {} = *'.format(sect, opt))
message='{} = *'.format(opt))
return msg.message.split(' = ')[1]
def set_setting(self, sect, opt, value):
def set_setting(self, option, value):
# \ and " in a value should be treated literally, so escape them
value = value.replace('\\', r'\\')
value = value.replace('"', '\\"')
self.send_cmd(':set "{}" "{}" "{}"'.format(sect, opt, value),
escape=False)
self.send_cmd(':set "{}" "{}"'.format(option, value), escape=False)
self.wait_for(category='config', message='Config option changed: *')
@contextlib.contextmanager
def temp_setting(self, sect, opt, value):
def temp_setting(self, opt, value):
"""Context manager to set a setting and reset it on exit."""
old_value = self.get_setting(sect, opt)
self.set_setting(sect, opt, value)
old_value = self.get_setting(opt)
self.set_setting(opt, value)
yield
self.set_setting(sect, opt, old_value)
self.set_setting(opt, old_value)
def open_path(self, path, *, new_tab=False, new_bg_tab=False,
new_window=False, private=False, as_url=False, port=None,

View File

@ -334,8 +334,8 @@ def test_xpath_escape(string, expected):
'foo"bar', # Make sure a " is preserved
])
def test_set(quteproc, value):
quteproc.set_setting('general', 'default-encoding', value)
read_back = quteproc.get_setting('general', 'default-encoding')
quteproc.set_setting('content.default_encoding', value)
read_back = quteproc.get_setting('content.default_encoding')
assert read_back == value

View File

@ -99,9 +99,8 @@ def test_hints(test_name, zoom_text_only, zoom_level, find_implementation,
# setup
if not request.config.webengine:
quteproc.set_setting('ui', 'zoom-text-only', str(zoom_text_only))
quteproc.set_setting('hints', 'find-implementation',
find_implementation)
quteproc.set_setting('zoom.text_only', str(zoom_text_only))
quteproc.set_setting('hints.find_implementation', find_implementation)
quteproc.send_cmd(':zoom {}'.format(zoom_level))
# follow hint
quteproc.send_cmd(':hint links normal')
@ -111,8 +110,8 @@ def test_hints(test_name, zoom_text_only, zoom_level, find_implementation,
# reset
quteproc.send_cmd(':zoom 100')
if not request.config.webengine:
quteproc.set_setting('ui', 'zoom-text-only', 'false')
quteproc.set_setting('hints', 'find-implementation', 'javascript')
quteproc.set_setting('zoom.text_only', 'false')
quteproc.set_setting('hints.find_implementation', 'javascript')
def test_word_hints_issue1393(quteproc, tmpdir):
@ -135,8 +134,8 @@ def test_word_hints_issue1393(quteproc, tmpdir):
('epsi', 'l33t.txt'),
]
quteproc.set_setting('hints', 'mode', 'word')
quteproc.set_setting('hints', 'dictionary', str(dict_file))
quteproc.set_setting('hints.mode', 'word')
quteproc.set_setting('hints.dictionary', str(dict_file))
for hint, target in targets:
quteproc.open_path('data/hints/issue1393.html')

View File

@ -38,7 +38,7 @@ def test_insert_mode(file_name, elem_id, source, input_text, auto_insert, zoom,
url_path = 'data/insert_mode_settings/html/{}'.format(file_name)
quteproc.open_path(url_path)
quteproc.set_setting('input', 'auto-insert-mode', auto_insert)
quteproc.set_setting('input.insert_mode.auto_focused', auto_insert)
quteproc.send_cmd(':zoom {}'.format(zoom))
quteproc.send_cmd(':click-element --force-event id {}'.format(elem_id))
@ -61,7 +61,7 @@ def test_auto_leave_insert_mode(quteproc):
url_path = 'data/insert_mode_settings/html/autofocus.html'
quteproc.open_path(url_path)
quteproc.set_setting('input', 'auto-leave-insert-mode', 'true')
quteproc.set_setting('input.insert_mode.auto_leave', 'true')
quteproc.send_cmd(':zoom 100')
quteproc.press_keys('abcd')

View File

@ -80,10 +80,10 @@ def test_ascii_locale(request, httpbin, tmpdir, quteproc_new):
"""
args = ['--temp-basedir'] + _base_args(request.config)
quteproc_new.start(args, env={'LC_ALL': 'C'})
quteproc_new.set_setting('storage', 'download-directory', str(tmpdir))
quteproc_new.set_setting('downloads.location.directory', str(tmpdir))
# Test a normal download
quteproc_new.set_setting('storage', 'prompt-download-directory', 'false')
quteproc_new.set_setting('downloads.location.prompt', 'false')
url = 'http://localhost:{port}/data/downloads/ä-issue908.bin'.format(
port=httpbin.port)
quteproc_new.send_cmd(':download {}'.format(url))
@ -91,7 +91,7 @@ def test_ascii_locale(request, httpbin, tmpdir, quteproc_new):
message='Download ?-issue908.bin finished')
# Test :prompt-open-download
quteproc_new.set_setting('storage', 'prompt-download-directory', 'true')
quteproc_new.set_setting('downloads.location.prompt', 'true')
quteproc_new.send_cmd(':download {}'.format(url))
quteproc_new.send_cmd(':prompt-open-download "{}" -c pass'
.format(sys.executable))
@ -122,7 +122,7 @@ def test_misconfigured_user_dirs(request, httpbin, temp_basedir_env,
quteproc_new.start(_base_args(request.config), env=temp_basedir_env)
quteproc_new.set_setting('storage', 'prompt-download-directory', 'false')
quteproc_new.set_setting('downloads.location.prompt', 'false')
url = 'http://localhost:{port}/data/downloads/download.bin'.format(
port=httpbin.port)
quteproc_new.send_cmd(':download {}'.format(url))
@ -233,9 +233,8 @@ def test_webengine_download_suffix(request, quteproc_new, tmpdir):
args = (['--temp-basedir'] + _base_args(request.config))
quteproc_new.start(args, env=env)
quteproc_new.set_setting('storage', 'prompt-download-directory', 'false')
quteproc_new.set_setting('storage', 'download-directory',
str(download_dir))
quteproc_new.set_setting('downloads.location.prompt', 'false')
quteproc_new.set_setting('downloads.location.directory', str(download_dir))
quteproc_new.open_path('data/downloads/download.bin', wait=False)
quteproc_new.wait_for(category='downloads', message='Download * finished')
quteproc_new.open_path('data/downloads/download.bin', wait=False)

View File

@ -104,9 +104,8 @@ def _test_mhtml_requests(test_dir, test_path, httpbin):
@pytest.mark.parametrize('test_name', collect_tests())
def test_mhtml(request, test_name, download_dir, quteproc, httpbin):
quteproc.set_setting('storage', 'download-directory',
download_dir.location)
quteproc.set_setting('storage', 'prompt-download-directory', 'false')
quteproc.set_setting('downloads.location.directory', download_dir.location)
quteproc.set_setting('downloads.location.prompt', 'false')
test_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)),
'data', 'downloads', 'mhtml', test_name)

View File

@ -6,7 +6,7 @@
<title>Different hint implementations</title>
</head>
<body>
<p>When setting hints -> find-implementation to python, the label for the wrapped hint should be drawn at the wrong position.</p>
<p>When setting hints.find_implementation to python, the label for the wrapped hint should be drawn at the wrong position.</p>
<div style="width: 20em;">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis <a href="/data/hello.txt">nostrud exercitation</a> ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>

View File

@ -5,8 +5,8 @@
<title>Hide unmatched rapid hints</title>
</head>
<body>
<p>When <code>hints -> hide-unmatched-rapid-hints</code> is set to true (default), rapid hints behave like normal hints, i.e. unmatched hints will be hidden as you type. Setting the option to false will disable hiding in rapid mode, which is sometimes useful (see <a href="https://github.com/qutebrowser/qutebrowser/issues/1799">#1799</a>).</p>
<p>Note that when hinting in number mode, the <code>hints -> hide-unmatched-rapid-hints</code> option affects typing the hint string (number), but not the filter (letters).</p>
<p>When <code>hints.hide_unmatched_rapid_hints</code> is set to true (default), rapid hints behave like normal hints, i.e. unmatched hints will be hidden as you type. Setting the option to false will disable hiding in rapid mode, which is sometimes useful (see <a href="https://github.com/qutebrowser/qutebrowser/issues/1799">#1799</a>).</p>
<p>Note that when hinting in number mode, the <code>hints.hide_unmatched_rapid_hints</code> option affects typing the hint string (number), but not the filter (letters).</p>
<p>Here is couple of invalid links to test the behaviour:</p>
<p><a href="#foo">one</a></p>
<p><a href="#foo">two</a></p>

View File

@ -6,11 +6,11 @@
</head>
<body>
<ul>
<li>Middle- or Ctrl-click on a <a href="https://www.qutebrowser.org">link</a> should open it in a new tab (fg/bg according to <code>tabs -> background-tabs</code>)</li>
<li>Middle- or Ctrl-click on a <a href="https://www.qutebrowser.org">link</a> should open it in a new tab (fg/bg according to <code>tabs.background</code>)</li>
<li>When clicking the link with shift, <code>background-tabs</code> should be reversed accordingly.</li>
<li>Ctrl + Mousewheel should zoom in/out</li>
<li>Back/forward keys on mouse should navigate back/forward</li>
<li>With <code>input -> rocker-gestures</code> set, no context menu should be shown, but pressing left+right/right+left buttons should navigate back/forward</li>
<li>When setting <code>input -> rocker-gestures</code> dynamically, the context menu should be hidden/shown accordingly.</li>
<li>With <code>input.rocker_gestures</code> set, no context menu should be shown, but pressing left+right/right+left buttons should navigate back/forward</li>
<li>When setting <code>input.rocker_gestures</code> dynamically, the context menu should be hidden/shown accordingly.</li>
</body>
</html>

View File

@ -97,7 +97,7 @@ def test_show_message_twice_after_first_disappears(qtbot, view):
def test_changing_timer_with_messages_shown(qtbot, view, config_stub):
"""When we change ui -> message-timeout, the timer should be restarted."""
"""When we change messages.timeout, the timer should be restarted."""
config_stub['ui']['message-timeout'] = 900000 # 15s
view.show_message(usertypes.MessageLevel.info, 'test')
with qtbot.waitSignal(view._clear_timer.timeout):

View File

@ -146,7 +146,7 @@ def test_previtem_index_error(hist):
def test_append_private_mode(hist, config_stub):
"""Test append in private mode."""
hist._private = True
# We want general.private-browsing set to True
# We want private_browsing set to True
config_stub.data = CONFIG_PRIVATE
hist.append('new item')
assert hist.history == HISTORY
@ -154,7 +154,7 @@ def test_append_private_mode(hist, config_stub):
def test_append(hist, config_stub):
"""Test append outside private mode."""
# Private mode is disabled (general.private-browsing is set to False)
# Private mode is disabled (private_browsing is set to False)
config_stub.data = CONFIG_NOT_PRIVATE
hist.append('new item')
assert 'new item' in hist.history