1 'encoding UTF-8 Do not remove or change this line!
\r
2 '**************************************************************************
\r
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
\r
5 '* Copyright 2008 by Sun Microsystems, Inc.
\r
7 '* OpenOffice.org - a multi-platform office productivity suite
\r
9 '* $RCSfile: topten.inc,v $
\r
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:19:04 $
\r
15 '* This file is part of OpenOffice.org.
\r
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
\r
18 '* it under the terms of the GNU Lesser General Public License version 3
\r
19 '* only, as published by the Free Software Foundation.
\r
21 '* OpenOffice.org is distributed in the hope that it will be useful,
\r
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
24 '* GNU Lesser General Public License version 3 for more details
\r
25 '* (a copy is included in the LICENSE file that accompanied this code).
\r
27 '* You should have received a copy of the GNU Lesser General Public License
\r
28 '* version 3 along with OpenOffice.org. If not, see
\r
29 '* <http://www.openoffice.org/license.html>
\r
30 '* for a copy of the LGPLv3 License.
\r
32 '/************************************************************************
\r
34 '* owner : joerg.skottke@sun.com
\r
36 '* short description : Smoke test (load/save/clipboard)
\r
38 '\***********************************************************************
\r
42 gApplication = "WRITER"
\r
45 gApplication = "CALC"
\r
48 gApplication = "IMPRESS"
\r
51 gApplication = "DRAW"
\r
54 gApplication = "MATH"
\r
57 gApplication = "HTML"
\r
60 gApplication = "MASTERDOCUMENT"
\r
65 '*******************************************************************************
\r
67 testcase Top_ten_test
\r
68 \r dim sUserWorkDirectory as string
\r
69 dim sFilename_native as String
\r
70 dim sFilename_export as String
\r
71 dim sFilter_native as string
\r
72 dim sFilter_export as String
\r
73 dim bExportFile as boolean
\r
75 sUserWorkDirectory = gOfficePath & "user\work\"
\r
78 printlog( "Current document type: " & gApplication )
\r
80 ' set the filenames and their filters. HTML is not exported
\r
81 if ( gApplication = "HTML" ) then
\r
82 sFilename_native = "ls_test.html"
\r
83 sFilename_export = "ls_test.htm"
84 bExportFile = FALSE
\r
86 sFilename_native = "ls_test" & hGetSuffix( "current" )
\r
87 sFilename_export = "ls_test" & hGetSuffix( "569" )
\r
90 printlog( "File (current): " & sFilename_native )
\r
91 printlog( "File (src569).: " & sFilename_export )
\r
93 ' Delete the workfiles, they might have been left over by prior incomplete testrun
\r
94 hDeleteFile( sUserWorkDirectory & sFilename_native )
\r
95 hDeleteFile( sUserWorkDirectory & sFilename_export )
\r
97 ' Set the API filternames for the current application (native XML format)
\r
98 select case gApplication
\r
99 case "WRITER" : sFilter_native = "writer8"
\r
100 case "CALC" : sFilter_native = "calc8"
\r
101 case "DRAW" : sFilter_native = "draw8"
\r
102 case "IMPRESS" : sFilter_native = "impress8"
\r
103 case "MATH" : sFilter_native = "math8"
\r
104 case "MASTERDOCUMENT" : sFilter_native = "writerglobal8"
\r
105 case "HTML" : sFilter_native = "HTML"
106 case else : warnlog "Invalid gApplication: " & gApplication
\r
109 printlog( "Create a new document" )
\r
112 printlog( "Clipboard" )
\r
115 printlog( "Save (default-fileformat): " & sFilename_native )
\r
116 call hFileSaveAsKill ( sUserWorkDirectory & sFilename_native )
\r
118 if ( bExportFile ) then
\r
120 ' Set the API filternames for the current application (StarOffice 5.2 binary format)
\r
121 select case gApplication
\r
122 case "WRITER" : sFilter_export = "StarWriter 5.0"
\r
123 case "CALC" : sFilter_export = "StarCalc 5.0"
\r
124 case "DRAW" : sFilter_export = "StarDraw 5.0"
\r
125 case "IMPRESS" : sFilter_export = "StarImpress 5.0"
\r
126 case "MATH" : sFilter_export = "StarMath 5.0"
\r
127 case "MASTERDOCUMENT" : sFilter_export = "StarWriter 5.0/GlobalDocument"
\r
128 case else : warnlog "Invalid gApplication: " & gApplication
\r
131 printlog( "Save (5.2-fileformat): " & sFilename_export )
\r
132 hFileSaveAsWithFilterKill( sUserWorkDirectory & sFilename_export , sFilter_export )
\r
134 printlog( "Close" )
\r
137 ' There should be no alien warning
\r
139 If ( active.exists( 1 ) ) then
\r
140 warnlog( "Unexpected messagebox: '" & active.getText & "'" )
\r
143 printlog( "No more alien warning on closing the document. Good." )
\r
149 if ( Active.Exists( 1 ) ) then
\r
150 warnlog( "Unexpected Active after saving: '" & active.getText & "'" )
\r
159 printlog( "Load (default-fileformat): " & sFilename_native )
\r
160 call hFileOpen( sUserWorkDirectory & sFilename_native )
\r
162 if ( bExportFile ) then
\r
163 printlog( "Change the document" )
\r
169 printlog( "Close" )
\r
172 if ( bExportFile ) then
174 printlog( "Load (5.2-fileformat): " & sFilename_export )
\r
175 call hFileOpen (sUserWorkDirectory & sFilename_export)
177 if ( gApplication = "MATH" AND iSprache = 84 AND gPlatform="lin" ) then
\r
179 kontext "DocumentMath"
\r
180 DocumentMath.MouseDown(50,50)
\r
181 DocumentMath.MouseUp(50,50)
\r
182 qaErrorLog( "Use workaround focus problem for math and language vi/84" )
\r
183 ' Needed by AndreSchnabel, not manual reproduceable, only with TestTool
\r
185 qaErrorLog( "Workaround focus problem failed." )
\r
189 ' Modify the export document to trigger the alien warning on next save
\r
190 printlog( "Change the document" )
\r
196 Kontext "AlienWarning"
\r
197 if ( AlienWarning.exists( 3 ) ) then
\r
198 printlog( "Closing expected alien warning. Good." )
\r
201 warnlog( "Alien warning is missing" )
\r
205 if ( Active.Exists( 3 ) ) then
\r
206 warnlog( "Unexpected messagebox: '" & active.getText & "'" )
\r
209 printlog( "No unexpected messages on save. Good." )
\r
212 printlog( "Close" )
\r
216 if ( Active.Exists() ) then
\r
217 warnlog( "Unexpected messagebox: '" & active.getText & "'" )
\r
220 printlog( "No more alien warning to close. Good." )
\r
224 hDeleteFile( sUserWorkDirectory & sFilename_native )
\r
225 hDeleteFile( sUserWorkDirectory & sFilename_export )
\r
229 '*******************************************************************************
\r
232 dim sSelectAll as string
\r
234 ' In Spain Select All is CTRL+E; CTRL+A is FileOpen
\r
235 if (iSprache=34) then
\r
236 sSelectAll = "<Mod1 e>"
\r
238 sSelectAll = "<Mod1 a>"
\r
241 select case gApplication
\r
242 case "WRITER", "HTML", "MASTERDOCUMENT"
\r
243 kontext "documentwriter"
\r
244 DocumentWriter.TypeKeys "This is a test.<Return>"
\r
246 DocumentWriter.TypeKeys sSelectAll
\r
247 DocumentWriter.TypeKeys "<Mod1 x>"
\r
249 printlog( " paste" )
\r
250 DocumentWriter.TypeKeys "<Mod1 v>"
\r
252 printlog( " copy" )
\r
253 DocumentWriter.TypeKeys sSelectAll
\r
254 DocumentWriter.TypeKeys "<Mod1 c>"
\r
256 printlog( " paste" )
\r
257 DocumentWriter.TypeKeys "<Mod1 v>"
\r
259 case "CALC" : Kontext "DocumentCalc"
\r
260 DocumentCalc.TypeKeys "This is a test.<Return>"
\r
261 DocumentCalc.TypeKeys "<Up>"
\r
263 DocumentCalc.TypeKeys "<Mod1 x>"
\r
265 printlog( " paste" )
\r
266 DocumentCalc.TypeKeys "<Down>"
\r
267 DocumentCalc.TypeKeys "<Mod1 v>"
\r
269 printlog( " copy" )
\r
270 DocumentCalc.TypeKeys "<Mod1 c>"
\r
272 printlog( " paste" )
\r
273 DocumentCalc.TypeKeys "<Down>"
\r
274 DocumentCalc.TypeKeys "<Mod1 v>"
\r
276 case "DRAW" : Kontext "DocumentDraw"
\r
277 hRechteckErstellen ( 30, 30, 60, 60 )
\r
278 gMouseClick ( 1, 1 )
\r
280 DocumentDraw.TypeKeys sSelectAll
\r
281 DocumentDraw.TypeKeys "<Mod1 x>"
\r
283 printlog( " paste" )
\r
284 DocumentDraw.TypeKeys "<Mod1 v>"
\r
286 printlog( " copy" )
\r
287 gMouseClick ( 1, 1 )
\r
288 DocumentDraw.TypeKeys sSelectAll
\r
289 DocumentDraw.TypeKeys "<Mod1 c>"
\r
291 printlog( " paste" )
\r
292 gMouseClick ( 1, 1 )
\r
293 DocumentDraw.TypeKeys "<Mod1 v>"
\r
294 case "IMPRESS": Kontext "DocumentImpress"
\r
295 hRechteckErstellen ( 30, 30, 60, 60 )
\r
296 gMouseClick ( 1, 1 )
\r
298 DocumentImpress.TypeKeys sSelectAll
\r
299 DocumentImpress.TypeKeys "<Mod1 x>"
\r
301 printlog( " paste" )
\r
302 DocumentImpress.TypeKeys "<Mod1 v>"
\r
304 printlog( " copy" )
\r
305 gMouseClick ( 1, 1 )
\r
306 DocumentImpress.TypeKeys sSelectAll
\r
307 DocumentImpress.TypeKeys "<Mod1 c>"
\r
309 printlog( " paste" )
\r
310 gMouseClick ( 1, 1 )
\r
311 DocumentImpress.TypeKeys "<Mod1 v>"
\r
312 case "MATH" : SchreibenInMathdok "a over b"
\r
314 hUseAsyncSlot( "EditSelectAllMath" )
\r
315 hUseAsyncSlot( "EditCut" )
\r
316 printlog( " paste" )
\r
317 hUseAsyncSlot( "EditPaste" )
\r
318 printlog( " copy" )
\r
319 hUseAsyncSlot( "EditSelectAllMath" )
\r
320 hUseAsyncSlot( "EditCopy" )
\r
321 printlog( " paste" )
\r
322 hUseAsyncSlot( "EditPaste" )
\r