Try to make test_hints work with QtWebEngine

This commit is contained in:
Florian Bruhin 2016-08-18 23:10:37 +02:00
parent 94e3d7b050
commit 63cc73d56d

View File

@ -40,7 +40,13 @@ def collect_tests():
@pytest.mark.parametrize('zoom_level', [100, 66, 33])
@pytest.mark.parametrize('find_implementation', ['javascript', 'python'])
def test_hints(test_name, zoom_text_only, zoom_level, find_implementation,
quteproc):
quteproc, request):
if zoom_text_only and request.config.getoption('--qute-bdd-webengine'):
pytest.skip("QtWebEngine doesn't have zoom-text-only")
if (find_implementation == 'python' and
request.config.getoption('--qute-bdd-webengine')):
pytest.skip("QtWebEngine doesn't have a python find implementation")
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)
@ -70,8 +76,10 @@ def test_hints(test_name, zoom_text_only, zoom_level, find_implementation,
test_name, ', '.join(set(parsed.keys()))))
# setup
if not request.config.getoption('--qute-bdd-webengine'):
quteproc.set_setting('ui', 'zoom-text-only', str(zoom_text_only))
quteproc.set_setting('hints', 'find-implementation', find_implementation)
quteproc.set_setting('hints', 'find-implementation',
find_implementation)
quteproc.send_cmd(':zoom {}'.format(zoom_level))
# follow hint
quteproc.send_cmd(':hint links normal')
@ -80,6 +88,7 @@ def test_hints(test_name, zoom_text_only, zoom_level, find_implementation,
quteproc.wait_for_load_finished('data/' + parsed['target'])
# reset
quteproc.send_cmd(':zoom 100')
if not request.config.getoption('--qute-bdd-webengine'):
quteproc.set_setting('ui', 'zoom-text-only', 'false')
quteproc.set_setting('hints', 'find-implementation', 'javascript')