Try to make test_hints work with QtWebEngine
This commit is contained in:
parent
94e3d7b050
commit
63cc73d56d
@ -40,7 +40,13 @@ def collect_tests():
|
|||||||
@pytest.mark.parametrize('zoom_level', [100, 66, 33])
|
@pytest.mark.parametrize('zoom_level', [100, 66, 33])
|
||||||
@pytest.mark.parametrize('find_implementation', ['javascript', 'python'])
|
@pytest.mark.parametrize('find_implementation', ['javascript', 'python'])
|
||||||
def test_hints(test_name, zoom_text_only, zoom_level, find_implementation,
|
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__)),
|
file_path = os.path.join(os.path.abspath(os.path.dirname(__file__)),
|
||||||
'data', 'hints', 'html', test_name)
|
'data', 'hints', 'html', test_name)
|
||||||
url_path = 'data/hints/html/{}'.format(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()))))
|
test_name, ', '.join(set(parsed.keys()))))
|
||||||
|
|
||||||
# setup
|
# setup
|
||||||
|
if not request.config.getoption('--qute-bdd-webengine'):
|
||||||
quteproc.set_setting('ui', 'zoom-text-only', str(zoom_text_only))
|
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))
|
quteproc.send_cmd(':zoom {}'.format(zoom_level))
|
||||||
# follow hint
|
# follow hint
|
||||||
quteproc.send_cmd(':hint links normal')
|
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'])
|
quteproc.wait_for_load_finished('data/' + parsed['target'])
|
||||||
# reset
|
# reset
|
||||||
quteproc.send_cmd(':zoom 100')
|
quteproc.send_cmd(':zoom 100')
|
||||||
|
if not request.config.getoption('--qute-bdd-webengine'):
|
||||||
quteproc.set_setting('ui', 'zoom-text-only', 'false')
|
quteproc.set_setting('ui', 'zoom-text-only', 'false')
|
||||||
quteproc.set_setting('hints', 'find-implementation', 'javascript')
|
quteproc.set_setting('hints', 'find-implementation', 'javascript')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user