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: g_customize.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-08-28 11:41:02 $
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 : thorsten.bosbach@sun.com
36 '* short description : update and resouce test for tools/customize
38 '************************************************************************
42 '\***********************************************************************
44 testcase tToolsCustomize
46 Dim iCountMsgBox as integer
47 '/// open application ///'
50 '/// Tools->Customize... ///'
54 '/// switch to tabpage 'Menus' ///'
56 Active.SetPage TabCustomizeMenu ' 1 ------------------
58 warnlog "couldn't switch to tabpage 'Menus'"
60 Kontext "TabCustomizeMenu"
61 if TabCustomizeMenu.exists(5) then
62 Call DialogTest ( TabCustomizeMenu )
63 '/// Go in 'Menu' list-box one item down
64 Menu.typeKeys("<down>")
65 '/// Go in 'Entries' list-box one item down
66 Entries.typeKeys("<down>")
68 '/// click button 'new' ///'
71 '/// 'New Menu' dialog comes up ///'
72 Kontext "MenuOrganiser"
73 Call DialogTest ( MenuOrganiser )
74 '/// Cancel dialog 'New Menu' ///'
78 Kontext "TabCustomizeMenu"
79 '/// In 'Menu' list-box select one item up
82 '/// Click on button 'Menu' ///'
84 printlog "opened first one"
86 '/// Select the first entry 'Move' ///'
88 '/// Dialog 'Move Menu' comes up ///'
89 Kontext "MenuOrganiser"
90 Call DialogTest ( MenuOrganiser )
91 '/// Click on the 'Up'-button ///'
93 '/// Click on the 'Down'-button ///'
95 '/// Cancel Dialog 'Move Menu' ///'
98 Kontext "TabCustomizeMenu"
99 '/// Click Button 'Add Commands' ///'
101 '/// Dialog 'Add Commands' comes up ///'
102 Kontext "ScriptSelector"
103 call DialogTest(ScriptSelector)
104 LibraryTreeList.typeKeys ("<down>")
105 ScriptList.typeKeys ("<down>")
106 '/// Close Dialog 'Add Commands' ///'
107 ScriptSelector.cancel
109 Kontext "TabCustomizeMenu"
110 '/// Click button 'Command' ///'
112 printlog "opened second one"
114 '/// Select the first entry 'Add Submenu' ///'
116 '/// Dialog 'Name' comes up ///'
117 Kontext "CustomizeMenuName"
118 call DialogTest (CustomizeMenuName)
119 Eingabefeld.typeKeys ("A")
120 '/// Cancel Dialog 'Name' ///'
121 CustomizeMenuName.cancel
124 Kontext "TabCustomizeMenu"
125 '/// Click button 'Command' ///'
127 printlog "opened third one"
129 '/// Select the third entry 'Rename' ///'
131 '/// Dialog 'Name' comes up ///'
132 Kontext "CustomizeMenuReName"
133 call DialogTest (CustomizeMenuReName)
134 Eingabefeld.typeKeys ("A")
135 '/// Cancel Dialog 'Name' ///'
136 CustomizeMenuReName.cancel
138 Kontext "TabCustomizeMenu"
139 '/// click button 'downwards' ///'
141 '/// click button 'upwards' ///'
143 '/// click button 'Reset' ///'
146 printlog "survived all menu comands"
147 if Messagebox.exists (5) then
148 if Messagebox.GetRT = 304 then
149 printlog "Messagebox: Menu configuration will be reset...: '"+Messagebox.getText+"'"
150 call DialogTest(Messagebox, 50)
157 '/// switch to tabpage 'Toolbars' ///'
159 Messagebox.SetPage TabCustomizeToolbars ' 4 ------------------
161 warnlog "couldn't switch to tabpage 'Toolbars'"
163 Kontext "TabCustomizeToolbars"
164 if TabCustomizeToolbars.exists(5) then
165 Call DialogTest ( TabCustomizeToolbars )
166 Menu.typeKeys("<down>")
167 ToolbarContents.typeKeys("<down>")
168 SaveIn.typeKeys("<down>")
169 '/// click button 'new' ///'
172 '/// Dialog 'Name' comes up ///'
174 Call DialogTest ( NewToolbar )
175 ToolbarName.typeKeys("<down>")
176 SaveIn.typeKeys("<down>")
177 '/// Cancel dialog 'Name' ///'
181 Kontext "TabCustomizeToolbars"
182 '/// Click Button 'Add Commands...' ///'
183 SaveIn.typeKeys("<up>")
185 '/// Dialog 'Add Commands' comes up ///'
186 Kontext "ScriptSelector"
187 call DialogTest (ScriptSelector)
188 LibraryTreeList.typeKeys("<down>")
189 ScriptList.typeKeys("<down>")
190 '/// Close Dialog 'Add Commands' ///'
191 ScriptSelector.cancel
194 Kontext "TabCustomizeToolbars"
195 '/// Click button 'Command' ///'
197 '/// Select the firste entry 'Rename' ///'
199 '/// Dialog 'Name' comes up ///'
200 Kontext "CustomizeToolbarsReName"
201 if NOT CustomizeToolbarsReName.exists(2) then
202 Kontext "TabCustomizeToolbars"
203 ToolbarContents.typeKeys("<down>")
205 CustomizeToolbarsReName.cancel()
208 Kontext "TabCustomizeToolbars"
211 Kontext "CustomizeToolbarsReName"
212 call DialogTest (CustomizeToolbarsReName)
213 Eingabefeld.typeKeys ("A")
214 '/// Cancel Dialog 'Name' ///'
215 CustomizeToolbarsReName.close
218 Kontext "TabCustomizeToolbars"
219 '/// Click button 'Command' ///'
221 '/// Select the fifth entry 'Change Icon' ///'
223 '/// Dialog 'Change Icon' comes up ///'
225 call DialogTest (ChangeIcon)
226 '/// Click button 'Import...' on dialog Change 'Icon' ///'
228 '/// Dialog 'Open' comes up ///'
229 Kontext "GeneralFileDialog"
230 '/// Cancel dialog 'Open' ///'
231 GeneralFileDialog.cancel
232 '/// Cancel Dialog 'Change Icon' ///'
236 Kontext "TabCustomizeToolbars"
237 '/// click button 'downwards' ///'
239 '/// click button 'upwards' ///'
241 '/// click button 'Reset' ///'
244 if Messagebox.exists (5) then
245 if Messagebox.GetRT = 304 then
246 printlog "Messagebox: Menu configuration will be reset...: '"+Messagebox.getText+"'"
247 call DialogTest(Messagebox, 50)
253 Kontext "TabCustomizeToolbars"
254 '/// On Tab Page 'Customize Menus' click on Button 'Toolbar' ///'
260 if Messagebox.exists (5) then
261 if Messagebox.GetRT = 304 then
262 printlog "Messagebox: Toolbar configuration will be reset...: '"+Messagebox.getText+"'"
263 call DialogTest(Messagebox, 50)
269 '/// switch to tabpage 'Events' ///'
271 Messagebox.SetPage TabCustomizeEvents ' 5 ------------------
273 warnlog "couldn't switch to tabpage 'Events'"
275 Kontext "TabCustomizeEvents"
276 if TabCustomizeEvents.exists(5) then
277 Call DialogTest ( TabCustomizeEvents )
278 SaveIn.typeKeys("<down>")
279 EventListbox.typeKeys("<down>")
281 '/// click button 'Assign Macro' ///'
284 ' If Java is not [correctly] installed a messagebox will be shown
286 if Messagebox.Exists(2) then
287 for iCountMsgBox = 1 to 20
289 if MessageBox.Exists(2) then
290 if MessageBox.GetRT = 304 then
291 if iCountMsgBox = 1 then
292 warnlog "Java runtime is defective. Detection failed!"
294 '.getRT is need because otherwise the operation will be done
295 'on the opened tab control behind the message box
296 QAErrorLog "Dialog (" & iCountMsgBox & "): " & Messagebox.GetText
297 if iCountMsgBox > 15 then
298 warnlog "Now the message box occours " & iCountMsgBox & " instead of 15 times!"
307 '/// Dialog 'MacroSelector' comes up ///'
308 Kontext "ScriptSelector"
309 call DialogTest (ScriptSelector)
310 LibraryTreeList.typeKeys("<down>")
311 ScriptList.typeKeys("<down>")
312 '/// Cancel Dialog 'MacroSelector' ///'
313 ScriptSelector.cancel
314 '/// click button 'Remove Macro' ///'
315 Kontext "TabCustomizeEvents"
318 '/// Press Button 'Reset' ///'
320 '/// cancel dialog 'Customize' ///'
321 Kontext "TabCustomizeEvents"
322 TabCustomizeEvents.cancel
325 '/// close application ///'