[gnome-boxes/wip/automated-tests] tmp



commit df48675881f8104d66d9c40601402692c14fd1c6
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Sun Jan 25 14:57:49 2015 +0000

    tmp
    
    Port tests to 3.15 branch

 src/app-window.vala     |    5 +++--
 tests/general.feature   |    4 ++--
 tests/livecd.feature    |   13 +------------
 tests/snapshots.feature |    2 +-
 tests/steps/creation.py |    5 ++---
 tests/steps/general.py  |    8 +++++---
 tests/steps/snapshot.py |    2 +-
 7 files changed, 15 insertions(+), 24 deletions(-)
---
diff --git a/src/app-window.vala b/src/app-window.vala
index 957d2cd..39440d4 100644
--- a/src/app-window.vala
+++ b/src/app-window.vala
@@ -199,6 +199,7 @@ private class Boxes.AppWindow: Gtk.ApplicationWindow, Boxes.UI {
         case UIState.DISPLAY:
         case UIState.WIZARD:
         case UIState.PROPERTIES:
+            (current_item as Machine).unschedule_autosave ();
 
             break;
 
@@ -212,6 +213,8 @@ private class Boxes.AppWindow: Gtk.ApplicationWindow, Boxes.UI {
     }
 
     public void show_properties () {
+        selection_mode = false;
+
         if (current_item != null) {
             set_state (UIState.PROPERTIES);
 
@@ -220,8 +223,6 @@ private class Boxes.AppWindow: Gtk.ApplicationWindow, Boxes.UI {
 
         var selected_items = view.get_selected_items ();
 
-        selection_mode = false;
-
         // Show for the first selected item
         foreach (var item in selected_items) {
             current_item = item;
diff --git a/tests/general.feature b/tests/general.feature
index b56c60b..dee2f09 100644
--- a/tests/general.feature
+++ b/tests/general.feature
@@ -59,7 +59,7 @@ Feature: General
     * Select "Core-5" box
     * Press "Properties"
     * Rename "Core-5" to "Kernel-6" via "button"
-    * Press "Back"
+    * Hit "Esc"
     * Quit Boxes
     * Start Boxes
     Then Box "Kernel-6" "does" exist
@@ -70,7 +70,7 @@ Feature: General
     * Select "Core-5" box
     * Press "Properties"
     * Rename "Core-5" to "Kernel-6" via "label"
-    * Press "Back"
+    * Hit "Esc"
     * Quit Boxes
     * Start Boxes
     Then Box "Kernel-6" "does" exist
diff --git a/tests/livecd.feature b/tests/livecd.feature
index 0f87b25..7a788ce 100644
--- a/tests/livecd.feature
+++ b/tests/livecd.feature
@@ -135,22 +135,11 @@ Feature: LiceCD
     * Create new box "Core-5"
     * Select "Core-5" box
     * Press "Properties"
+    * Hit "Right"
     * Press "Force Shutdown"
-    * Press "Shutdown" in alert
     Then Box "Core-5" "does" exist
     Then Cannot ping "Core-5"
 
-  @force_shutdown_local_machine_cancel
-  Scenario: Cancel Force off of local liveCD box
-    * Create new box "Core-5"
-    * Select "Core-5" box
-    * Press "Properties"
-    * Press "Force Shutdown"
-    * Press "Cancel" in alert
-    * Press "Back"
-    Then Box "Core-5" "does" exist
-    Then Ping "Core-5"
-
   @livecd_restart_persistence
   Scenario: LiveCD restart persistence
     * Initiate new box "Core-5" installation
diff --git a/tests/snapshots.feature b/tests/snapshots.feature
index f13188d..3da41c0 100644
--- a/tests/snapshots.feature
+++ b/tests/snapshots.feature
@@ -9,7 +9,7 @@ Feature: Snapshots
     * Create new box "Core-5"
     * Create snapshot "working network" from machine "Core-5"
     * Go into "Core-5" box
-    * Wait for "sleep 1" end
+    * Wait for "sleep 4" end
     * Type "sudo ifconfig eth0 down"
     * Press "back" in vm
     * Wait for "sleep 5" end
diff --git a/tests/steps/creation.py b/tests/steps/creation.py
index 0ce25d3..5faff8f 100644
--- a/tests/steps/creation.py
+++ b/tests/steps/creation.py
@@ -27,10 +27,9 @@ def create_new_vm_via_file(context, location):
     context.app.child('Continue').click()
     context.app.child('Select a file').click()
 
-    selector = context.app.child('Select a device or ISO file')
     for item in path:
-        selector.child(item).click()
-    selector.child('Open').click()
+        context.app.child(item).click()
+    context.app.child('Open').click()
 
 @step('Create new box from url "{url}"')
 def create_new_vm_via_url(context, url):
diff --git a/tests/steps/general.py b/tests/steps/general.py
index 30c9401..53a8405 100644
--- a/tests/steps/general.py
+++ b/tests/steps/general.py
@@ -39,11 +39,10 @@ def customize_vm(context):
     context.app.child('Customize…').click()
     sleep(0.5)
     pressKey('Tab')
-    pressKey('Tab')
     pressKey('Page_Up')
     pressKey('Page_Up')
 
-    context.app.children[0].children[0].children[3].child('Back').click()
+    context.app.findChildren(lambda x: x.name == 'Back' and x.showing)[0].click()
     sleep(0.5)
 
 @step('Go into "{vm}" box')
@@ -133,10 +132,13 @@ def save_ip_for_vm(context, vm):
 
 @step('Select "{vm}" box')
 def select_vm(context, vm):
+    select_button = context.app.child('Select Items')
+    if select_button.showing:
+        select_button.click()
     pane = context.app.child(roleName='layered pane')
     for child in pane.children:
         if child.text == vm:
-            child.click(button='3')
+            child.click()
             sleep(0.2)
             break
 
diff --git a/tests/steps/snapshot.py b/tests/steps/snapshot.py
index 0a6cc9b..bb2ec2f 100644
--- a/tests/steps/snapshot.py
+++ b/tests/steps/snapshot.py
@@ -46,7 +46,7 @@ def create_snapshot(context, snap_name, vm_name):
         * Press "Properties"
         * Press "Snapshots"
         * Add Snapshot named "%s"
-        * Press "Back"
+        * Hit "Esc"
         """ %(vm_name, snap_name))
 
 @step('Delete machines "{vm_name}" snapshot "{snap_name}"')


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