hints: split tests into individual HTML files

This commit is contained in:
Jakub Klinkovský 2016-02-23 18:14:37 +01:00
parent 58d2d92d67
commit 35ed70cfe0
8 changed files with 90 additions and 98 deletions

View File

@ -1 +0,0 @@
Hello World 4!

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<!-- target: hello.txt -->
<html>
<head>
<meta charset="utf-8">
<title>Link containing an element with "display: block" style</title>
</head>
<body>
<a href="/data/hello.txt">
<span style="display: block;">
link
</span>
</a>
</body>
</html>

View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<!-- target: hello.txt -->
<html>
<head>
<meta charset="utf-8">
<title>Link containing formatting tags</title>
</head>
<body>
<a href="/data/hello.txt">
link<br>
<em>link</em><br>
<strong>link</strong><br>
<i>link</i><br>
<b>link</b><br>
link
</a>
</body>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<!-- target: hello.txt -->
<html>
<head>
<meta charset="utf-8">
<title>Link containing an element with "display: table" style</title>
</head>
<body>
<a href="/data/hello.txt">
<span style="display: table;">
link
</span>
</a>
</body>
</html>

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<!-- target: hello.txt -->
<html>
<head>
<meta charset="utf-8">
<title>Link wrapped across multiple lines</title>
</head>
<body>
<div style="width: 20em;">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis <a href="/data/hello.txt">nostrud exercitation</a> ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
</body>
</html>

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<!-- target: hello.txt -->
<html>
<head>
<meta charset="utf-8">
<title>Test hinting precision with different zoom levels</title>
</head>
<body>
<div style="margin-top: 120px;">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim <a href="/data/hello.txt">id</a> est laborum.
</div>
</body>
</html>

View File

@ -1,61 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>A link to use hints on</title>
<style>
body > p {border: 1px solid silver;}
</style>
</head>
<body>
<p>
Simple test:
<a href="/data/hello.txt">Follow me!</a>
</p>
<p>
Test <code>&lt;a&gt;</code> containing formatting tags (<code>&lt;br&gt;</code>, <code>&lt;em&gt;</code>, <code>&lt;strong&gt;</code>, <code>&lt;i&gt;</code>, <code>&lt;b&gt;</code>):
<br>
<a href="/data/hello2.txt">
link 2<br>
<em>link 2</em><br>
<strong>link 2</strong><br>
<i>link 2</i><br>
<b>link 2</b><br>
link 2
</a>
</p>
<p>
Test <code>&lt;a&gt;</code> containing <code>&lt;span style="display: block;"&gt;</code>:
<a href="/data/hello3.txt">
<span style="display: block;">
link 3
</span>
</a>
</p>
<p>
Test <code>&lt;a&gt;</code> containing <code>&lt;span style="display: table;"&gt;</code>:
<a href="/data/hello4.txt">
<span style="display: table;">
link 4
</span>
</a>
</p>
<div style="border: 1px solid silver;">
<p>Test links wrapped across multiple lines:</p>
<div style="width: 20em;">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis <a href="/data/hello.txt">nostrud exercitation</a> ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
</div>
<div style="border: 1px solid silver;">
<p>Test precision with different zoom levels:</p>
<div>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim <a href="/data/hello.txt">id</a> est laborum.
</div>
</div>
</body>
</html>

View File

@ -1,61 +1,31 @@
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 data/hello.txt should be loaded
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
When I open data/hints/html/simple.html
And I run :hint links normal
And I run :follow-hint xyz
Then the error "No hint xyz!" should be shown
### Hinting problematic links
Scenario: Following a hint (link containing formatting tags)
When I open data/hints/link.html
And I run :hint links normal
And I run :follow-hint s
Then data/hello2.txt should be loaded
Scenario: Following a hint (link containing tag with display:block style)
When I open data/hints/link.html
And I run :hint links normal
And I run :follow-hint d
Then data/hello3.txt should be loaded
Scenario: Following a hint (link containing tag with display:table style)
When I open data/hints/link.html
And I run :hint links normal
And I run :follow-hint f
Then data/hello4.txt should be loaded
Scenario: Following a link wrapped across multiple lines.
When I open data/hints/link.html
And I run :hint links normal
And I run :follow-hint g
Then data/hello.txt should be loaded
### TODO: use test_hints_html.py for zoom tests
Scenario: Following a link with zoom 75%.
When I open data/hints/link.html
When I open data/hints/html/zoom_precision.html
And I run :zoom 75
And I run :hint links normal
And I run :follow-hint h
And I run :follow-hint a
And I run :zoom 100
Then data/hello.txt should be loaded
Scenario: Following a link with zoom 75% and zoom-text-only == True.
When I open data/hints/link.html
When I open data/hints/html/zoom_precision.html
And I run :set ui zoom-text-only true
And I run :zoom 75
And I run :hint links normal
And I run :follow-hint h
And I run :follow-hint a
And I run :zoom 100
And I run :set ui zoom-text-only false
Then data/hello.txt should be loaded