Simplify test_insert_mode

We already check whether insert mode was entered by listening for "contents: *",
and the copying part is unstable with QtWebEngine.
This commit is contained in:
Florian Bruhin 2017-02-05 18:44:05 +01:00
parent f3b39c55a0
commit 2193551035

View File

@ -63,24 +63,7 @@ def test_insert_mode(file_name, elem_id, source, input_text, auto_insert, zoom,
raise ValueError("Invalid source {!r}".format(source))
quteproc.wait_for_js('contents: {}'.format(input_text))
quteproc.send_cmd(':leave-mode')
quteproc.send_cmd(':click-element --force-event id {}'.format(elem_id))
quteproc.wait_for(message='Entering mode KeyMode.insert (reason: *)')
if not request.config.webengine:
quteproc.send_cmd(':enter-mode caret')
quteproc.send_cmd(':toggle-selection')
quteproc.send_cmd(':move-to-prev-word')
quteproc.send_cmd(':yank selection')
expected_message = '{} chars yanked to clipboard'.format(len(input_text))
quteproc.mark_expected(category='message',
loglevel=logging.INFO,
message=expected_message)
quteproc.wait_for(
message='Setting fake clipboard: {}'.format(json.dumps(input_text)))
def test_auto_leave_insert_mode(quteproc):