qutebrowser/tests/end2end/features/set.feature

119 lines
4.9 KiB
Gherkin
Raw Normal View History

# vim: ft=cucumber fileencoding=utf-8 sts=4 sw=4 et:
2015-11-10 21:07:49 +01:00
Feature: Setting settings.
Background:
2017-06-16 16:22:41 +02:00
Given I set messages.timeout to 100
2015-11-10 21:07:49 +01:00
Scenario: Using :set
When I run :set colors.statusbar.normal.bg magenta
2017-06-16 18:16:19 +02:00
Then colors.statusbar.normal.bg should be set to magenta
2015-11-10 21:07:49 +01:00
Scenario: Without value
When I run :set colors.statusbar.normal.bg
2015-11-26 17:50:39 +01:00
Then the error "set: The following arguments are required: value" should be shown
2015-11-10 21:07:49 +01:00
Scenario: Invalid option
2017-06-16 16:22:41 +02:00
When I run :set blub foo
2017-06-16 18:16:19 +02:00
Then the error "set: No option 'blub'" should be shown
2015-11-10 21:07:49 +01:00
Scenario: Toggling an option
2017-06-16 16:22:41 +02:00
When I run :set auto_save.config false
And I run :set auto_save.config!
2017-06-16 18:16:19 +02:00
Then auto_save.config should be set to true
2015-11-10 21:07:49 +01:00
Scenario: Toggling a non-bool option
2017-06-16 18:16:19 +02:00
When I run :set colors.statusbar.normal.bg!
2015-11-26 17:50:39 +01:00
Then the error "set: Attempted inversion of non-boolean value." should be shown
2015-11-10 21:07:49 +01:00
Scenario: Cycling an option
2017-06-16 18:16:19 +02:00
When I run :set colors.statusbar.normal.bg magenta
And I run :set colors.statusbar.normal.bg green magenta blue yellow
Then colors.statusbar.normal.bg should be set to blue
Scenario: Cycling an option through the end of the list
2017-06-16 18:16:19 +02:00
When I run :set colors.statusbar.normal.bg yellow
And I run :set colors.statusbar.normal.bg green magenta blue yellow
Then colors.statusbar.normal.bg should be set to green
Scenario: Cycling an option that's not on the list
2017-06-16 18:16:19 +02:00
When I run :set colors.statusbar.normal.bg red
And I run :set colors.statusbar.normal.bg green magenta blue yellow
Then colors.statusbar.normal.bg should be set to green
Scenario: Cycling through a single option
2017-06-16 18:16:19 +02:00
When I run :set colors.statusbar.normal.bg red
And I run :set colors.statusbar.normal.bg red
Then colors.statusbar.normal.bg should be set to red
2015-11-10 21:07:49 +01:00
Scenario: Getting an option
2017-06-16 18:16:19 +02:00
When I run :set colors.statusbar.normal.bg magenta
And I run :set colors.statusbar.normal.bg?
Then the message "colors.statusbar.normal.bg = magenta" should be shown
2015-11-10 21:07:49 +01:00
Scenario: Using -p
2017-06-16 18:16:19 +02:00
When I run :set -p colors.statusbar.normal.bg red
Then the message "colors.statusbar.normal.bg = red" should be shown
2015-11-10 21:07:49 +01:00
2015-11-10 21:27:42 +01:00
Scenario: Using ! and -p
2017-06-16 18:16:19 +02:00
When I run :set auto_save.config false
And I run :set -p auto_save.config!
Then the message "auto_save.config = true" should be shown
2015-11-10 21:27:42 +01:00
2015-11-10 22:09:36 +01:00
Scenario: Setting an invalid value
2017-06-16 18:16:19 +02:00
When I run :set auto_save.config blah
2015-11-26 17:50:39 +01:00
Then the error "set: Invalid value 'blah' - must be a boolean!" should be shown
2015-11-10 22:09:36 +01:00
2015-11-10 21:07:49 +01:00
Scenario: Setting a temporary option
# We don't actually check if the option is temporary as this isn't easy
# to check.
2017-06-16 18:16:19 +02:00
When I run :set -t colors.statusbar.normal.bg green
Then colors.statusbar.normal.bg should be set to green
2015-11-10 21:07:49 +01:00
# qute://settings isn't actually implemented on QtWebEngine, but this works
# (and displays a page saying it's not available)
Scenario: Opening qute://settings
2015-11-10 21:07:49 +01:00
When I run :set
And I wait until qute://settings is loaded
Then the following tabs should be open:
- qute://settings (active)
2015-11-10 21:27:42 +01:00
2016-08-26 13:45:21 +02:00
Scenario: Focusing input fields in qute://settings and entering valid value
2017-06-16 18:16:19 +02:00
When I set ignore_case to never
2016-08-29 07:08:57 +02:00
And I open qute://settings
2016-08-26 13:45:21 +02:00
# scroll to the right - the table does not fit in the default screen
And I run :scroll-perc -x 100
2017-06-19 13:13:08 +02:00
And I run :click-element id input-ignore_case
2016-08-29 07:08:57 +02:00
And I wait for "Entering mode KeyMode.insert *" in the log
2016-08-26 13:45:21 +02:00
And I press the key "<Ctrl+Backspace>"
2017-06-16 18:16:19 +02:00
And I press the keys "always"
2016-08-26 13:45:21 +02:00
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>"
2017-06-16 18:16:19 +02:00
Then ignore_case should be set to always
2016-08-26 13:45:21 +02:00
Scenario: Focusing input fields in qute://settings and entering invalid value
When I open qute://settings
# scroll to the right - the table does not fit in the default screen
And I run :scroll-perc -x 100
2017-06-19 13:13:08 +02:00
And I run :click-element id input-ignore_case
2016-08-29 07:08:57 +02:00
And I wait for "Entering mode KeyMode.insert *" in the log
2016-08-26 13:45:21 +02:00
And I press the key "<Ctrl+Backspace>"
2016-08-29 07:08:57 +02:00
And I press the keys "foo"
2016-08-26 13:45:21 +02:00
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 "Invalid value 'foo' *" should be logged
2016-08-26 13:45:21 +02:00
2015-11-10 21:27:42 +01:00
Scenario: Empty option with ? (issue 1109)
2017-06-16 18:16:19 +02:00
When I run :set ?
2015-11-26 17:50:39 +01:00
Then the error "set: The following arguments are required: value" should be shown
2015-11-10 21:27:42 +01:00
Scenario: Invalid option with ? (issue 1109)
2017-06-16 18:16:19 +02:00
When I run :set foo?
Then the error "set: No option 'foo'" should be shown
2015-11-10 21:27:42 +01:00
Scenario: Invalid option with !
2017-06-16 18:16:19 +02:00
When I run :set foo!
Then the error "set: No option 'foo'" should be shown