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 : Macro Dialogs opened from Basic-IDE
32 '\******************************************************************************
34 testcase tBasic_IDE_Toolbar_Module
36 printlog( "BASIC toolbars for modules" )
38 const DIALOG_DELAY = 2
41 dim cTargetFile as string
42 cTargetFile = convertpath( gOfficepath & "user\work\global_test.bas" )
44 dim cSourceFile as string
45 cSourceFile = gTesttoolpath & "framework\optional\input\resetregistration.txt"
46 cSourceFile = convertpath( cSourceFile )
48 printlog "open a new writer-doc"
49 gApplication = "WRITER"
52 if ( hInitBasicIDE( "tBasic_IDE_Toolbar_Module" ) ) then
56 hClickButton( Compile )
58 printlog "- Run Basic"
59 hClickButton( BasicRun )
61 printlog "- Step Procedure"
62 hClickButton( ProcedureStep )
64 printlog "- Stop Basic"
65 hClickButton( BasicStop )
67 printlog "- Single Step"
68 hClickButton( SingleStep )
70 printlog "- Step Back"
71 hClickButton( StepBack )
73 printlog "- Breakpoint => activate"
74 hClickButton( Breakpoint )
77 printlog "- Breakpoint => deactivate"
78 hClickButton( Breakpoint )
80 printlog "- Add Watch => deactivate"
81 hClickButton( AddWatch )
83 printlog "- Find Paranthese"
86 hClickButton( FindParanthese )
90 warnlog "Controls are active in a module window => bug!"
92 printlog( "Controls are not active->OK" )
94 if ( WaitSlot <> WSFinished ) then
95 warnlog( "Slot not finished within 1 second" )
99 printlog( "- Insert Source Text (" & cSourceFile & ")" )
100 if ( hClickButton( InsertSourceText ) <> RC_FAILURE ) then
103 if ( OeffnenDlg.exists( DIALOG_DELAY ) ) then
104 Dateiname.SetText( cSourceFile )
108 warnlog( "File Open dialog did not open" )
111 ' possible 'could not read from file' error-message -> this is a bug
113 if ( Active.exists( DIALOG_DELAY ) ) then
114 warnlog( "Unexpected active: " & active.gettext() )
118 warnlog( "<File Open> dialog is not open, <Insert Source Text> button failed" )
122 printlog "- Save Source Text "
123 if ( hClickButton( SaveSourceText ) <> RC_FAILURE ) then
125 kontext "speicherndlg"
126 if ( SpeichernDlg.exists( DIALOG_DELAY ) ) then
127 Dateiname.SetText( cTargetFile )
130 warnlog( "File Save dialog is missing" )
134 if ( Active.Exists( DIALOG_DELAY ) ) then
135 printlog( "Closing Messagebox with <Yes>")
139 warnlog( "<File Save> dialog did not open, slot <SaveSourceText> did not work" )
144 warnlog( "Unable to init BASIC IDE" )
149 '*******************************************************************************
151 testcase tBasic_IDE_Toolbar_Dialogs
153 printlog( "BASIC toolbar for Dialogs" )
155 const DIALOG_DELAY = 2
157 const TABBAR_MENU_NEW = 1
158 const TABBAR_MENU_NEW_DIALOG = 2
160 dim bIsOpen as boolean
163 dim sBasfile1 as string
164 sBasFile1 = gTesttoolpath & "framework\optional\input\resetregistration.txt"
165 sBasFile1 = convertpath( sBasFile1 )
167 dim sBasFile2 as string
168 sBasFile2 = convertpath( gOfficepath & "user\work\global_test.bas" )
171 printlog "open a new writer-doc"
172 gApplication = "WRITER"
175 if ( hInitBasicIDE( "tBasic_IDE_Toolbar_Dialogs" ) ) then
178 Tabbar.OpenContextMenu
179 hMenuSelectNr ( TABBAR_MENU_NEW )
180 hMenuSelectNr ( TABBAR_MENU_NEW_DIALOG )
182 if ( DialogWindow.Exists ( DIALOG_DELAY ) ) then
183 printlog( "Dialog Editor window is open. Good." )
185 warnlog "No dialog window is shown!"
191 warnlog( """Compile"" is enabled" )
193 printlog( """Compile"" is disabled" )
199 warnlog( """Run Basic"" is enabled" )
201 printlog( """Run Basic"" is disabled" )
204 printlog "- Step Procedure (disabled)"
207 ProcedureStep.Click()
208 warnlog( """Step Procedure"" is enabled" )
210 printlog( """Step Procedure"" is disabled" )
216 warnlog( """Stop Basic"" is enabled" )
218 printlog( """Stop Basic"" is disabled" )
224 warnlog( """Single Step"" is enabled" )
226 printlog( """Single Step"" is enabled" )
232 warnlog( """Single Step Back"" is enabled" )
234 printlog( """Single Step Back"" is enabled" )
240 warnlog( """Breakpoint"" is enabled" )
242 printlog( """Breakpoint"" is disabled" )
249 warnlog( """Add Watch"" is enabled" )
251 printlog( """Add Watch"" is disabled" )
257 FindParanthese.Click()
258 warnlog( """Find Paranthese"" is enabled" )
260 printlog( """Find Paranthese"" is disabled" )
266 InsertSourceText.Click()
267 warnlog( """Insert Source Text"" is enabled" )
270 if ( OeffnenDlg.exists( DIALOG_DELAY ) ) then
271 Dateiname.SetText( sBasFile1 )
274 warnlog( "File Open dialog missing" )
277 printlog( """Insert Source Text"" is disabled" )
281 printlog "- Save Source Test (disabled)"
285 SaveSourceText.Click()
286 warnlog( """Save Source Text"" is enabled" )
288 kontext "speicherndlg"
289 if ( SpeichernDlg.exists( DIALOG_DELAY ) ) then
290 Dateiname.SetText( sBasFile2 )
293 warnlog( "File Save dialog is missing" )
297 if ( Active.Exists( DIALOG_DELAY ) ) then
301 printlog( """Save Source Text"" is disabled" )
307 warnlog( "Unable to open BASIC IDE" )