diff options
author | Perberos <[email protected]> | 2011-11-09 18:17:43 -0300 |
---|---|---|
committer | Perberos <[email protected]> | 2011-11-09 18:17:43 -0300 |
commit | f6ce926719943751cf65cacde7fae050593eb2d6 (patch) | |
tree | 9224d1751678cf2d1fbd0431f128b711311c0287 /test | |
download | atril-f6ce926719943751cf65cacde7fae050593eb2d6.tar.bz2 atril-f6ce926719943751cf65cacde7fae050593eb2d6.tar.xz |
inicial
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 19 | ||||
-rw-r--r-- | test/test-encrypt.pdf | bin | 0 -> 26501 bytes | |||
-rw-r--r-- | test/test-links.pdf | bin | 0 -> 15151 bytes | |||
-rw-r--r-- | test/test-mime.bin | bin | 0 -> 15151 bytes | |||
-rw-r--r-- | test/test-page-labels.pdf | bin | 0 -> 10150 bytes | |||
-rwxr-xr-x | test/test1.py | 36 | ||||
-rwxr-xr-x | test/test2.py | 28 | ||||
-rwxr-xr-x | test/test3.py | 15 | ||||
-rwxr-xr-x | test/test4.py | 20 | ||||
-rwxr-xr-x | test/test5.py | 24 | ||||
-rwxr-xr-x | test/test6.py | 31 | ||||
-rwxr-xr-x | test/test7.py | 33 |
12 files changed, 206 insertions, 0 deletions
diff --git a/test/Makefile.am b/test/Makefile.am new file mode 100644 index 00000000..3f0a90c5 --- /dev/null +++ b/test/Makefile.am @@ -0,0 +1,19 @@ + +dist_check_SCRIPTS = \ + test1.py \ + test2.py \ + test3.py \ + test4.py \ + test5.py + +TESTS = $(dist_check_SCRIPTS) + +EXTRA_DIST = \ + test-encrypt.pdf \ + test-links.pdf \ + test-mime.bin \ + test-page-labels.pdf \ + test6.py \ + test7.py + +-include $(top_srcdir)/git.mk diff --git a/test/test-encrypt.pdf b/test/test-encrypt.pdf Binary files differnew file mode 100644 index 00000000..8f8f5c1f --- /dev/null +++ b/test/test-encrypt.pdf diff --git a/test/test-links.pdf b/test/test-links.pdf Binary files differnew file mode 100644 index 00000000..0b1e6203 --- /dev/null +++ b/test/test-links.pdf diff --git a/test/test-mime.bin b/test/test-mime.bin Binary files differnew file mode 100644 index 00000000..0b1e6203 --- /dev/null +++ b/test/test-mime.bin diff --git a/test/test-page-labels.pdf b/test/test-page-labels.pdf Binary files differnew file mode 100644 index 00000000..c7d12671 --- /dev/null +++ b/test/test-page-labels.pdf diff --git a/test/test1.py b/test/test1.py new file mode 100755 index 00000000..42d83c01 --- /dev/null +++ b/test/test1.py @@ -0,0 +1,36 @@ +#!/usr/bin/python + +# This test opens the interface and just clicks around a bit. + +import os +os.environ['LANG']='C' + +from dogtail.procedural import * + +run('evince') + +# Test file->open +click('File', roleName='menu') +click('Open...', roleName='menu item') +focus.dialog('Open Document') +click('Cancel', roleName='push button') + +# Toolbar editor +click('Edit', roleName='menu') +click('Toolbar', roleName='menu item') +focus.dialog('Toolbar Editor') +click('Close', roleName='push button') + +# About dialog +click('Help', roleName='menu') +click('About', roleName='menu item') +focus.dialog('About Document Viewer') +click('Credits', roleName='push button') +focus.dialog('Credits') +click('Close', roleName='push button') +focus.dialog('About Document Viewer') +click('Close', roleName='push button') + +# Close evince +click('File', roleName='menu') +click('Close', roleName='menu item') diff --git a/test/test2.py b/test/test2.py new file mode 100755 index 00000000..ca06b66b --- /dev/null +++ b/test/test2.py @@ -0,0 +1,28 @@ +#!/usr/bin/python + +# This test opens a password encrypted file and tries to unlock it. + +import os +os.environ['LANG']='C' +srcdir = os.environ['srcdir'] + +from dogtail.procedural import * + +run('evince', arguments=' '+srcdir+'/test-encrypt.pdf') + +# Try an incorrect password first +focus.dialog('Enter password') +focus.widget('Password Entry', roleName='password text') +type('wrong password') +click('Unlock Document', roleName='push button') +click('Cancel', roleName='push button') + +# Try again with the correct password +click('Unlock Document', roleName='push button') +focus.widget('Password Entry', roleName='password text') +type('Foo') +click('Unlock Document', roleName='push button') + +# Close evince +click('File', roleName='menu') +click('Close', roleName='menu item') diff --git a/test/test3.py b/test/test3.py new file mode 100755 index 00000000..56b90df1 --- /dev/null +++ b/test/test3.py @@ -0,0 +1,15 @@ +#!/usr/bin/python + +# This test opens a file with wrong extenstion. + +import os +os.environ['LANG']='C' +srcdir = os.environ['srcdir'] + +from dogtail.procedural import * + +run('evince', arguments=' '+srcdir+'/test-mime.bin') + +# Close evince +click('File', roleName='menu') +click('Close', roleName='menu item') diff --git a/test/test4.py b/test/test4.py new file mode 100755 index 00000000..789030e3 --- /dev/null +++ b/test/test4.py @@ -0,0 +1,20 @@ +#!/usr/bin/python + +# This test tries document reload action. + +import os +os.environ['LANG']='C' +srcdir = os.environ['srcdir'] + +from dogtail.procedural import * + +run('evince', arguments=' '+srcdir+'/test-links.pdf') + +# Reload document a few times +for i in range(1,6): + click('View', roleName='menu') + click('Reload', roleName='menu item') + +# Close evince +click('File', roleName='menu') +click('Close', roleName='menu item') diff --git a/test/test5.py b/test/test5.py new file mode 100755 index 00000000..9fd7276e --- /dev/null +++ b/test/test5.py @@ -0,0 +1,24 @@ +#!/usr/bin/python + +# This test tries document reload action. + +import os +os.environ['LANG']='C' +srcdir = os.environ['srcdir'] + +from dogtail.procedural import * + +run('evince', arguments=' '+srcdir+'/test-page-labels.pdf') + +focus.widget('page-label-entry') +focus.widget.text = "iii" +activate() + +if focus.widget.text != "III": + click('File', roleName='menu') + click('Close', roleName='menu item') + exit (1) + +# Close evince +click('File', roleName='menu') +click('Close', roleName='menu item') diff --git a/test/test6.py b/test/test6.py new file mode 100755 index 00000000..89b6e5d0 --- /dev/null +++ b/test/test6.py @@ -0,0 +1,31 @@ +#!/usr/bin/python + +# Test printing + +import os +os.environ['LANG']='C' +srcdir = os.environ['srcdir'] +homedir = os.environ["HOME"] + "/"; + +from dogtail.procedural import * + +if os.path.exists(homedir + "output.ps"): + os.unlink(homedir + "output.ps") + +run('evince', arguments=' '+srcdir+'/test-page-labels.pdf') + +click('File', roleName='menu') +click('Print...', roleName='menu item') + +focus.dialog('Print') +click('Print to File', roleName='table cell', raw=True) +click('Print', roleName='push button') + +statinfo = os.stat (homedir + "output.ps") +if statinfo.st_size > 100000: + exit(1) +os.unlink (homedir + "output.ps") + +# Close evince +click('File', roleName='menu') +click('Close', roleName='menu item') diff --git a/test/test7.py b/test/test7.py new file mode 100755 index 00000000..f104a472 --- /dev/null +++ b/test/test7.py @@ -0,0 +1,33 @@ +#!/usr/bin/python + +# Test printing + +import os +os.environ['LANG']='C' +srcdir = os.environ['srcdir'] + +from dogtail.procedural import * + +run('evince', arguments=' '+srcdir+'/test-page-labels.pdf') + +#!/usr/bin/python +from dogtail.procedural import * + +focus.application('evince') +focus.frame('test-page-labels.pdf') +click('File', roleName='menu') +click('Print...', roleName='menu item') +focus.dialog('Print') +click('Pages:', roleName='radio button') +keyCombo('Tab') +type('1') +click('Page Setup', roleName='page tab', raw=True) +click('All sheets') +click('Even sheets') +click('Print Preview', roleName='push button') +keyCombo('Return') +click('Cancel') + +# Close evince +click('File', roleName='menu') +click('Close', roleName='menu item') |