1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 ' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 ' Copyright 2000, 2010 Oracle and/or its affiliates.
7 ' OpenOffice.org - a multi-platform office productivity suite
9 ' This file is part of OpenOffice.org.
11 ' OpenOffice.org is free software: you can redistribute it and/or modify
12 ' it under the terms of the GNU Lesser General Public License version 3
13 ' only, as published by the Free Software Foundation.
15 ' OpenOffice.org is distributed in the hope that it will be useful,
16 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ' GNU Lesser General Public License version 3 for more details
19 ' (a copy is included in the LICENSE file that accompanied this code).
21 ' You should have received a copy of the GNU Lesser General Public License
22 ' version 3 along with OpenOffice.org. If not, see
23 ' <http://www.openoffice.org/license.html>
24 ' for a copy of the LGPLv3 License.
26 '/************************************************************************
28 '* owner : gregor.hartmann@oracle.com
30 '* short description : updatetest for the printer configuration
32 '\******************************************************************************
34 testcase t_updt_spadmin
36 printlog( "Resource test for SPAdmin (Printer administration tool) for Unix(like) OS" )
38 if ( gtSysName = "eComStation" ) then
39 printlog( "No SpAdmin for eComStation" )
43 if ( lcase(gPlatform) = "osx") then
44 printlog( "No SPAdmin on MacOS X" )
48 if ( gPlatGroup = "w95" ) then
49 printlog( "No SPAdmin on Windows" )
53 const CPRINTER = "tt-testprinter"
62 brc = hWaitForSpAdmin()
64 warnlog( "SpAdmin is not open, the test cannot continue" )
68 irc = hDelPrinter( CPRINTER )
70 case 0 : printlog( "Maybe printer was left over by prior run?" )
71 case 3 : printlog( "OK, printer does not exist" )
74 brc = hWaitForSpAdmin()
76 warnlog( "SpAdmin is not open, the test cannot continue" )
80 call TestNewPrinter( CPRINTER )
82 ' wait for the spadmin to open, on failure we end the test
83 brc = hWaitForSpAdmin()
85 warnlog( "SpAdmin is not open, the test cannot continue" )
89 call TestProperties( CPRINTER )
91 ' wait for the spadmin to open, on failure we end the test
92 brc = hWaitForSpAdmin()
94 warnlog( "SpAdmin is not open, the test cannot continue" )
98 call TestRename( CPRINTER )
100 ' wait for the spadmin to open, on failure we end the test
101 brc = hWaitForSpAdmin()
103 warnlog( "SpAdmin is not open, the test cannot continue" )
107 ' wait for the spadmin to open, on failure we end the test
108 brc = hWaitForSpAdmin()
110 warnlog( "SpAdmin is not open, the test cannot continue" )
115 irc = hDelPrinter( CPRINTER )
117 warnlog( "We created a Fax printer but it could not be deleted" )
124 '*******************************************************************************
126 sub TestNewPrinter( cPrinter as string )
132 printlog( " * New Printer" )
137 printlog( " * select 'Connect a Fax Device'" )
138 Kontext "TabPWDeviceSelector"
139 call dialogtest( TabPWDeviceSelector )
142 printlog( " * next ->" )
143 Kontext "SpPrinterWizard"
147 printlog( " * accept the default driver (first entry)" )
148 Kontext "TabPWFaxDriverSelector"
149 call dialogtest( TabPWFaxDriverSelector )
151 printlog( " * next ->" )
152 Kontext "SpPrinterWizard"
156 printlog( " * enter '(PHONE)' as queue" )
157 Kontext "TabPWQueueCommand"
158 call dialogtest( TabPWQueueCommand )
159 CBCommand.setText( """(PHONE)""" )
161 printlog( " * next ->" )
162 Kontext "SpPrinterWizard"
166 printlog( " * enter a name for the fax-printer" )
167 Kontext "TabPWPrinterName"
168 call dialogtest( TabPWPrinterName )
169 EFFaxName.setText( cPrinter )
172 printlog( " * Finish" )
175 Kontext "SpPrinterWizard"
177 iWait = 4 ' leave the loop
179 printlog( "Waiting for dialog" )
181 if ( iWait = 3 ) then
182 qaerrorlog( "Could not click 'finish' on printerwizard" )
191 '*******************************************************************************
193 sub TestProperties( cPrinter as string )
197 dim iPrinterPos as integer
200 iPrinterPos = hGetPrinterPosition( CPRINTER , true )
202 LBPrinters.select( iPrinterPos )
206 printlog( " * Properties for the new fax device" )
209 active.setpage TabSPACommand
211 kontext "TabSPACommand"
212 printlog( " * Tab: Command" )
213 call dialogtest( TabSPACommand )
216 active.setpage TabSPAPaper
218 kontext "TabSPAPaper"
219 printlog( " * Tab: Paper" )
220 call dialogtest( TabSPAPaper )
223 active.setpage TabSPADevice
225 kontext "TabSPADevice"
226 printlog( " * Tab: Device" )
227 call dialogtest( TabSPADevice )
230 active.setpage TabSPAFontReplacement
232 kontext "TabSPAFontReplacement"
233 printlog( " * Tab: FontReplacement" )
234 call dialogtest( TabSPAFontReplacement )
237 active.setpage TabSPAOther
239 kontext "TabSPAOther"
240 printlog( " * Tab: Other" )
241 call dialogtest( TabSPAOther )
243 printlog( " * close Properties" )
250 '*******************************************************************************
252 sub TestRename( cPrinter as string )
257 LBPrinters.select( hGetPrinterPosition( CPRINTER , true ) )
260 printlog( " * Open 'Rename' dialog" )
264 Kontext "SPRenamePrinterDLG"
265 call dialogtest( SPRenamePrinterDLG )
266 printlog( " * Close 'Rename' dialog" )
267 SPRenamePrinterDLG.cancel()