[pitivi] dogtail tests: Fix the preferences and effects tests



commit ebc45bf4c795c6c96592fb3b6dd28f6cd15ed2ef
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date:   Sat Feb 9 21:58:13 2013 -0500

    dogtail tests: Fix the preferences and effects tests

 tests/dogtail_scripts/test_dialogs_prefs.py |    4 ++--
 tests/dogtail_scripts/test_effects.py       |    9 ++++++---
 2 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/tests/dogtail_scripts/test_dialogs_prefs.py b/tests/dogtail_scripts/test_dialogs_prefs.py
index 8f945d6..8af6438 100644
--- a/tests/dogtail_scripts/test_dialogs_prefs.py
+++ b/tests/dogtail_scripts/test_dialogs_prefs.py
@@ -20,7 +20,7 @@ class DialogsPreferencesTest(HelpFunc):
         # (otherwise dogtail will take ages to search for it) and to prevent
         # scrolling (so we can just click the first item in the search results).
         # Since the search entry is focused by default, just start typing:
-        dogtail.rawinput.typeText("cantarell bold")
+        dogtail.rawinput.typeText("cantarell bold oblique")
         # Ideally I'd search the child table cells, but this is way too slow,
         # so let's just pick the first item in the search results:
         fontchooser.child(roleName="table cell").click()
@@ -47,7 +47,7 @@ class DialogsPreferencesTest(HelpFunc):
         # Check if the previous values were correctly saved
         # In the case of the font, just search if such an item exists:
         try:
-            dialog.child(name="Cantarell Bold", roleName="push button")
+            dialog.child(name="Cantarell Bold Oblique", roleName="push button")
         except SearchError:
             self.fail("Font was not saved")
         self.assertEqual(dialog.child(roleName="spin button").text, "12")
diff --git a/tests/dogtail_scripts/test_effects.py b/tests/dogtail_scripts/test_effects.py
index e22c646..ab57f5a 100644
--- a/tests/dogtail_scripts/test_effects.py
+++ b/tests/dogtail_scripts/test_effects.py
@@ -27,8 +27,10 @@ class EffectLibraryTest(HelpFunc):
         # Switch to audio effects view
         tab.child(name="effects library audio togglebutton").click()
         search.text = "Equa"
-        #Titles plus 3 plugins, two collumns = 8
-        self.assertEqual(len(tab.child(roleName="table").children), 8)
+        # The effects library listview doesn't show the header row, but
+        # it is still one of the children. So when we're looking for the 3
+        # rows matching "Equa", we need to add one child (1 header + 3 rows).
+        self.assertEqual(len(tab.child(roleName="table").children), 4)
 
     def help_test_effect_drag(self):
         sample = self.import_media()
@@ -43,7 +45,8 @@ class EffectLibraryTest(HelpFunc):
 
         dogtail.rawinput.click(clippos[0], clippos[1])
         self.assertTrue(table.sensitive)
-        #No effects added
+        # No effects added. The listview has 3 columns, so it starts at 3.
+        # Each time you add an effect, it adds a row, so +3 children.
         self.assertEqual(len(table.children), 3)
 
         center = lambda obj: (obj.position[0] + obj.size[0] / 2, obj.position[1] + obj.size[1] / 2)


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