[pitivi] dogtail: Update dogtail tests to run on latest Gtk



commit 9a45697c9a0d8a6cf9acd559f94242454a875fd1
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Mon Apr 28 12:19:20 2014 +0200

    dogtail: Update dogtail tests to run on latest Gtk

 tests/dogtail_scripts/common.py |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/tests/dogtail_scripts/common.py b/tests/dogtail_scripts/common.py
index 0bf84a1..d2d2ece 100644
--- a/tests/dogtail_scripts/common.py
+++ b/tests/dogtail_scripts/common.py
@@ -65,13 +65,16 @@ class PitiviTestCase(unittest.TestCase):
         # This is a performance hack to very quickly get the widgets we want,
         # by using their known position instead of searching.
         # Reuse those variables throughout your scripts for efficient access.
-        mainwindow = self.pitivi.children[0].children[0].children[0]  # this is a vbox
-        assert mainwindow.name == 'contents'
-        mainwindow_upper, timeline_area = mainwindow.children
-        assert mainwindow_upper.name == 'upper half'
-        assert timeline_area.name == 'timeline area'
-        primary_tabs = mainwindow_upper.children[0].child(name="primary tabs", recursive=False)
-        secondary_tabs = mainwindow_upper.children[0].child(name="secondary tabs", recursive=False)
+        mainwindow = self.pitivi.children[0]
+        self.assertEqual('main window', mainwindow.name)
+        headerbar, box = mainwindow.children
+        contents = box.children[0]
+        self.assertEqual('contents', contents.name)
+        upper_half, timeline_area = contents.children
+        self.assertEqual('upper half', upper_half.name)
+        self.assertEqual('timeline area', timeline_area.name)
+        primary_tabs = upper_half.children[0].child(name="primary tabs", recursive=False)
+        secondary_tabs = upper_half.children[0].child(name="secondary tabs", recursive=False)
         # These are the "shortcut" variables you can use for better perfs:
         self.menubar = self.pitivi.children[0].child(name='headerbar', recursive=False)
         self.medialibrary = primary_tabs.children[0]
@@ -79,7 +82,7 @@ class PitiviTestCase(unittest.TestCase):
         self.clipproperties = secondary_tabs.children[0]
         self.transitions = secondary_tabs.children[1]
         self.titles = secondary_tabs.children[2]
-        self.viewer = mainwindow_upper.child(name="viewer", recursive=False)
+        self.viewer = upper_half.child(name="viewer", recursive=False)
         self.zoom_best_fit_button = timeline_area.child(name="Zoom", recursive=True)
         self.timeline = timeline_area.child(name="timeline canvas", recursive=False)
         self.timeline_toolbar = timeline_area.child(name="timeline toolbar", recursive=False)
@@ -123,6 +126,7 @@ class PitiviTestCase(unittest.TestCase):
             save_dialog = self.pitivi.child(name="Save As...", roleName='file chooser', recursive=False)
             text_field = save_dialog.child(roleName="text")
             text_field.text = path
+            time.sleep(0.2)
             dogtail.rawinput.pressKey("Enter")
             time.sleep(0.15)
             # Save to the list of items to cleanup afterwards
@@ -147,6 +151,7 @@ class PitiviTestCase(unittest.TestCase):
 
         load.child(roleName='text').text = url
         # Speed hack: don't search for the Open button
+        time.sleep(0.2)
         dogtail.rawinput.pressKey("Enter")
 
     def _check_unsaved_changes_dialog(self, decision):
@@ -233,6 +238,7 @@ class PitiviTestCase(unittest.TestCase):
         filepath = os.path.realpath(__file__).split("dogtail_scripts/")[0]
         filepath += "samples/" + filename
         import_dialog.child(roleName='text').text = filepath
+        time.sleep(0.2)
         dogtail.rawinput.pressKey("Enter")  # Don't search for the Add button
         time.sleep(0.6)
 
@@ -271,6 +277,7 @@ class PitiviTestCase(unittest.TestCase):
 
         dir_path = os.path.realpath(__file__).split("dogtail_scripts/")[0] + "samples/"
         import_dialog.child(roleName='text').text = dir_path
+        time.sleep(0.2)
         dogtail.rawinput.pressKey("Enter")
 
         # We are now in the samples directory, select various items.


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