From b8156a0c32a26f264466272a2d0d575a3517ea66 Mon Sep 17 00:00:00 2001 From: Sebastian Frysztak Date: Thu, 6 Oct 2016 21:02:15 +0200 Subject: [PATCH 1/3] BDD tests for :command-history-prev/next ref #999 --- tests/end2end/features/misc.feature | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index c24f0ea9f..7aaf82930 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -671,3 +671,38 @@ Feature: Various utility commands. And I wait until the scroll position changed And I run :click-element id link Then the error "Element position is out of view!" should be shown + + ## :command-history-{prev,next} + + Scenario: Calling previous command + When I run :set-cmd-text :message-info blah + And I run :command-accept + And I wait for "blah" in the log + And I run :set-cmd-text : + And I run :command-history-prev + And I run :command-accept + Then the message "blah" should be shown + + Scenario: Browsing through commands + When I run :set-cmd-text :message-info blarg + And I run :command-accept + And I wait for "blarg" in the log + And I run :set-cmd-text : + And I run :command-history-prev + And I run :command-history-prev + And I run :command-history-next + And I run :command-accept + Then the message "blarg" should be shown + + Scenario: Calling previous command when history is empty + Given I have a fresh instance + When I run :set-cmd-text : + And I run :command-history-prev + And I run :command-accept + Then the error "No command given" should be shown + + Scenario: Calling next command when there's no next command + When I run :set-cmd-text : + And I run :command-history-next + And I run :command-accept + Then the error "No command given" should be shown From 5eed5eb7f737da50006a8f19cb1b1f3f5de1edf0 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 7 Oct 2016 09:44:54 +0200 Subject: [PATCH 2/3] commit 5708bb0306fb28549fc47e686790d006398c27fa Author: Florian Bruhin Date: Fri Oct 7 07:44:54 2016 +0200 Turn off private browsing in misc.feature tests --- tests/end2end/features/misc.feature | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index 7aaf82930..930da91dc 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -549,6 +549,7 @@ Feature: Various utility commands. And I open cookies/set?qute-test=42 without waiting And I wait until cookies is loaded And I open cookies in a new tab + And I set general -> private-browsing to false Then the cookie qute-test should be set to 42 ## https://github.com/The-Compiler/qutebrowser/issues/1742 @@ -557,6 +558,7 @@ Feature: Various utility commands. Scenario: Private browsing is activated in QtWebKit without restart When I set general -> private-browsing to true And I open data/javascript/localstorage.html + And I set general -> private-browsing to false Then the page should contain the plaintext "Local storage status: not working" Scenario: :repeat-command From a8847eacbef0c40a082a933ea9ea00b56bed00bc Mon Sep 17 00:00:00 2001 From: Sebastian Frysztak Date: Sat, 8 Oct 2016 18:14:37 +0200 Subject: [PATCH 3/3] Cover HistoryEndReachedError in command_history_next(). --- tests/end2end/features/misc.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index 930da91dc..bac6125a7 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -693,6 +693,7 @@ Feature: Various utility commands. And I run :command-history-prev And I run :command-history-prev And I run :command-history-next + And I run :command-history-next And I run :command-accept Then the message "blarg" should be shown