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 : "10ner/Smoke Test" from release engineering
32 '\******************************************************************************
36 if ( not hCheckForBinfilters() ) then
40 printlog( "Smoketest (10er-Test) from Release Engineering" )
41 dim sLocation as string
44 dim lFiles(200) as string
46 dim iError, iOK as integer
48 sLocation = "framework/first/inc/smoketest.inc::"
50 'To avoid focus problems, go to backingwindow
51 if getDocumentcount <> 0 then
52 'After an resetApplication at least one document may be open.
53 printlog "closed one window " + getDocumentCount
57 'Delete temp dir of logs
58 sTemp = convertPath(gOfficePath + "user/temp/")
59 printlog "Going to delete ttt.*: " + GetFileList(sTemp,"ttt.*",lFiles())
60 printlog "Going to delete *.dat: " + GetFileList(sTemp,"*.dat",lFiles())
61 bTemp = KillFileList(lFiles())
63 for i = 1 to ListCount(lFiles())
64 qaErrorlog sLocation + "Can't delete file: " + i + ": '" + lFiles(i) + "'"
68 'Open the test document
69 call hFileOpen(convertPath(gTestToolPath + "framework/required/input/10erTest_680.sxw"))
70 'Security dialog might come up
71 kontext "SecurityWarning"
72 if SecurityWarning.exists(5) then
78 'Start the macro, that performs the test
79 'Tools->Macros->Run Macro...
80 'Check, if all three libraries are there, else close and try again...
82 Kontext "ScriptSelector"
83 if ScriptSelector.exists(10) then
84 x = LibraryTreeList.getItemCount
85 'There have to show up 3 libraries, else the document isn't loaded
87 printlog "Try again..."
91 Kontext "ScriptSelector"
92 x = LibraryTreeList.getItemCount
94 'Look for library '10erTest_680' and '10ERTEST_680'
96 sTemp = LibraryTreeList.getItemText(i)
97 'printlog "("+i+"/"+x+"): '" + sTemp + "'"
98 if (instr(sTemp,"10erTest_680")>0 OR instr(sTemp,"10ERTEST_680")) then
100 printlog "Found library ("+i+"/"+x+"): '" + sTemp + "'"
104 'Select the library and unfold it
105 LibraryTreeList.select(a)
106 LibraryTreeList.typeKeys("+")
107 ' LibraryTreeList.select("10erTest_680") ' not implemented right now :-(
108 'Go to 'Standard' and unfold
109 LibraryTreeList.typeKeys("<down>")
110 LibraryTreeList.typeKeys("+")
112 LibraryTreeList.typeKeys("<down>")
114 'Select macro name 'StartTestByOption'
115 x = ScriptList.getItemCount
117 sTemp = ScriptList.getItemText(i)
118 'printlog "("+i+"/"+x+"): '" + sTemp + "'"
119 if "StartTestByOptions" = sTemp then
121 printlog "Found macro ("+i+"/"+x+"): '" + sTemp + "'"
127 'Start the macro by pressing the button 'run'
129 ' sleep... at least 60 seconds
131 ' If macro fails for whatever reason, a message comes up
133 if active.exists() then
134 warnlog "Macro failed " + active.getText
136 call hCloseDocument()
140 'Path of the log file written by the macro
141 sTemp = convertPath(gOfficePath + "user/temp/log.dat")
143 'Wait until file exists, but not longer than ten minutes
144 while ((NOT fileExists(sTemp)) AND (a < 10))
145 printlog "waiting another minute until file exists - " + a
152 printlog "Log file exists: " + sTemp
153 'Wait until test finished, but not longer than ten minutes
154 'String at end, if finished: 'FINISHED' modified 10er sxw document from TBO!
157 call ListRead (lFiles(), sTemp)
158 while ((lFiles(ListCount(lFiles())) <> "FINISHED") AND (a < 10))
159 printlog "last line: '" + lFiles(ListCount(lFiles())) + "'"
163 call ListRead (lFiles(), sTemp)
168 printlog "Test document finished."
169 'Grep file for "-> error" & "-> ok"
170 a = ListCount(lFiles())
172 if inStr(lFiles(i), "-> error") > 0 then
173 if inStr("simpress Paste Object -> errorsdraw Paste Object -> error",lFiles(i)) > 0 then
179 elseif inStr(lFiles(i), "-> ok") > 0 then
185 qaErrorlog sLocation + "Smoketest/10-er Test failed: " + iError + " times."
187 printlog "Smoketest/10-er Test succeeded: " + iOK + " times."
189 warnlog sLocation + "Macro didn't finish in time (10 minutes)"
192 warnlog sLocation + "Macro didn't create log file in time (10 minutes)"
195 warnlog sLocation + "Macro not found: 'StartTestByOptions'"
198 warnlog sLocation + "Library not found: '10erTest_680' or '10ERTEST_680'"
201 warnlog sLocation + "'Run macro dialog' didn't came up"
205 'Close the document, else an error about the navigator will be thrown
206 if getDocumentcount > 0 then
207 call hCloseDocument()