From 601687ba61605317e30bededd43214890e7858ec Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Tue, 29 Mar 2016 22:51:49 +0200 Subject: [PATCH] Add insert mode feature tests Issue-Link: #999 --- tests/integration/data/inputs.html | 15 ++++ tests/integration/features/insertmode.feature | 69 +++++++++++++++++++ tests/integration/features/test_insertmode.py | 25 +++++++ 3 files changed, 109 insertions(+) create mode 100644 tests/integration/data/inputs.html create mode 100644 tests/integration/features/insertmode.feature create mode 100644 tests/integration/features/test_insertmode.py diff --git a/tests/integration/data/inputs.html b/tests/integration/data/inputs.html new file mode 100644 index 000000000..9bd445bf0 --- /dev/null +++ b/tests/integration/data/inputs.html @@ -0,0 +1,15 @@ + + + + + Inputs + + + + + + + + diff --git a/tests/integration/features/insertmode.feature b/tests/integration/features/insertmode.feature new file mode 100644 index 000000000..fc3c782ae --- /dev/null +++ b/tests/integration/features/insertmode.feature @@ -0,0 +1,69 @@ +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 + 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" + + Scenario: Paste from primary selection into textarea + When I put "superqutebrowser" into the primary selection + And I run :follow-hint a + And I run :paste-primary + 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 "16 chars yanked to clipboard" should be shown + And the clipboard should contain "superqutebrowser" + + # input tag + + Scenario: Basic insertion of text in input field + When I run :follow-hint s + And I press the keys "qutebrowser" + And I run :hint all + And I run :follow-hint s + 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" + + Scenario: Paste from primary selection into input field + When I put "superqutebrowser" into the primary selection + And I run :follow-hint s + And I run :paste-primary + And I run :hint all + And I run :follow-hint s + 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 "16 chars yanked to clipboard" should be shown + And the clipboard should contain "superqutebrowser" + + # # select/option tag + + # Scenario: Select an option from a dropdown + # When I run :follow-hint d + # And I run :enter-mode insert + # And I press the keys "b" + # And I press the keys "" + # Then the following tabs should be open: + # - about:blank (active) diff --git a/tests/integration/features/test_insertmode.py b/tests/integration/features/test_insertmode.py new file mode 100644 index 000000000..aa1a74a33 --- /dev/null +++ b/tests/integration/features/test_insertmode.py @@ -0,0 +1,25 @@ +# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: + +# Copyright 2016 Florian Bruhin (The Compiler) +# +# This file is part of qutebrowser. +# +# qutebrowser is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# qutebrowser is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with qutebrowser. If not, see . + +import pytest_bdd as bdd + +# pylint: disable=unused-import +from test_yankpaste import init_fake_clipboard + +bdd.scenarios('insertmode.feature')