hints: move zoom tests to test_hints_html.py

This commit is contained in:
Jakub Klinkovský 2016-02-23 18:51:32 +01:00
parent 35ed70cfe0
commit 891a31a0ca
2 changed files with 10 additions and 21 deletions

View File

@ -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

View File

@ -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')