[gnome-boxes] tests: Memory cutomization fixes



commit 46c04f8d5557fc136f6501a7a17681923c12bb36
Author: Vladimir Benes <benesv email cz>
Date:   Wed Feb 18 17:31:42 2015 +0100

    tests: Memory cutomization fixes
    
    VM customization test uses new paramterized step.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744703

 tests/general.feature  |    2 +-
 tests/steps/general.py |   17 ++++++++++++-----
 2 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/tests/general.feature b/tests/general.feature
index a50a7b7..6c4faec 100644
--- a/tests/general.feature
+++ b/tests/general.feature
@@ -48,7 +48,7 @@ Feature: General
   @customize_machine_before_installation
   Scenario: Customize machine before installation
     * Create new box from menu "Core-5"
-    * Customize mem to 64 MB
+    * Customize mem to "64.0" MB
     * Press "Create"
     * Wait for "sleep 10" end
     Then "65536 KiB" is visible with command "DOM=$(virsh list |grep boxes |awk {'print $1'}); virsh dominfo 
$DOM"
diff --git a/tests/steps/general.py b/tests/steps/general.py
index b224012..80b16dd 100644
--- a/tests/steps/general.py
+++ b/tests/steps/general.py
@@ -35,13 +35,20 @@ def boxes_not_running(context):
 def number_of_windows(context, num):
     assert len(context.app.children) == int(num), "App has just %s windows not %s" 
%(len(context.app.children), num)
 
- step('Customize mem to 64 MB')
-def customize_vm(context):
+ step('Customize mem to "{mem}" MB')
+def customize_vm(context, mem):
     context.app.child('Customize…').click()
     sleep(0.5)
-    pressKey('Page_Up')
-    pressKey('Page_Up')
-
+    pressKey('Tab')
+    pressKey('Tab')
+    memory_label = context.app.findChildren(lambda x: x.name == 'Memory' and x.showing)[0]
+    mem = mem+" MiB"
+    counter = 0
+    while not memory_label.parent.findChildren(lambda x: x.name == mem and x.showing):
+        pressKey('Left')
+        counter += 1
+        if counter == 100:
+            break
     context.app.findChildren(lambda x: x.name == 'Back' and x.showing)[0].click()
     sleep(0.5)
 


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