tests: add --sync to xdotool windowactivate
This may help getting less errors from xdotool...
This commit is contained in:
parent
9bc60927c5
commit
3cb717dced
@ -127,7 +127,7 @@ class TC_00_AppVMMixin(qubes.tests.SystemTestsMixin):
|
|||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
subprocess.check_call(
|
subprocess.check_call(
|
||||||
['xdotool', 'search', '--name', title,
|
['xdotool', 'search', '--name', title,
|
||||||
'windowactivate', 'type', 'exit\n'])
|
'windowactivate', '--sync', 'type', 'exit\n'])
|
||||||
|
|
||||||
wait_count = 0
|
wait_count = 0
|
||||||
while subprocess.call(['xdotool', 'search', '--name', title],
|
while subprocess.call(['xdotool', 'search', '--name', title],
|
||||||
@ -168,7 +168,7 @@ class TC_00_AppVMMixin(qubes.tests.SystemTestsMixin):
|
|||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
subprocess.check_call(
|
subprocess.check_call(
|
||||||
['xdotool', 'search', '--name', title,
|
['xdotool', 'search', '--name', title,
|
||||||
'windowactivate', 'type', 'exit\n'])
|
'windowactivate', '--sync', 'type', 'exit\n'])
|
||||||
|
|
||||||
wait_count = 0
|
wait_count = 0
|
||||||
while subprocess.call(['xdotool', 'search', '--name', title],
|
while subprocess.call(['xdotool', 'search', '--name', title],
|
||||||
@ -1097,25 +1097,24 @@ class TC_20_DispVMMixin(qubes.tests.SystemTestsMixin):
|
|||||||
replace('(', '\(').replace(')', '\)')
|
replace('(', '\(').replace(')', '\)')
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
if "gedit" in window_title:
|
if "gedit" in window_title:
|
||||||
subprocess.check_call(['xdotool', 'search', '--name', window_title,
|
subprocess.check_call(['xdotool', 'windowactivate', '--sync', winid,
|
||||||
'windowactivate', 'type', 'test test 2\n'])
|
'type', 'test test 2\n'])
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
subprocess.check_call(['xdotool', 'search', '--name', window_title,
|
subprocess.check_call(['xdotool',
|
||||||
'key', 'ctrl+s', 'ctrl+q'])
|
'key', 'ctrl+s', 'ctrl+q'])
|
||||||
elif "emacs" in window_title:
|
elif "emacs" in window_title:
|
||||||
subprocess.check_call(['xdotool', 'search', '--name', window_title,
|
subprocess.check_call(['xdotool', 'windowactivate', '--sync', winid,
|
||||||
'windowactivate', 'type', 'test test 2\n'])
|
'type', 'test test 2\n'])
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
subprocess.check_call(['xdotool', 'search', '--name', window_title,
|
subprocess.check_call(['xdotool',
|
||||||
'key', 'ctrl+x', 'ctrl+s'])
|
'key', 'ctrl+x', 'ctrl+s'])
|
||||||
subprocess.check_call(['xdotool', 'search', '--name', window_title,
|
subprocess.check_call(['xdotool',
|
||||||
'key', 'ctrl+x', 'ctrl+c'])
|
'key', 'ctrl+x', 'ctrl+c'])
|
||||||
elif "vim" in window_title:
|
elif "vim" in window_title:
|
||||||
subprocess.check_call(['xdotool', 'search', '--name', window_title,
|
subprocess.check_call(['xdotool', 'windowactivate', '--sync', winid,
|
||||||
'windowactivate', 'key', 'i',
|
'key', 'i', 'type', 'test test 2\n'])
|
||||||
'type', 'test test 2\n'])
|
|
||||||
subprocess.check_call(
|
subprocess.check_call(
|
||||||
['xdotool', 'search', '--name', window_title,
|
['xdotool',
|
||||||
'key', 'Escape', 'colon', 'w', 'q', 'Return'])
|
'key', 'Escape', 'colon', 'w', 'q', 'Return'])
|
||||||
else:
|
else:
|
||||||
self.fail("Unknown editor window: {}".format(window_title))
|
self.fail("Unknown editor window: {}".format(window_title))
|
||||||
@ -1190,7 +1189,7 @@ class TC_30_Gui_daemon(qubes.tests.SystemTestsMixin, qubes.tests.QubesTestCase):
|
|||||||
|
|
||||||
# Type and copy some text
|
# Type and copy some text
|
||||||
subprocess.check_call(['xdotool', 'search', '--name', window_title,
|
subprocess.check_call(['xdotool', 'search', '--name', window_title,
|
||||||
'windowactivate',
|
'windowactivate', '--sync',
|
||||||
'type', '{}'.format(test_string)])
|
'type', '{}'.format(test_string)])
|
||||||
# second xdotool call because type --terminator do not work (SEGV)
|
# second xdotool call because type --terminator do not work (SEGV)
|
||||||
# additionally do not use search here, so window stack will be empty
|
# additionally do not use search here, so window stack will be empty
|
||||||
|
Loading…
Reference in New Issue
Block a user