From 891a31a0cacc26fd867199769636f5360dcc5411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Tue, 23 Feb 2016 18:51:32 +0100 Subject: [PATCH] hints: move zoom tests to test_hints_html.py --- tests/integration/features/hints.feature | 20 -------------------- tests/integration/test_hints_html.py | 11 ++++++++++- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/tests/integration/features/hints.feature b/tests/integration/features/hints.feature index 7eb64b87e..f15858d76 100644 --- a/tests/integration/features/hints.feature +++ b/tests/integration/features/hints.feature @@ -9,23 +9,3 @@ Feature: Using hints And I run :hint links normal And I run :follow-hint xyz Then the error "No hint xyz!" should be shown - - ### TODO: use test_hints_html.py for zoom tests - - Scenario: Following a link with zoom 75%. - 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 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/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 a - And I run :zoom 100 - And I run :set ui zoom-text-only false - Then data/hello.txt should be loaded diff --git a/tests/integration/test_hints_html.py b/tests/integration/test_hints_html.py index cc668193d..a6ea22b9d 100644 --- a/tests/integration/test_hints_html.py +++ b/tests/integration/test_hints_html.py @@ -35,7 +35,9 @@ def collect_tests(): @pytest.mark.parametrize('test_name', collect_tests()) -def test_hints(test_name, quteproc): +@pytest.mark.parametrize('zoom_text_only', [True, False]) +@pytest.mark.parametrize('zoom_level', [100, 66, 33]) +def test_hints(test_name, zoom_text_only, zoom_level, quteproc): file_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data', 'hints', 'html', test_name) url_path = 'data/hints/html/{}'.format(test_name) @@ -50,7 +52,14 @@ def test_hints(test_name, quteproc): assert set(parsed.keys()) == {'target'} + # setup + quteproc.send_cmd(':set ui zoom-text-only {}'.format(zoom_text_only)) + quteproc.send_cmd(':zoom {}'.format(zoom_level)) + # follow hint quteproc.send_cmd(':hint links normal') quteproc.wait_for(message='hints: a', category='hints') quteproc.send_cmd(':follow-hint a') quteproc.wait_for_load_finished('data/' + parsed['target']) + # reset + quteproc.send_cmd(':zoom 100') + quteproc.send_cmd(':set ui zoom-text-only false')