blob: 30367fe2cb3dba71b6113a499ce711d3975bc5ef (
plain)
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
34
35
36
37
38
39
40
41
42
43
|
#!/usr/bin/python3
# Test printing
import os
from testCommon import pushButton
from dogtail.procedural import *
srcdir = os.environ['srcdir']
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')
focus.application('atril')
click('File', roleName='menu')
click('Print…', roleName='menu item')
click('Print to File', roleName='table cell', raw=True)
click('Postscript', roleName='radio button', raw=True)
click('Print', roleName=pushButton)
statinfo = os.stat (ps_file)
if statinfo.st_size > 100000:
exit(1)
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)
|