From 5c9157be05c2425d3bf2e241e974046ee45dd2f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 2 Aug 2016 02:13:58 +0200 Subject: [PATCH] tests: fix newline input in DispVM editor tests Just '\n' isn't enough for xdotool to enter newline. --- tests/dispvm.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/dispvm.py b/tests/dispvm.py index d35e6f86..164a202c 100644 --- a/tests/dispvm.py +++ b/tests/dispvm.py @@ -330,7 +330,9 @@ class TC_20_DispVMMixin(qubes.tests.SystemTestsMixin): time.sleep(1) if "gedit" in window_title: subprocess.check_call(['xdotool', 'windowactivate', '--sync', winid, - 'type', 'Test test 2\n']) + 'type', 'Test test 2']) + subprocess.check_call(['xdotool', 'key', '--window', winid, + 'key', 'Return']) time.sleep(0.5) subprocess.check_call(['xdotool', 'key', 'ctrl+s', 'ctrl+q']) @@ -345,14 +347,18 @@ class TC_20_DispVMMixin(qubes.tests.SystemTestsMixin): winid = search.stdout.read().strip() time.sleep(0.5) subprocess.check_call(['xdotool', 'windowactivate', '--sync', winid, - 'type', 'Test test 2\n']) + 'type', 'Test test 2']) + subprocess.check_call(['xdotool', 'key', '--window', winid, + 'key', 'Return']) time.sleep(0.5) subprocess.check_call(['xdotool', 'key', '--delay', '100', 'ctrl+s', 'Return', 'ctrl+q']) elif "emacs" in window_title: subprocess.check_call(['xdotool', 'windowactivate', '--sync', winid, - 'type', 'Test test 2\n']) + 'type', 'Test test 2']) + subprocess.check_call(['xdotool', 'key', '--window', winid, + 'key', 'Return']) time.sleep(0.5) subprocess.check_call(['xdotool', 'key', 'ctrl+x', 'ctrl+s']) @@ -360,7 +366,9 @@ class TC_20_DispVMMixin(qubes.tests.SystemTestsMixin): 'key', 'ctrl+x', 'ctrl+c']) elif "vim" in window_title or "user@" in window_title: subprocess.check_call(['xdotool', 'windowactivate', '--sync', winid, - 'key', 'i', 'type', 'Test test 2\n']) + 'key', 'i', 'type', 'Test test 2']) + subprocess.check_call(['xdotool', 'key', '--window', winid, + 'key', 'Return']) subprocess.check_call( ['xdotool', 'key', 'Escape', 'colon', 'w', 'q', 'Return'])