[gnome-boxes] tests: Add "Type text and return" step



commit 237a3de964cdeb1c39c7fac90476efa51007afef
Author: Vladimir Benes <benesv email cz>
Date:   Wed Jun 10 13:46:01 2015 +0200

    tests: Add "Type text and return" step
    
    This step uses xdotool to write specified text into VM drawing area,
    and presses return. It works far better for shifted chars than dogtail
    and is very handy to execute commands in the VM.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=748006

 tests/steps/utils.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/tests/steps/utils.py b/tests/steps/utils.py
index e622c10..4ceabcc 100644
--- a/tests/steps/utils.py
+++ b/tests/steps/utils.py
@@ -78,6 +78,12 @@ def type_text(context, text):
     typeText(text)
     pressKey('Enter')
 
+ step('Type text "{text}" and return')
+def type_text_and_return(context, text):
+    call("xdotool type --delay 150 '%s'" %text, shell=True)
+    call("xdotool key 'Return'", shell=True)
+    sleep(1)
+
 @step('Wait for "{cmd}" end')
 def wait_for_cmd(context, cmd):
     call(cmd, shell=True)


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