Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tests/shell.py
blob: f2163560e14a054d55d58619580d61c1eca64d24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from dogtail import tree
from dogtail import predicate

shell = tree.root.child(name="sugar-session", roleName="application")

# Complete the intro screen
done_button = shell.child(name="Done", roleName="push button")
done_button.click()

# Switch to the home list view
radio_button = shell.child(name="List view", roleName="radio button")
radio_button.click()

# Start and stop all the activities in the table
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)]:
    row[1].click()

    activity = tree.root.child(name="sugar-activity", roleName="application")
    stop_button = activity.child(name="Stop", roleName="push button")
    stop_button.click()