~ubuntu-branches/ubuntu/utopic/sikuli/utopic

« back to all changes in this revision

Viewing changes to sikuli-script/src/test/python/test-findfailed.py

  • Committer: Bazaar Package Importer
  • Author(s): Gilles Filippini
  • Date: 2011-04-16 00:23:53 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110416002353-cn79cto3c03z5jx1
Tags: 1.0~x~rc2-dfsg1-1
* New upstream release:
  + Redesigned user interface for Sikuli-IDE
  + Support for extensions for Sikuli Script

* debian/control, debian/copyright:
  The package is now maintained by the Debian Java maintainers Team

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from sikuli import *
 
2
 
 
3
addImagePath("test-res")
 
4
popup("Please press skip")
 
5
SCREEN.setFindFailedResponse(PROMPT)
 
6
SCREEN.setAutoWaitTimeout(0)
 
7
assert find("recycle_bin.jpg") == None
 
8
 
 
9
 
 
10
#should skip
 
11
SCREEN.setFindFailedResponse(SKIP)
 
12
assert wait("test-res/google.png", 2) == None
 
13
 
 
14
#should skip
 
15
SCREEN.setFindFailedResponse(SKIP)
 
16
assert find("test-res/apple.png") != None
 
17
assert waitVanish("test-res/apple.png", 2) == False
 
18
 
 
19
#should throw exception
 
20
SCREEN.setFindFailedResponse(ABORT)
 
21
try:
 
22
   findAll("test-res/google.png")
 
23
   assert False, "find didn't throw an exception"
 
24
except FindFailed,e:
 
25
   pass
 
26