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 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: first.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:19:03 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : joerg.skottke@sun.com
36 '* short description : First test of basic functionality
38 '\******************************************************************************
41 '/// Open all document types and check the default filter name.
42 Dim lsList (20) as string
44 if (gUseSysDlg = TRUE) then
45 warnlog("Only check, if the documents will be opened; no " & _
46 "check for the defaultfilter (system file-dialog)!")
49 '///+<ul><li>Create a new text document (Writer)</li>
50 '///+<li>Type some text</li>
51 '///+<li>Check the default filter name (fDocumentCheck)</li>
52 '///+<li>Close the document window without saving it</li></ul>
55 gApplication = "WRITER"
56 printlog " - " + gApplication
60 Kontext "DocumentWriter"
61 DocumentWriter.TypeKeys "This is a Writer-document!"
62 if gUseSysDlg = FALSE then
63 if fDocumentCheck (gWriterFilter) = FALSE then
64 warnlog("The filter name (saving) is not correct! " & _
65 "Please check if a Writer document will be opened!")
74 '///+<ul><li>Create a new spreadsheet document</li>
75 '///+<li>Type some text in a cell</li>
76 '///+<li>Check the default filter name (fDocumentCheck)</li>
77 '///+<li>Close the document window without saving it</li></ul>
80 printlog " - " + gApplication
83 Kontext "DocumentCalc"
84 DocumentCalc.TypeKeys "This is a Calc-document!"
86 if gUseSysDlg = FALSE then
87 if fDocumentCheck (gCalcFilter) = FALSE then
88 warnlog("The filter name (saving) is not correct! " & _
89 "Please check if a Calc document will be opened!")
98 '///+<ul><li>Create a new (empty) presentation</li>
99 '///+<li>Insert a new slide with <i>Insert</i> / <i>Duplicate slide</i></li>
100 '///+<li>Check the default filter name (fDocumentCheck)</li>
101 '///+<li>Close the document window without saving it</li></ul>
103 gApplication = "IMPRESS"
104 printlog " - " + gApplication
110 if gUseSysDlg = FALSE then
111 if fDocumentCheck (gImpressFilter) = FALSE then
112 warnlog("The filter name (saving) is not correct! " & _
113 "Please check if an Impress document will be opened!")
122 '///+<ul><li>Create a new drawing document</li>
123 '///+<li><i>Insert</i> / <i>slide</i></li>
124 '///+<li>Check the default filter name (fDocumentCheck)</li>
125 '///+<li>Close the document window without saving it</li></ul>
127 gApplication = "DRAW"
128 printlog " - " + gApplication
131 if gUseSysDlg = FALSE then
132 if fDocumentCheck (gDrawFilter) = FALSE then
133 warnlog("The filter name (saving) is not correct! Please check if a Draw document will be opened!")
142 gApplication = "HTML"
143 printlog " - " + gApplication
144 '///+<ul><li>Create a new HTML document</li>
146 Kontext "DocumentWriter"
147 '///+<li>Type some text</li>
148 DocumentWriter.TypeKeys "This is a HTML-Document!"
149 '///+<li>Check the default filter name (fDocumentCheck)</li>
150 if gUseSysDlg = FALSE then
151 if (fDocumentCheck (gHTMLFilter) = FALSE) then
152 warnlog("The filter name (saving) is not correct! Please check if a HTML document will be opened! -> #i30867")
155 '///+<li>Close the document window without saving it</li></ul>
162 '///+<ul><li>Create a new Math document</li>
163 '///+<li>Type formula: <i>a over b</i></li>
164 '///+<li>Check the default filter name (fDocumentCheck)</li>
165 '///+<li>Close the document window without saving it</li></ul>
167 gApplication = "MATH"
168 printlog " - " + gApplication
170 Call SchreibenInMathDok("a over b")
171 if gUseSysDlg = FALSE then
172 if fDocumentCheck (gMathFilter) = FALSE then
173 warnlog("The filter name (saving) is not correct! Please check if a Math document will be opened!")
182 '///+<ul><li>Crate a new Master document</li>
183 '///+<li>Type some text</li>
184 '///+<li>Check the default filter name (fDocumentCheck)</li>
185 '///+<li>Close the document window without saving it</li></ul>
188 gApplication = "MASTERDOCUMENT"
189 printlog " - " + gApplication
191 Kontext "DocumentWriter"
192 DocumentWriter.TypeKeys "This is a master document!"
193 if gUseSysDlg = FALSE then
194 if fDocumentCheck (gMasterDocFilter) = FALSE then
195 warnlog("The filter name (saving) is not correct! Please check if a Master document will be opened!")
199 if Navigator.Exists(5) then
209 '-------------------------------------------------------------------------
212 '/// Check a HTML-page with Java crashes.
213 '///+<ul><li>Enable the internal file dialog:
214 '///+<ul><li><i>Tools</i></li>
215 '///+<li><i>Options</i></li>
216 '///+<li><i>OpenOffice.org</i></li>
217 '///+<li><i>General</i></li>
218 '///+<li>Check <i>Use OpenOffice.org dialogs</i></li></ul></li>
219 '///+<li>Insert <b><i>TesttoolPath</i>/global/input/java/java.htm</b></li>
220 '///+<li>Wait 5 seconds</li>
221 '///+<li>Close the document</li></ul>
223 Dim iTryLoadingJava as integer
226 ' This test will not work if the system filedialog is used.
228 warnlog("No test with system file-dialog!")
232 Dateiname.settext(ConvertPath(gTestToolPath & "global\input\java\java.htm")
235 for iTryLoadingJava = 1 to 10
237 'Sometimes it needs time to bring up the Java Runtime on the system.
238 'Just trying it 10 times (paused with a sleep(1)
240 ' if no java is installed or it is disabled a messagebox will be displayed
241 ' for each class file triggered by this test, so there will be two errormessages
242 ' asking to enable java. The first msgbox will be handled within the loop while
243 ' waiting for the document to get loaded, the second msgbox will be handled
244 ' outside the loop, it comes up right after the first one.
247 if ( MessageBox.exists()) then
248 if (gPlatGroup = "unx") then
251 warnlog(Messagebox.GetText())
256 Messagebox.OK() ' if "OK" works, we are in an undefined state
257 warnlog( "The dialog has been closed by OK -> BUG" )
263 printlog "... wait another second ..."
267 ' the second errormessage is a bug (even if it is logical it is not ok
268 ' from a user's point of view. The task will not be fixed for OOo 2.0
270 if ( messagebox.exists() ) then
272 qaerrorlog( "#i37020# Second messagebox displayed" )
276 warnlog( "The dialog has been closed by OK -> BUG" )
281 Call hCloseDocument()
285 '-------------------------------------------------------------------------
287 testcase tDatabaseCheck
288 '/// Open bibliography Database.
291 gApplication = "WRITER"
292 hFileOpen( ConvertPath(gOfficePath & "user\database\biblio.odb" )
293 '/// Check if database is open
294 printlog "check if database is open"
296 if (Database.exists()) then
297 printlog "Database open"
298 '/// Click on the table icon and check if tables are displayed
299 printlog "click on the table icon and check if tables are displayed"
302 Kontext "ContainerView"
303 if TableTree.exists() then
304 printlog "table tree visible"
306 warnlog "table tree not visible"
309 warnlog "Database not open"
313 warnlog "error while open Database."
317 '-------------------------------------------------------------------------
319 function fDocumentCheck (SollFilter as String) as boolean
320 ' Check the name of the file type in the Save dialog and validate
321 ' it against a given string.
322 Dim sFiltername as String
325 Kontext "SpeichernDlg"
326 sFiltername = DateiTyp.GetItemText (1)
327 if (Instr(lcase(sFiltername), lcase (SollFilter)) <> 0) then
328 fDocumentCheck() = TRUE
330 printlog("Filter names do not match:")
331 printlog("Found: [" & sFilterName & "]")
332 printlog("Expected: [" & SollFilter & "]")
333 SollFilter = sFiltername
334 fDocumentCheck() = FALSE
336 SpeichernDlg.Cancel()
339 '-------------------------------------------------------------------------
341 testcase tHelpRegistration
342 ' Check i69670 which was a showstopper in OOo 2.0.4
343 ' Menu-entry "Help / Registration" is disabled
346 printlog " - Check if all entries in Help Menu are enabled"
348 printlog " open menu"
350 a = hMenuItemGetCount
351 printlog " select the last entry 'Help'"
353 a = hMenuItemGetCount
355 if hMenuItemIsEnabled(i) then
356 printlog "("+i+"/"+a+"): Menu entry is enabled: Help-> " + hMenuItemGetText(i)
358 if (lcase(gPlatform) = "osx") then
359 warnlog "#i86247# Help->Registration is disabled on MacOS X"
361 warnlog "("+i+"/"+a+"): Menu entry is not enabled: Help-> " + hMenuItemGetText(i)
369 '-------------------------------------------------------------------------