bdd: Add some first tests for hints.
This commit is contained in:
parent
f3d76b5af6
commit
dce44f2dc5
10
tests/integration/data/hints/link.html
Normal file
10
tests/integration/data/hints/link.html
Normal 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>
|
19
tests/integration/features/hints.feature
Normal file
19
tests/integration/features/hints.feature
Normal 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.
|
21
tests/integration/features/test_hints.py
Normal file
21
tests/integration/features/test_hints.py
Normal 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')
|
Loading…
Reference in New Issue
Block a user