Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tests/shell.py
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-06-30 19:53:45 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-06-30 19:53:45 (GMT)
commitacc258f5a3de57c7c59c7b67ab34680bc1ec8e5e (patch)
treede8fca05c3b7169e36ffccd39933368478fb53a5 /tests/shell.py
parent816dfda25159cb388b5d9f5dbea05ea2d8345408 (diff)
Handle Read object chooser
Diffstat (limited to 'tests/shell.py')
-rw-r--r--tests/shell.py23
1 files changed, 19 insertions, 4 deletions
diff --git a/tests/shell.py b/tests/shell.py
index 3d2215b..1b94044 100644
--- a/tests/shell.py
+++ b/tests/shell.py
@@ -1,6 +1,11 @@
from dogtail import tree
from dogtail import predicate
+class Activity:
+ def __init__(self, name=None, icon=None):
+ self.name = name
+ self.icon = icon
+
shell = tree.root.child(name="sugar-session", roleName="application")
# Complete the intro screen
@@ -11,14 +16,24 @@ done_button.click()
radio_button = shell.child(name="List view", roleName="radio button")
radio_button.click()
-# Start and stop all the activities in the table
+# Make a list of activities by iterating the table
+activities = []
+
table = shell.child(name="", roleName="table")
cells = table.findChildren(predicate.GenericPredicate(roleName="table cell"))
-
for row in [cells[i:i+5] for i in range(0, len(cells), 5)]:
- print "Launching %s" % row[2].text
+ activities.append(Activity(name=row[2].text, icon=row[1]))
+
+# Launch and close all the activities
+for activity in activities:
+ print "Launching %s" % activity.name
+
+ activity.icon.click()
- row[1].click()
+ # Read displays an object chooser, let's close it
+ if activity.name == "Read":
+ close_button = shell.child(name="Close", roleName="push button")
+ close_button.click()
activity = tree.root.child(name="sugar-activity", roleName="application")
stop_button = activity.child(name="Stop", roleName="push button")