bdd: Add some first tests for hints.

This commit is contained in:
Florian Bruhin 2015-11-09 18:17:13 +01:00
parent f3d76b5af6
commit dce44f2dc5
3 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>A link to use hints on</title>
</head>
<body>
<a href="/data/hello.txt">Follow me!</a>
</body>
</html>

View File

@ -0,0 +1,19 @@
Feature: Using hints
Scenario: Following a hint.
When I open data/hints/link.html
And I run :hint links normal
And I run :follow-hint a
Then the requests should be:
data/hints/link.html
data/hello.txt
Scenario: Using :follow-hint outside of hint mode (issue 1105)
When I run :follow-hint
Then the error "follow-hint: This command is only allowed in hint mode." should be shown.
Scenario: Using :follow-hint with an invalid index.
When I open data/hints/link.html
And I run :hint links normal
And I run :follow-hint xyz
Then the error "No hint xyz!" should be shown.

View File

@ -0,0 +1,21 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# 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 <http://www.gnu.org/licenses/>.
import pytest_bdd as bdd
bdd.scenarios('hints.feature')