summaryrefslogtreecommitdiff
path: root/test/test6.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test6.py')
-rwxr-xr-xtest/test6.py31
1 files changed, 23 insertions, 8 deletions
diff --git a/test/test6.py b/test/test6.py
index b7e3a2f2..60c7bc4e 100755
--- a/test/test6.py
+++ b/test/test6.py
@@ -1,31 +1,46 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# Test printing
import os
+import dogtail.config
+dogtail.config.config.logDebugToStdOut = True
+dogtail.config.config.logDebugToFile = False
+
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")
+recent_used = os.path.expanduser('~/.local/share/recently-used.xbel')
+recent_used_orig = recent_used + '.orig'
+
+ps_file = os.path.expanduser('~/output.ps')
+
+if os.path.isfile(recent_used):
+ os.rename(recent_used, recent_used_orig)
+
+if os.path.exists(ps_file):
+ os.unlink(ps_file)
run('atril', arguments=' '+srcdir+'/test-page-labels.pdf')
click('File', roleName='menu')
-click('Print...', roleName='menu item')
+click('Print…', roleName='menu item')
-focus.dialog('Print')
click('Print to File', roleName='table cell', raw=True)
+click('Postscript', roleName='radio button', raw=True)
click('Print', roleName='push button')
-statinfo = os.stat (homedir + "output.ps")
+statinfo = os.stat (ps_file)
if statinfo.st_size > 100000:
exit(1)
-os.unlink (homedir + "output.ps")
+os.unlink (ps_file)
# Close atril
+focus.application('atril')
click('File', roleName='menu')
click('Close', roleName='menu item')
+
+if os.path.isfile(recent_used_orig):
+ os.rename(recent_used_orig, recent_used)