~ubuntu-branches/ubuntu/utopic/dogtail/utopic

« back to all changes in this revision

Viewing changes to examples/crack.py

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2006-12-21 13:33:47 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20061221133347-xo9jg11afp5plcka
Tags: upstream-0.6.1
ImportĀ upstreamĀ versionĀ 0.6.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
class PresentationCrack:
2
 
    """Gives a presentation of Dogtail, using Dogtail itself."""
3
 
 
4
 
    def __init__(self):
5
 
        self.evo = EvolutionApp()
6
 
        self.pageNumber = 0
7
 
        self.pageDelay = 3
8
 
 
9
 
    def startPage(self, title):
10
 
        sleep (self.pageDelay)
11
 
        self.pageNumber+=1
12
 
        self.composer = self.evo.composeEmail()
13
 
        self.composer.subject = "Presentation page %s"%self.pageNumber
14
 
 
15
 
        self.composer.setHtml(True)
16
 
 
17
 
        self.composer.setHeader(1)
18
 
        self.composer.htmlNode.text = title
19
 
        self.composer.htmlNode.typeText("\n\n")
20
 
 
21
 
    def addBullet(self, text):
22
 
        self.composer.child("Bulleted List").click()
23
 
        self.composer.htmlNode.typeText(text)
24
 
 
25
 
    def runPresentation(self):
26
 
        self.startPage("Dogtail: a Free Automated GUI test tool")
27
 
        self.addBullet("foo")
28
 
        self.addBullet("bar")
29
 
        
30
 
        self.startPage("Leveraging Synergies")
31
 
        self.addBullet("pirates!")
32
 
        self.addBullet("zombies!")
33
 
        self.addBullet("zombie pirates!")
34
 
    
35
 
        self.startPage("4-Stroke Internal Combustion Engine")
36
 
        self.addBullet("suck")
37
 
        self.addBullet("squeeze")
38
 
        self.addBullet("bang")
39
 
        self.addBullet("blow")
40
 
 
41
 
        self.startPage("Questions?")
42
 
 
43
 
def runPresentationCrack():
44
 
    pres = PresentationCrack()
45
 
    pres.runPresentation()
46
 
 
47
 
runPresentationCrack()