[gnome-boxes] tests: Add "Focus VM" step



commit ebe1b12572ad9d8f5c988e5380c2346762e0436b
Author: Vladimir Benes <benesv email cz>
Date:   Tue Jun 2 16:22:29 2015 +0200

    tests: Add "Focus VM" step
    
    Add step for (re-)focusing drawing area of VM.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744852

 tests/steps/general.py |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/tests/steps/general.py b/tests/steps/general.py
index e5e075f..3f5e76f 100644
--- a/tests/steps/general.py
+++ b/tests/steps/general.py
@@ -54,6 +54,13 @@ def customize_vm(context, mem):
     context.app.findChildren(lambda x: x.name == 'Back' and x.showing)[0].click()
     sleep(0.5)
 
+ step('Focus VM')
+def focus_vm(context):
+    drawing_area = None
+    drawing_area = context.app.findChildren(lambda x: x.roleName == 'drawing area' and x.showing)
+    if drawing_area:
+        drawing_area[0].click()
+
 @step('Go into "{vm}" box')
 def go_into_vm(context, vm):
     pane = context.app.child(roleName='layered pane')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]