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: basic_ide.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $
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 : Macro Dialogs opened from Basic-IDE
38 '\******************************************************************************
40 testcase tBasic_IDE_Toolbar_Module
42 qaerrorlog( "Replace this test asap, the approach is unusable" )
45 dim cSourceFile as string
46 cSourceFile = gTesttoolpath & "framework\optional\input\resetregistration.txt"
47 cSourceFile = convertpath( cSourceFile )
50 '///<h1>Work with Toolbar on Basic-IDE part 1</h1>
54 '///+<li>Open a new writer-doc</li>
55 printlog "open a new writer-doc"
56 gApplication = "WRITER"
59 '///+<li>Create a new module for the new document (named TTModule)</li>
60 brc = hOpenBasicOrganizerFromDoc()
61 brc = hCreateModuleForDoc()
63 '///+<li>Click "Compile" on Toolbar</li>
68 if ( WaitSlot <> WSFinished ) then
69 warnlog( "Slot not finished within 1 second" )
72 '///+<li>Click "Run Basic" on Toolbar</li>
73 printlog "- Run Basic"
75 if ( WaitSlot <> WSFinished ) then
76 warnlog( "Slot not finished within 1 second" )
80 '///+<li>Click "Step Procedure" on Toolbar</li>
81 printlog "- Step Procedure"
83 if ( WaitSlot <> WSFinished ) then
84 warnlog( "Slot not finished within 1 second" )
88 '///+<li>Click "Stop Basic" on Toolbar</li>
89 printlog "- Stop Basic"
91 if ( WaitSlot <> WSFinished ) then
92 warnlog( "Slot not finished within 1 second" )
96 '///+<li>Click "Single Step" on Toolbar</li>
97 printlog "- Single Step"
99 if ( WaitSlot <> WSFinished ) then
100 warnlog( "Slot not finished within 1 second" )
104 '///+<li>Click "Step Back" on Toolbar</li>
105 printlog "- Step Back"
107 if ( WaitSlot <> WSFinished ) then
108 warnlog( "Slot not finished within 1 second" )
112 '///+<li>Click "Breakpoint" on Toolbar</li>
113 printlog "- Breakpoint => activate"
115 if ( WaitSlot <> WSFinished ) then
116 warnlog( "Slot not finished within 1 second" )
120 '///+<li>Deactivate "Breakpoint" on Toolbar</li>
121 printlog "- Breakpoint => deactivate"
123 if ( WaitSlot <> WSFinished ) then
124 warnlog( "Slot not finished within 1 second" )
128 '///+<li>Click "Add Watch" on Toolbar</li>
129 printlog "- Add Watch => deactivate"
131 if ( WaitSlot <> WSFinished ) then
132 warnlog( "Slot not finished within 1 second" )
136 '///+<li>Click "Find Paranthese" on Toolbar</li>
137 printlog "- Find Paranthese"
140 FindParanthese.Click()
141 if ( WaitSlot <> WSFinished ) then
142 warnlog( "Slot not finished within 1 second" )
146 '///+<li>"Controls"</li>
149 warnlog "Controls are active in a module window => bug!"
151 printlog( "Controls are not active->OK" )
153 if ( WaitSlot <> WSFinished ) then
154 warnlog( "Slot not finished within 1 second" )
157 printlog( "- Insert Source Text (" & cSourceFile & ")" )
159 '///+<li>"Insert Source Text"<br>
160 '///+Insert external file "ResetRegistration.txt"</li>
162 InsertSourceText.Click()
164 if ( OeffnenDlg.exists( 1 ) ) then
165 Dateiname.SetText( cSourceFile )
168 warnlog( "File Open dialog did not open" )
171 ' possible 'could not read from file' error-message -> this is a bug
173 if ( Active.exists( 1 ) ) then
174 warnlog( "Unexpected active: " & active.gettext() )
179 printlog "- Save Source Test "
181 '///+<li>Click "Save Source Test" on Toolbar, save the file</li>
183 if ( WaitSlot <> WSFinished ) then
184 warnlog( "Slot not finished within 1 second" )
188 kontext "speicherndlg"
189 if ( SpeichernDlg.exists( 1 ) ) then
190 Dateiname.SetText ConvertPath (gOfficepath + "user\work\global_test.bas")
193 warnlog( "File Save dialog is missing" )
197 if ( Active.Exists( 1 ) ) then
201 '///+<li>File/Close for Basic-IDE and Document</li></ul>
202 hDestroyDocument() ' for Basic-IDE
203 hDestroyDocument() ' the new writer-doc
207 '*******************************************************************************
209 testcase tBasic_IDE_Toolbar_Dialogs
211 qaerrorlog( "Replace this test asap, the approach is unusable" )
213 dim bIsOpen as boolean
216 dim sBasfile1 as string
217 sBasFile1 = gTesttoolpath & "framework\optional\input\resetregistration.txt"
218 sBasFile1 = convertpath( sBasFile1 )
220 dim sBasFile2 as string
221 sBasFile2 = convertpath( gOfficepath & "user\work\global_test.bas" )
223 '///<h1>Work with Toolbar on Basic-IDE part 2</h1>
226 '///+<li>Open a new writer-doc</li>
227 printlog "open a new writer-doc"
228 gApplication = "WRITER"
231 '///+<li>Create a new module for the new document (named TTModule)</li>
232 printlog "create a new module "
233 brc = hOpenBasicOrganizerFromDoc()
234 brc = hCreateModuleForDoc()
236 '///+<li>Create a new dialog in BasicIDE</li>
238 Tabbar.OpenContextMenu
241 if ( DialogWindow.Exists ( 2 ) ) then
242 printlog( "Dialog Editor window is open. Good." )
244 warnlog "No dialog window is shown!"
247 '///+<li>Macro execution buttons should be disabled</li>
249 '///+<li>Compile</li>
253 warnlog( """Compile"" is enabled" )
255 printlog( """Compile"" is disabled" )
258 '///+<li>Run Basic</li>
262 warnlog( """Run Basic"" is enabled" )
264 printlog( """Run Basic"" is disabled" )
267 '///+<li>Step Procedure</li>
268 printlog "- Step Procedure (disabled)"
271 ProcedureStep.Click()
272 warnlog( """Step Procedure"" is enabled" )
274 printlog( """Step Procedure"" is disabled" )
277 '///+<li>Stop Basic</li>
281 warnlog( """Stop Basic"" is enabled" )
283 printlog( """Stop Basic"" is disabled" )
286 '///+<li>Single Step</li>
290 warnlog( """Single Step"" is enabled" )
292 printlog( """Single Step"" is enabled" )
295 '///+<li>Single Step Back</li>
299 warnlog( """Single Step Back"" is enabled" )
301 printlog( """Single Step Back"" is enabled" )
304 '///+<li>Breakpoint</li>
308 warnlog( """Breakpoint"" is enabled" )
310 printlog( """Breakpoint"" is disabled" )
314 '///+<li>Add Watch</li>
318 warnlog( """Add Watch"" is enabled" )
320 printlog( """Add Watch"" is disabled" )
324 '///+<li>Find Paranthese</li>
327 FindParanthese.Click()
328 warnlog( """Find Paranthese"" is enabled" )
330 printlog( """Find Paranthese"" is disabled" )
334 '///+<li>Insert Source Text</li>
337 InsertSourceText.Click()
338 warnlog( """Insert Source Text"" is enabled" )
341 if ( OeffnenDlg.exists( 2 ) ) then
342 Dateiname.SetText( sBasFile1 )
345 warnlog( "File Open dialog missing" )
348 printlog( """Insert Source Text"" is disabled" )
352 printlog "- Save Source Test (disabled)"
354 '///+<li>Click "Save Source Text" (disabled)<br>
355 '///+Save it as bas-file</li>
358 SaveSourceTest.Click()
359 warnlog( """Save Source Text"" is enabled" )
361 kontext "speicherndlg"
362 if ( SpeichernDlg.exists( 2 ) ) then
363 Dateiname.SetText( sBasFile2 )
366 warnlog( "File Save dialog is missing" )
370 if ( Active.Exists( 1 ) ) then
374 printlog( """Save Source Text"" is disabled" )
379 '///+<li>Tear off controls</li>
380 bIsOpen = hShowMacroControls()
382 ToolsCollectionBar.Close()
385 '///+<li>File/Close on Basic-IDE and Document</li></ul>
386 Call hDestroyDocument() ' for Basic-IDE
387 Call hDestroyDocument() ' the new writer-doc