Add tests for auto-[leave-]insert-mode

This commit is contained in:
Philipp Hansch 2016-04-20 12:50:33 +02:00
parent 601687ba61
commit ff13921aad
3 changed files with 49 additions and 11 deletions

View File

@ -7,9 +7,5 @@
<body>
<textarea id="qute-textarea"></textarea>
<input id="qute-input" type="text" value=""/>
<select id="qute-select124" name="qute-select124" onchange="location = this.value;">
<option value="about:blank">browser</option>
</select>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Inputs Autofocus</title>
</head>
<body>
<input id="qute-input-autofocus" type="text" autofocus value=""/>
<input id="qute-input-disabled" disabled="disabled" href="#"/>
</body>
</html>

View File

@ -1,13 +1,13 @@
Feature: Insert mode
Background:
Given I open data/inputs.html
And I run :hint all
# textarea tag
Scenario: Basic insertion of text in textarea
When I run :follow-hint a
When I open data/inputs.html
And I run :hint all
And I run :follow-hint a
And I press the keys "qutebrowser"
And I run :hint all
And I run :follow-hint a
@ -19,7 +19,9 @@ Feature: Insert mode
And the clipboard should contain "qutebrowser"
Scenario: Paste from primary selection into textarea
When I put "superqutebrowser" into the primary selection
When I open data/inputs.html
And I run :hint all
And I put "superqutebrowser" into the primary selection
And I run :follow-hint a
And I run :paste-primary
And I run :hint all
@ -34,7 +36,9 @@ Feature: Insert mode
# input tag
Scenario: Basic insertion of text in input field
When I run :follow-hint s
When I open data/inputs.html
And I run :hint all
And I run :follow-hint s
And I press the keys "qutebrowser"
And I run :hint all
And I run :follow-hint s
@ -46,7 +50,9 @@ Feature: Insert mode
And the clipboard should contain "qutebrowser"
Scenario: Paste from primary selection into input field
When I put "superqutebrowser" into the primary selection
When I open data/inputs.html
And I run :hint all
And I put "superqutebrowser" into the primary selection
And I run :follow-hint s
And I run :paste-primary
And I run :hint all
@ -58,7 +64,32 @@ Feature: Insert mode
Then the message "16 chars yanked to clipboard" should be shown
And the clipboard should contain "superqutebrowser"
# # select/option tag
# input -> auto-insert-mode
Scenario: With input -> auto-insert-mode enabled
When I set input -> auto-insert-mode to true
And I open data/inputs_autofocus.html
And I press the keys "qutebrowser"
And I run :hint all
And I run :follow-hint a
And I run :enter-mode caret
And I run :toggle-selection
And I run :move-to-prev-word
And I run :yank-selected
Then the message "11 chars yanked to clipboard" should be shown
And the clipboard should contain "qutebrowser"
# input -> auto-leave-insert-mode
Scenario: With input -> auto-leave-insert-mode enabled
When I set input -> auto-leave-insert-mode to true
And I open data/inputs_autofocus.html
And I press the keys "abcd"
And I run :hint all
And I run :follow-hint s
And I run :paste-primary
Then the error "paste-primary: This command is only allowed in insert mode." should be shown
# Scenario: Select an option from a dropdown
# When I run :follow-hint d