2017-03-31 17:16:31 +02:00
|
|
|
# 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
|
2017-06-16 17:52:28 +02:00
|
|
|
When I run :set colors.statusbar.normal.bg magenta
|
2017-06-19 13:35:38 +02:00
|
|
|
Then the option colors.statusbar.normal.bg should be set to magenta
|
2015-11-10 21:07:49 +01:00
|
|
|
|
|
|
|
Scenario: Without value
|
2017-06-16 17:52:28 +02:00
|
|
|
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-19 13:35:38 +02:00
|
|
|
Then the option 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
|
|
|
|
2016-08-11 04:31:42 +02: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
|
2017-06-19 13:35:38 +02:00
|
|
|
Then the option colors.statusbar.normal.bg should be set to blue
|
2016-08-11 04:31:42 +02:00
|
|
|
|
|
|
|
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
|
2017-06-19 13:35:38 +02:00
|
|
|
Then the option colors.statusbar.normal.bg should be set to green
|
2016-08-11 04:31:42 +02:00
|
|
|
|
|
|
|
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
|
2017-06-19 13:35:38 +02:00
|
|
|
Then the option colors.statusbar.normal.bg should be set to green
|
2016-08-11 04:31:42 +02:00
|
|
|
|
|
|
|
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
|
2017-06-19 13:35:38 +02:00
|
|
|
Then the option colors.statusbar.normal.bg should be set to red
|
2016-08-11 04:31:42 +02:00
|
|
|
|
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
|
2017-06-19 13:35:38 +02:00
|
|
|
Then the option colors.statusbar.normal.bg should be set to green
|
2015-11-10 21:07:49 +01:00
|
|
|
|
2017-04-06 20:38:15 +02:00
|
|
|
# qute://settings isn't actually implemented on QtWebEngine, but this works
|
2016-09-15 16:13:13 +02:00
|
|
|
# (and displays a page saying it's not available)
|
2017-04-06 20:38:15 +02:00
|
|
|
Scenario: Opening qute://settings
|
2015-11-10 21:07:49 +01:00
|
|
|
When I run :set
|
2017-04-06 20:38:15 +02:00
|
|
|
And I wait until qute://settings is loaded
|
2015-11-26 01:33:56 +01:00
|
|
|
Then the following tabs should be open:
|
2017-04-06 20:38:15 +02:00
|
|
|
- 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-19 13:35:38 +02:00
|
|
|
Then the option 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>"
|
2016-08-26 15:33:21 +02:00
|
|
|
# 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
|