[pitivi] dogtail: Cleanup test_effects
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] dogtail: Cleanup test_effects
- Date: Wed, 24 Sep 2014 17:05:46 +0000 (UTC)
commit e097810e166a56d90036cd74cf0337cddb3e6883
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Sat May 3 00:09:29 2014 +0200
dogtail: Cleanup test_effects
tests/dogtail_scripts/test_effects.py | 54 ++++++++++++++++----------------
1 files changed, 27 insertions(+), 27 deletions(-)
---
diff --git a/tests/dogtail_scripts/test_effects.py b/tests/dogtail_scripts/test_effects.py
index 1f05356..2566e4a 100644
--- a/tests/dogtail_scripts/test_effects.py
+++ b/tests/dogtail_scripts/test_effects.py
@@ -5,34 +5,36 @@ import dogtail.rawinput
from common import PitiviTestCase
-# FIXME: cleanup the weird use of variable names for tabs here
class EffectLibraryTest(PitiviTestCase):
+ def setUp(self):
+ PitiviTestCase.setUp(self)
+ self.search = self.effectslibrary.child(name="effects library search entry")
+ self.view = self.effectslibrary.child(roleName="table")
+ self.combotypes = self.effectslibrary.child(name="effect category combobox", roleName="combo box")
+ self.toggle = self.effectslibrary.child(name="effects library audio togglebutton")
+
def test_effect_library(self):
self.import_media()
- tab = self.effectslibrary
- tab.click()
- search = tab.child(name="effects library search entry")
- view = tab.child(roleName="table")
- combotypes = tab.child(name="effect category combobox", roleName="combo box")
+ self.effectslibrary.click()
# Some test of video effects and search. The two column headers are
# also children and are always present, and each row has two children:
- search.text = "Crop"
- self.assertEqual(len(view.children), 2 + 2 * 3)
- combotypes.click()
- combotypes.menuItem("Colors").click()
- self.assertEqual(len(view.children), 2 + 2 * 0)
- combotypes.click()
- combotypes.menuItem("Geometry").click()
- self.assertEqual(len(view.children), 2 + 2 * 3)
+ self.search.text = "Crop"
+ self.assertEqual(len(self.view.children), 2 + 2 * 3)
+ self.combotypes.click()
+ self.combotypes.menuItem("Colors").click()
+ self.assertEqual(len(self.view.children), 2 + 2 * 0)
+ self.combotypes.click()
+ self.combotypes.menuItem("Geometry").click()
+ self.assertEqual(len(self.view.children), 2 + 2 * 3)
# Switch to audio effects view
- tab.child(name="effects library audio togglebutton").click()
- search.text = "Equa"
+ self.toggle.click()
+ self.search.text = "Equa"
# 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)
+ self.assertEqual(len(self.view.children), 4)
def test_change_effect_settings(self):
self.force_medialibrary_iconview_mode()
@@ -43,11 +45,9 @@ class EffectLibraryTest(PitiviTestCase):
# so the clip position should be x + 300, y + 30
clippos = (self.timeline.position[0] + 300, self.timeline.position[1] + 30)
- tab = self.effectslibrary
- tab.click()
- conftab = self.clipproperties
- conftab.click()
- clip_effects_table = conftab.child(roleName="table")
+ self.effectslibrary.click()
+ self.clipproperties.click()
+ clip_effects_table = self.clipproperties.child(roleName="table")
dogtail.rawinput.click(clippos[0], clippos[1])
self.assertTrue(clip_effects_table.sensitive)
@@ -55,24 +55,24 @@ class EffectLibraryTest(PitiviTestCase):
# Each time you add an effect, it adds a row, so +3 children.
self.assertEqual(len(clip_effects_table.children), 3)
- icon = self.search_by_regex("^Agingtv", tab, roleName="table cell")
+ icon = self.search_by_regex("^Agingtv", self.effectslibrary, roleName="table cell")
# Drag video effect on the clip
self.improved_drag(self.center(icon), clippos)
self.assertEqual(len(clip_effects_table.children), 6)
# Drag video effect to the table
- icon = self.search_by_regex("^3Dflippo", tab, roleName="table cell")
+ icon = self.search_by_regex("^3Dflippo", self.effectslibrary, roleName="table cell")
self.improved_drag(self.center(icon), self.center(clip_effects_table))
self.assertEqual(len(clip_effects_table.children), 9)
# Drag audio effect on the clip
- tab.child(name="effects library audio togglebutton").click()
- effect = self.search_by_regex("^Amplifier", tab, roleName="table cell")
+ self.toggle.click()
+ effect = self.search_by_regex("^Amplifier", self.effectslibrary, roleName="table cell")
self.improved_drag(self.center(effect), clippos)
self.assertEqual(len(clip_effects_table.children), 12)
# Drag audio effect on the table
- effect = self.search_by_regex("^Audiokaraoke", tab, roleName="table cell")
+ effect = self.search_by_regex("^Audiokaraoke", self.effectslibrary, roleName="table cell")
self.improved_drag(self.center(effect), self.center(clip_effects_table))
self.assertEqual(len(clip_effects_table.children), 15)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]