1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
#!/usr/bin/python3
# Test opening a password encrypted file and unlocking it.
from testCommon import run_app, bail
from dogtail.procedural import *
try:
run_app(file='test-encrypt.pdf')
# Try an incorrect password first
focus.dialog('Enter password')
type('wrong password')
click('Unlock Document', roleName='push button')
focus.dialog('Enter password')
click('Cancel', roleName='push button')
# Try again with the correct password
focus.frame('test-encrypt.pdf — Password Required')
click('Unlock Document', roleName='push button')
type('Foo')
focus.dialog('Enter password')
click('Unlock Document', roleName='push button')
# Close xreader
focus.frame('test-encrypt.pdf — Dokument1')
click('File', roleName='menu')
click('Close', roleName='menu item')
except:
bail()
|