Try to stabilize test_insert_mode

This commit is contained in:
Florian Bruhin 2016-10-06 10:40:28 +02:00
parent 356f6dc924
commit 53ef16e26b
4 changed files with 33 additions and 3 deletions

View File

@ -3,8 +3,17 @@
<head>
<meta charset="utf-8">
<title>Inputs Autofocus</title>
<script type="text/javascript">
function setup_event_listener() {
var elem = document.getElementById('qute-input-autofocus');
console.log(elem);
elem.addEventListener('input', function() {
console.log("contents: " + elem.value);
});
}
</script>
</head>
<body>
<body onload="setup_event_listener()">
<input id="qute-input-autofocus" type="text" autofocus value=""/>
<input id="qute-input-disabled" disabled="disabled" href="#"/>
</body>

View File

@ -3,8 +3,17 @@
<head>
<meta charset="utf-8">
<title>Input</title>
<script type="text/javascript">
function setup_event_listener() {
var elem = document.getElementById('qute-input');
console.log(elem);
elem.addEventListener('input', function() {
console.log("contents: " + elem.value);
});
}
</script>
</head>
<body>
<body onload="setup_event_listener()">
<input id="qute-input" type="text" value=""/>
</body>
</html>

View File

@ -3,8 +3,16 @@
<head>
<meta charset="utf-8">
<title>Textarea</title>
<script type="text/javascript">
function setup_event_listener() {
var elem = document.getElementById('qute-textarea');
elem.addEventListener('input', function() {
console.log("contents: " + elem.value);
});
}
</script>
</head>
<body>
<body onload="setup_event_listener()">
<textarea id="qute-textarea"></textarea>
</body>
</html>

View File

@ -56,6 +56,10 @@ def test_insert_mode(file_name, elem_id, source, input_text, auto_insert,
# second time.
quteproc.send_cmd(':debug-set-fake-clipboard "{}"'.format(input_text))
quteproc.send_cmd(':insert-text {clipboard}')
else:
raise ValueError("Invalid source {!r}".format(source))
quteproc.wait_for_js('contents: {}'.format(input_text))
quteproc.send_cmd(':leave-mode')
quteproc.send_cmd(':hint all')