2015-11-10 21:07:49 +01:00
|
|
|
Feature: Setting settings.
|
|
|
|
|
|
|
|
Background:
|
|
|
|
Given I set ui -> message-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
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "set: Either both section and option have to be given, or neither!" should be shown
|
2015-11-10 21:07:49 +01:00
|
|
|
|
|
|
|
Scenario: Without value
|
|
|
|
When I run :set colors statusbar.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 section
|
|
|
|
When I run :set blah blub foo
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "set: Section 'blah' does not exist!" should be shown
|
2015-11-10 21:07:49 +01:00
|
|
|
|
|
|
|
Scenario: Invalid option
|
|
|
|
When I run :set general blub foo
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "set: No option 'blub' in section 'general'" should be shown
|
2015-11-10 21:07:49 +01:00
|
|
|
|
|
|
|
Scenario: Toggling an option
|
|
|
|
When I run :set general auto-save-config false
|
|
|
|
And I run :set general auto-save-config!
|
2016-06-08 20:37:13 +02:00
|
|
|
Then general -> auto-save-config should be true
|
2015-11-10 21:07:49 +01:00
|
|
|
|
|
|
|
Scenario: Toggling a non-bool option
|
|
|
|
When I run :set colors statusbar.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: Getting an option
|
|
|
|
When I run :set colors statusbar.bg magenta
|
|
|
|
And I run :set colors statusbar.bg?
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the message "colors statusbar.bg = magenta" should be shown
|
2015-11-10 21:07:49 +01:00
|
|
|
|
|
|
|
Scenario: Using -p
|
|
|
|
When I run :set -p colors statusbar.bg red
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the message "colors statusbar.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
|
|
|
|
When I run :set general auto-save-config false
|
|
|
|
And I run :set -p general auto-save-config!
|
2016-06-08 20:37:13 +02:00
|
|
|
Then the message "general 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
|
|
|
|
When I run :set general 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.
|
|
|
|
When I run :set -t colors statusbar.bg green
|
|
|
|
Then colors -> statusbar.bg should be green
|
|
|
|
|
2016-09-15 16:13:13 +02:00
|
|
|
# qute:settings isn't actually implemented on QtWebEngine, but this works
|
|
|
|
# (and displays a page saying it's not available)
|
2015-11-10 21:07:49 +01:00
|
|
|
Scenario: Opening qute:settings
|
|
|
|
When I run :set
|
2015-12-02 22:19:43 +01:00
|
|
|
And I wait until qute:settings is loaded
|
2015-11-26 01:33:56 +01:00
|
|
|
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
|
|
|
@qtwebengine_todo: qute:settings is not implemented yet
|
|
|
|
Scenario: Focusing input fields in qute://settings and entering valid value
|
2016-08-29 07:08:57 +02:00
|
|
|
When I set general -> ignore-case to false
|
|
|
|
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
|
|
|
|
And I hint with args "inputs" and follow a
|
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 "true"
|
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>"
|
2016-08-29 07:08:57 +02:00
|
|
|
Then general -> ignore-case should be true
|
2016-08-26 13:45:21 +02:00
|
|
|
|
|
|
|
@qtwebengine_todo: qute:settings is not implemented yet
|
|
|
|
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
|
|
|
|
And I hint with args "inputs" and follow a
|
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)
|
|
|
|
When I run :set general ?
|
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 section and empty option with ? (issue 1109)
|
|
|
|
When I run :set blah ?
|
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)
|
|
|
|
When I run :set general foo?
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "set: No option 'foo' in section 'general'" should be shown
|
2015-11-10 21:27:42 +01:00
|
|
|
|
|
|
|
Scenario: Invalid section/option with ? (issue 1109)
|
|
|
|
When I run :set blah foo ?
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "set: Section 'blah' does not exist!" should be shown
|
2015-11-10 21:27:42 +01:00
|
|
|
|
|
|
|
Scenario: Empty option with !
|
|
|
|
When I run :set general !
|
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 section and empty option with !
|
|
|
|
When I run :set blah !
|
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 !
|
|
|
|
When I run :set general foo!
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "set: No option 'foo' in section 'general'" should be shown
|
2015-11-10 21:27:42 +01:00
|
|
|
|
|
|
|
Scenario: Invalid section/option with !
|
|
|
|
When I run :set blah foo !
|
2015-11-26 17:50:39 +01:00
|
|
|
Then the error "set: Section 'blah' does not exist!" should be shown
|