From 35ed70cfe077bc4c14ca22cc0bbd62fba9735b73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Tue, 23 Feb 2016 18:14:37 +0100 Subject: [PATCH] hints: split tests into individual HTML files --- tests/integration/data/hello4.txt | 1 - .../data/hints/html/nested_block_style.html | 17 ++++++ .../hints/html/nested_formatting_tags.html | 20 ++++++ .../data/hints/html/nested_table_style.html | 17 ++++++ .../integration/data/hints/html/wrapped.html | 15 +++++ .../data/hints/html/zoom_precision.html | 15 +++++ tests/integration/data/hints/link.html | 61 ------------------- tests/integration/features/hints.feature | 42 ++----------- 8 files changed, 90 insertions(+), 98 deletions(-) delete mode 100644 tests/integration/data/hello4.txt create mode 100644 tests/integration/data/hints/html/nested_block_style.html create mode 100644 tests/integration/data/hints/html/nested_formatting_tags.html create mode 100644 tests/integration/data/hints/html/nested_table_style.html create mode 100644 tests/integration/data/hints/html/wrapped.html create mode 100644 tests/integration/data/hints/html/zoom_precision.html delete mode 100644 tests/integration/data/hints/link.html diff --git a/tests/integration/data/hello4.txt b/tests/integration/data/hello4.txt deleted file mode 100644 index a31ec61e8..000000000 --- a/tests/integration/data/hello4.txt +++ /dev/null @@ -1 +0,0 @@ -Hello World 4! diff --git a/tests/integration/data/hints/html/nested_block_style.html b/tests/integration/data/hints/html/nested_block_style.html new file mode 100644 index 000000000..9ee1ff603 --- /dev/null +++ b/tests/integration/data/hints/html/nested_block_style.html @@ -0,0 +1,17 @@ + + + + + + + + Link containing an element with "display: block" style + + + + + link + + + + diff --git a/tests/integration/data/hints/html/nested_formatting_tags.html b/tests/integration/data/hints/html/nested_formatting_tags.html new file mode 100644 index 000000000..66c3d6e04 --- /dev/null +++ b/tests/integration/data/hints/html/nested_formatting_tags.html @@ -0,0 +1,20 @@ + + + + + + + + Link containing formatting tags + + + + link
+ link
+ link
+ link
+ link
+ link +
+ + diff --git a/tests/integration/data/hints/html/nested_table_style.html b/tests/integration/data/hints/html/nested_table_style.html new file mode 100644 index 000000000..a6a1a2b8f --- /dev/null +++ b/tests/integration/data/hints/html/nested_table_style.html @@ -0,0 +1,17 @@ + + + + + + + + Link containing an element with "display: table" style + + + + + link + + + + diff --git a/tests/integration/data/hints/html/wrapped.html b/tests/integration/data/hints/html/wrapped.html new file mode 100644 index 000000000..dcc05c8c7 --- /dev/null +++ b/tests/integration/data/hints/html/wrapped.html @@ -0,0 +1,15 @@ + + + + + + + + Link wrapped across multiple lines + + +
+ 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 id est laborum. +
+ + diff --git a/tests/integration/data/hints/html/zoom_precision.html b/tests/integration/data/hints/html/zoom_precision.html new file mode 100644 index 000000000..5b9b73f99 --- /dev/null +++ b/tests/integration/data/hints/html/zoom_precision.html @@ -0,0 +1,15 @@ + + + + + + + + Test hinting precision with different zoom levels + + +
+ 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 id est laborum. +
+ + diff --git a/tests/integration/data/hints/link.html b/tests/integration/data/hints/link.html deleted file mode 100644 index 8075cc821..000000000 --- a/tests/integration/data/hints/link.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - A link to use hints on - - - -

- Simple test: - Follow me! -

- -

- Test <a> containing formatting tags (<br>, <em>, <strong>, <i>, <b>): -
- - link 2
- link 2
- link 2
- link 2
- link 2
- link 2 -
-

- -

- Test <a> containing <span style="display: block;">: - - - link 3 - - -

- -

- Test <a> containing <span style="display: table;">: - - - link 4 - - -

- -
-

Test links wrapped across multiple lines:

-
- 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 id est laborum. -
-
- -
-

Test precision with different zoom levels:

-
- 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 id est laborum. -
-
- - diff --git a/tests/integration/features/hints.feature b/tests/integration/features/hints.feature index a2d4d3985..7eb64b87e 100644 --- a/tests/integration/features/hints.feature +++ b/tests/integration/features/hints.feature @@ -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