hints: add tests for links known to cause troubles

This commit is contained in:
Jakub Klinkovský 2016-02-15 19:02:29 +01:00
parent a546933516
commit 748ec043fb
3 changed files with 94 additions and 1 deletions

View File

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

View File

@ -3,8 +3,52 @@
<head>
<meta charset="utf-8">
<title>A link to use hints on</title>
<style>
body > p {border: 1px solid silver;}
</style>
</head>
<body>
<a href="/data/hello.txt">Follow me!</a>
<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>
</body>
</html>

View File

@ -18,3 +18,51 @@ Feature: Using hints
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
# bypass Qt cache
And I run :reload --force
And I run :hint links normal
And I run :follow-hint s
And I wait until data/hello2.txt is loaded
Then the requests should be:
data/hints/link.html
data/hello2.txt
Scenario: Following a hint (link containing tag with display:block style)
When I open data/hints/link.html
# bypass Qt cache
And I run :reload --force
And I run :hint links normal
And I run :follow-hint d
And I wait until data/hello3.txt is loaded
Then the requests should be:
data/hints/link.html
data/hello3.txt
Scenario: Following a hint (link containing tag with display:table style)
When I open data/hints/link.html
# bypass Qt cache
And I run :reload --force
And I run :hint links normal
And I run :follow-hint f
And I wait until data/hello4.txt is loaded
Then the requests should be:
data/hints/link.html
data/hello4.txt
Scenario: Following a link wrapped across multiple lines.
When I open data/hints/link.html
# bypass Qt cache
And I run :reload --force
And I run :hint links normal
And I run :follow-hint g
And I wait until data/hello.txt is loaded
# bypass Qt cache
And I run :reload --force
Then the requests should be:
data/hints/link.html
data/hello.txt