]> www.fi.muni.cz Git - evince.git/blob - test/test2.py
d85ba8b8fe0ab2ff0a09b3cebc9443b65fe816e3
[evince.git] / test / test2.py
1 #!/usr/bin/python
2
3 # This test opens a password encrypted file and tries to unlock it.
4
5 import os
6 os.environ['LANG']='C'
7
8 from dogtail.procedural import *
9
10 run('evince', arguments=' ./test-encrypt.pdf',)
11
12 # Try an incorrect password first
13 focus.dialog('Enter password')
14 focus.widget('Password Entry', roleName='password text')
15 type('wrong password')
16 click('OK', roleName='push button')
17 click('Cancel', roleName='push button')
18
19 # Try again with the correct password
20 click('Unlock Document', roleName='push button')
21 focus.widget('Password Entry', roleName='password text')
22 type('Foo')
23 click('OK', roleName='push button')
24
25 # Close evince
26 click('File', roleName='menu')
27 click('Close', roleName='menu item')