[gnome-boxes] tests: No implicit return in "Type text" step"



commit 9e7a4981e1e91d2262374813f47f305119a39df5
Author: Vladimir Benes <benesv email cz>
Date:   Wed Jun 10 13:50:45 2015 +0200

    tests: No implicit return in "Type text" step"
    
    Remove return at the end of "Type text" step.
    
    Port all original "Type text" using steps that need return to "Type text
    and return" step instead.
    
    Also update README to reflect the fact that xdotool is now a general
    dependency and not just needed by "Send key combos" test.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=748006

 tests/README                |    4 +---
 tests/general.feature       |   12 ++++++------
 tests/livecd.feature        |    4 ++--
 tests/multi-windows.feature |    8 ++++----
 tests/snapshots.feature     |    2 +-
 tests/spice.feature         |    2 +-
 tests/steps/utils.py        |    4 ++--
 tests/vnc.feature           |    4 ++--
 8 files changed, 19 insertions(+), 21 deletions(-)
---
diff --git a/tests/README b/tests/README
index f7aa754..2ee83fc 100644
--- a/tests/README
+++ b/tests/README
@@ -67,6 +67,7 @@ Requirements
 * for downstream package maintainers
   * behave (python-behave in Fedora)
   * dogtail
+  * xdotool
 
 * for vnc tests execution
   * tigervnc-server (or similar)
@@ -81,9 +82,6 @@ Requirements
             }
     });" > /etc/polkit-1/rules.d/51-virtmgr.rules
 
-* for "Send key combos" test execution
-  * xdotool
-
 Execution
 =========
 
diff --git a/tests/general.feature b/tests/general.feature
index d4604e2..65b46f0 100644
--- a/tests/general.feature
+++ b/tests/general.feature
@@ -81,7 +81,7 @@ Feature: General
     Then Ping "Core-5"
     * Quit Boxes
     * Start box name "Core-5"
-    * Type "sudo ifconfig eth0 down"
+    * Type text "sudo ifconfig eth0 down" and return
     * Wait for "sleep 4" end
     Then Cannot ping "Core-5"
 
@@ -90,11 +90,11 @@ Feature: General
     * Initiate new box "Core-5" installation
     * Initiate new box "Core-5 2" installation from "Core-5" menuitem
     * Hit "<Ctrl><f>"
-    * Type "Core-5 2"
+    * Type text "Core-5 2" and return
     Then Box "Core-5 2" "does" exist
     Then Box "Core-5" "does not" exist
     * Hit "<Ctrl><a>"
-    * Type "Core"
+    * Type text "Core" and return
     Then Box "Core-5 2" "does" exist
     Then Box "Core-5" "does" exist
 
@@ -103,11 +103,11 @@ Feature: General
     * Initiate new box "Core-5" installation
     * Initiate new box "Core-5 2" installation from "Core-5" menuitem
     * Press "Search"
-    * Type "Core-5 2"
+    * Type text "Core-5 2" and return
     Then Box "Core-5 2" "does" exist
     Then Box "Core-5" "does not" exist
     * Hit "<Ctrl><a>"
-    * Type "Core"
+    * Type text "Core" and return
     Then Box "Core-5 2" "does" exist
     Then Box "Core-5" "does" exist
 
@@ -116,7 +116,7 @@ Feature: General
     * Initiate new box "Core-5" installation
     * Initiate new box "Core-5 2" installation from "Core-5" menuitem
     * Hit "<Ctrl><f>"
-    * Type "Core-5 2"
+    * Type text "Core-5 2" and return
     Then Box "Core-5 2" "does" exist
     Then Box "Core-5" "does not" exist
     * Hit "Esc"
diff --git a/tests/livecd.feature b/tests/livecd.feature
index 42c1c32..a598b27 100644
--- a/tests/livecd.feature
+++ b/tests/livecd.feature
@@ -48,7 +48,7 @@ Feature: LiceCD
     * Ping "Core-5"
     * Go into "Core-5" box
     * Wait for "sleep 2" end
-    * Type "sudo ifconfig eth0 down"
+    * Type text "sudo ifconfig eth0 down" and return
     * Wait for "sleep 5" end
     Then Cannot ping "Core-5"
 
@@ -116,7 +116,7 @@ Feature: LiceCD
     * Ping "Core-5"
     * Go into "Core-5" box
     * Wait for "sleep 1" end
-    * Type "sudo poweroff"
+    * Type text "sudo poweroff" and return
     * Wait for "sleep 20" end
     Then Box "Core-5" "does not" exist
     Then Cannot ping "Core-5"
diff --git a/tests/multi-windows.feature b/tests/multi-windows.feature
index 42bdcca..249633f 100644
--- a/tests/multi-windows.feature
+++ b/tests/multi-windows.feature
@@ -19,7 +19,7 @@ Feature: Multi Window
     * Select "Core-5" box
     * Press "Open in new window"
     * Wait for "sleep 2" end
-    * Type "sudo poweroff"
+    * Type text "sudo poweroff" and return
     * Wait for "sleep 20" end
     Then Boxes app has "1" windows
 
@@ -40,11 +40,11 @@ Feature: Multi Window
     When Ping "Core-5 2"
     When Ping "Core-5 3"
     * Focus "Core-5" window
-    * Type "sudo ifconfig eth0 down"
+    * Type text "sudo ifconfig eth0 down" and return
     * Focus "Core-5 2" window
-    * Type "sudo ifconfig eth0 down"
+    * Type text "sudo ifconfig eth0 down" and return
     * Focus "Core-5 3" window
-    * Type "sudo ifconfig eth0 down"
+    * Type text "sudo ifconfig eth0 down" and return
     Then Cannot ping "Core-5"
     Then Cannot ping "Core-5 2"
     Then Cannot ping "Core-5 3"
diff --git a/tests/snapshots.feature b/tests/snapshots.feature
index 01a9494..07de51d 100644
--- a/tests/snapshots.feature
+++ b/tests/snapshots.feature
@@ -10,7 +10,7 @@ Feature: Snapshots
     * Create snapshot "working network" from machine "Core-5"
     * Go into "Core-5" box
     * Wait for "sleep 1" end
-    * Type "sudo ifconfig eth0 down"
+    * Type text "sudo ifconfig eth0 down" and return
     * Press "back" in "Core-5" vm
     * Wait for "sleep 5" end
     * Create snapshot "network down" from machine "Core-5"
diff --git a/tests/spice.feature b/tests/spice.feature
index 1cca61c..11ccff9 100644
--- a/tests/spice.feature
+++ b/tests/spice.feature
@@ -13,7 +13,7 @@ Feature: Spice
     Then Box "127.0.0.1" "does" exist
     * Go into "127.0.0.1" box
     * Wait for "sleep 1" end
-    * Type "sudo ifconfig eth0 down"
+    * Type text "sudo ifconfig eth0 down" and return
     * Wait for "sleep 5" end
     Then Cannot ping "Core-5"
 
diff --git a/tests/steps/utils.py b/tests/steps/utils.py
index 4ceabcc..3571834 100644
--- a/tests/steps/utils.py
+++ b/tests/steps/utils.py
@@ -75,8 +75,8 @@ def press_button(context, button):
 
 @step('Type "{text}"')
 def type_text(context, text):
-    typeText(text)
-    pressKey('Enter')
+    call("xdotool type --delay 150 '%s'" %text, shell=True)
+    sleep(0.5)
 
 @step('Type text "{text}" and return')
 def type_text_and_return(context, text):
diff --git a/tests/vnc.feature b/tests/vnc.feature
index 8bb0c8c..b4fa761 100644
--- a/tests/vnc.feature
+++ b/tests/vnc.feature
@@ -14,9 +14,9 @@ Feature: Vnc
     * Wait for "sleep 10" end
     * Hit "<Super_L>"
     * Wait for "sleep 5" end
-    * Type "gnome-terminal"
+    * Type text "gnome-terminal" and return
     * Wait for "sleep 10" end
-    * Type "echo 'walderon' > /tmp/vnc_text.txt"
+    * Type text "echo walderon > /tmp/vnc_text.txt" and return
     Then "walderon" is visible with command "cat /tmp/vnc_text.txt"
     Then Press "back" in "localhost" vm
 


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