]> www.fi.muni.cz Git - evince.git/blob - test/test2.py
[dualscreen] fix crash on ctrl+w and fix control window closing
[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 srcdir = os.environ['srcdir']
8
9 from dogtail.procedural import *
10
11 run('evince', arguments=' '+srcdir+'/test-encrypt.pdf')
12
13 # Try an incorrect password first
14 focus.dialog('Enter password')
15 focus.widget('Password Entry', roleName='password text')
16 type('wrong password')
17 click('Unlock Document', roleName='push button')
18 click('Cancel', roleName='push button')
19
20 # Try again with the correct password
21 click('Unlock Document', roleName='push button')
22 focus.widget('Password Entry', roleName='password text')
23 type('Foo')
24 click('Unlock Document', roleName='push button')
25
26 # Close evince
27 click('File', roleName='menu')
28 click('Close', roleName='menu item')