From f6ce926719943751cf65cacde7fae050593eb2d6 Mon Sep 17 00:00:00 2001 From: Perberos Date: Wed, 9 Nov 2011 18:17:43 -0300 Subject: inicial --- test/Makefile.am | 19 +++++++++++++++++++ test/test-encrypt.pdf | Bin 0 -> 26501 bytes test/test-links.pdf | Bin 0 -> 15151 bytes test/test-mime.bin | Bin 0 -> 15151 bytes test/test-page-labels.pdf | Bin 0 -> 10150 bytes test/test1.py | 36 ++++++++++++++++++++++++++++++++++++ test/test2.py | 28 ++++++++++++++++++++++++++++ test/test3.py | 15 +++++++++++++++ test/test4.py | 20 ++++++++++++++++++++ test/test5.py | 24 ++++++++++++++++++++++++ test/test6.py | 31 +++++++++++++++++++++++++++++++ test/test7.py | 33 +++++++++++++++++++++++++++++++++ 12 files changed, 206 insertions(+) create mode 100644 test/Makefile.am create mode 100644 test/test-encrypt.pdf create mode 100644 test/test-links.pdf create mode 100644 test/test-mime.bin create mode 100644 test/test-page-labels.pdf create mode 100755 test/test1.py create mode 100755 test/test2.py create mode 100755 test/test3.py create mode 100755 test/test4.py create mode 100755 test/test5.py create mode 100755 test/test6.py create mode 100755 test/test7.py (limited to 'test') 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 new file mode 100644 index 00000000..8f8f5c1f Binary files /dev/null and b/test/test-encrypt.pdf differ diff --git a/test/test-links.pdf b/test/test-links.pdf new file mode 100644 index 00000000..0b1e6203 Binary files /dev/null and b/test/test-links.pdf differ diff --git a/test/test-mime.bin b/test/test-mime.bin new file mode 100644 index 00000000..0b1e6203 Binary files /dev/null and b/test/test-mime.bin differ diff --git a/test/test-page-labels.pdf b/test/test-page-labels.pdf new file mode 100644 index 00000000..c7d12671 Binary files /dev/null and b/test/test-page-labels.pdf differ 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') -- cgit v1.2.1