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: Xforms01.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 07:43:45 $
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 : marc.neumann@sun.com
36 '* short description : XForms Main Test include file
38 '************************************************************************
42 ' #1 tDataNavigatorSubmission
43 ' #1 tDataNavigatorBinding
44 ' #1 tDataNavigatorInstance
45 ' #1 tDataNavigatorInstanceData
46 ' #1 tDataNavigatorModel
48 '\***********************************************************************************
52 printlog "------------------ Xforms01.inc ---------------------"
54 call tDataNavigatorModel
55 call tDataNavigatorInstance
56 call tDataNavigatorInstanceData
57 call tDataNavigatorSubmission
58 call tDataNavigatorBinding
62 '-------------------------------------------------------------------------
63 testcase tDataNavigatorModel
65 '/// open new XML Form
66 printlog "open new XML Form"
68 FileOpen "FileName", "private:factory/swriter?slot=21053" , "FrameName", "_default" , "SynchronMode" ,True
72 call hToolbarSelect("FormDesignTools",true)
74 '/// open the datanavigator
75 printlog "open the datanavigator"
77 Kontext "XFormsDataNavigator"
78 if ( not XFormsDataNavigator.exists(2) ) then
79 Kontext "FormDesignTools"
80 XFormsDataNavigator.Click
85 Kontext "XFormsDataNavigator"
86 'call DialogTest(XFormsDataNavigator)
87 XFormsDataNavigator.TypeKeys "<space>" , true
88 '/// open the add model dialog
89 printlog "open the add model dialog"
97 Kontext "XFormAddModel"
98 call DialogTest(XFormAddModel)
99 '/// add Model2 as new name
100 printlog "add Model2 as new name"
101 ModelName.setText "Model2"
106 Kontext "XFormsDataNavigator"
107 if ( Models.getSelText <> "Model2" ) then
108 warnlog "The new Model is not added"
110 '/// rename the Model
111 printlog "rename the Model"
116 Kontext "XFormAddModel"
117 ModelName.setText "Model3"
120 Kontext "XFormsDataNavigator"
121 if ( Models.getSelText <> "Model3" ) then
122 warnlog "The Model is not renamed"
125 '/// close the xform data navigator
126 printlog "close the xform data navigator"
128 Kontext "XFormsDataNavigator"
129 XFormsDataNavigator.Close
132 '/// close the document
133 printlog "close the document"
138 '-------------------------------------------------------------------------
139 testcase tDataNavigatorInstance
141 '/// open new XML Form
142 printlog "open new XML Form"
144 FileOpen "FileName", "private:factory/swriter?slot=21053" , "FrameName", "_default" , "SynchronMode" ,True
148 call hToolbarSelect("FormDesignTools",true)
149 '/// open the datanavigator
150 printlog "open the datanavigator"
151 Kontext "XFormsDataNavigator"
152 if ( not XFormsDataNavigator.exists(2) ) then
153 Kontext "FormDesignTools"
154 XFormsDataNavigator.Click
159 '/// add a new instance
160 printlog "add a new instance"
161 Kontext "XFormsDataNavigator"
162 XFormsDataNavigator.TypeKeys "<space>" ,true
166 Kontext "XFormAddInstance"
167 call DialogTest(XFormAddInstance)
168 InstanceName.setText "Instance2"
171 '/// open the browse dialog and close it again
172 printlog "open the browse dialog and close it again"
175 Kontext "GeneralFileDialog"
176 GeneralFileDialog.Cancel
178 Kontext "XFormAddInstance"
182 '/// rename new instance
183 printlog "rename new instance"
184 Kontext "XFormsDataNavigator"
185 XFormsDataNavigator.TypeKeys "<space>" ,true
192 Kontext "XFormAddInstance"
193 InstanceName.setText "Instance3"
197 'add a second instance due issue
198 Kontext "XFormsDataNavigator"
199 XFormsDataNavigator.TypeKeys "<space>" ,true
205 Kontext "XFormAddInstance"
206 InstanceName.setText "Instance4"
212 Kontext "XFormsDataNavigator"
213 XFormsDataNavigator.TypeKeys "<space>" ,true
223 '/// close the xform data navigator
224 printlog "close the xform data navigator"
226 Kontext "XFormsDataNavigator"
227 XFormsDataNavigator.Close
230 '/// close th document
231 printlog "close th document"
236 '-------------------------------------------------------------------------
237 testcase tDataNavigatorInstanceData
239 '/// open new XML Form
240 printlog "open new XML Form"
242 FileOpen "FileName", "private:factory/swriter?slot=21053" , "FrameName", "_default", "SynchronMode" ,True
246 call hToolbarSelect("FormDesignTools",true)
250 '/// open the datanavigator
251 printlog "open the datanavigator"
252 Kontext "XFormsDataNavigator"
253 if ( not XFormsDataNavigator.exists(2) ) then
254 Kontext "FormDesignTools"
255 XFormsDataNavigator.Click
258 '/// select the submission tabpage
259 printlog "select the submission tabpage"
261 Kontext "XFormsDataNavigator"
262 call DialogTest(XFormsDataNavigator)
263 while ( XFormsDataNavigatorTabControl.getPageID() <> 12 )
264 XFormsDataNavigatorTabControl.TypeKeys("<RIGHT>")
267 '/// click the add element icon
268 printlog "click the add element icon"
270 Kontext "XFormToolbar"
273 Kontext "XFormAddItemDLG"
274 call DialogTest(XFormAddItemDLG)
275 ElementName.setText "element1"
276 if iSprache = 82 then
277 printlog "because of issue i49557 there are only 12 items in a korean version."
278 if ( DataType.getItemCount <> 12) then
279 warnlog "there are not 12 data types in the listbox there are " + DataType.getItemCount + ". See issue i49557."
282 if ( DataType.getItemCount <> 13) then
283 warnlog "there are not 13 data types in the listbox there are " + DataType.getItemCount + ". See issue i49557."
288 Kontext "AddConditionDLG"
289 AddConditionDLG.Close
290 Kontext "XFormAddItemDLG"
293 Kontext "AddConditionDLG"
294 AddConditionDLG.Close
295 Kontext "XFormAddItemDLG"
298 Kontext "AddConditionDLG"
299 AddConditionDLG.Close
300 Kontext "XFormAddItemDLG"
303 Kontext "AddConditionDLG"
304 AddConditionDLG.Close
305 Kontext "XFormAddItemDLG"
308 Kontext "AddConditionDLG"
309 AddConditionDLG.Close
310 Kontext "XFormAddItemDLG"
313 '/// close the xform data navigator
314 printlog "close the xform data navigator"
316 Kontext "XFormsDataNavigator"
317 XFormsDataNavigator.Close
320 '/// close the document
321 printlog "close the document"
326 '-------------------------------------------------------------------------
327 testcase tDataNavigatorSubmission
329 '/// nopen ew XML Form
330 printlog "nopen ew XML Form"
332 FileOpen "FileName", "private:factory/swriter?slot=21053" , "FrameName", "_default", "SynchronMode" ,True
336 call hToolbarSelect("FormDesignTools",true)
340 '/// open the datanavigator
341 printlog "open the datanavigator"
342 Kontext "XFormsDataNavigator"
343 if ( not XFormsDataNavigator.exists(2) ) then
344 Kontext "FormDesignTools"
345 XFormsDataNavigator.Click
349 '/// select the submission tabpage
350 printlog "select the submission tabpage"
352 Kontext "XFormsDataNavigator"
353 call DialogTest(XFormsDataNavigator)
354 while ( XFormsDataNavigatorTabControl.getPageID() <> 10 )
355 XFormsDataNavigatorTabControl.TypeKeys("<RIGHT>")
358 '/// click the add submission icon
359 printlog "click the add submission icon"
361 Kontext "XFormToolbar"
364 Kontext "XFormAddSubmission"
365 call DialogTest(XFormAddSubmission)
367 'i35171 crash when click
368 'SubmitBindingExpressionBtn.Click
370 '/// close the add submission dialog
371 printlog "close the add submission dialog"
373 XFormAddSubmission.Close
377 '/// close the xform data navigator
378 printlog "close the xform data navigator"
380 Kontext "XFormsDataNavigator"
381 XFormsDataNavigator.Close
384 '/// close th document
385 printlog "close th document"
390 '-------------------------------------------------------------------------
391 testcase tDataNavigatorBinding
393 '/// open new XML Form
394 printlog "open new XML Form"
396 FileOpen "FileName", "private:factory/swriter?slot=21053" , "FrameName", "_default", "SynchronMode" ,True
400 call hToolbarSelect("FormDesignTools",true)
404 '/// open the datanavigator
405 printlog "open the datanavigator"
406 Kontext "XFormsDataNavigator"
407 if ( not XFormsDataNavigator.exists(2) ) then
408 Kontext "FormDesignTools"
409 XFormsDataNavigator.Click
414 '/// select the binding tabpage
415 printlog "select the binding tabpage"
417 Kontext "XFormsDataNavigator"
418 call DialogTest(XFormsDataNavigator)
419 while ( XFormsDataNavigatorTabControl.getPageID() <> 11 )
420 XFormsDataNavigatorTabControl.TypeKeys("<RIGHT>")
423 '/// click the add binding icon
424 printlog "click the add binding icon"
426 Kontext "XFormToolbar"
429 Kontext "XFormAddItemDLG"
430 call DialogTest(XFormAddItemDLG)
432 '/// close the add binding dialog
433 printlog "close the add binding dialog"
435 XFormAddItemDLG.Close
439 '/// close the xform data navigator
440 printlog "close the xform data navigator"
442 Kontext "XFormsDataNavigator"
443 XFormsDataNavigator.Close
446 '/// close th document
447 printlog "close th document"
452 '-------------------------------------------------------------------------
454 testcase tPropertyBrowser
458 FileOpen "FileName", "private:factory/swriter?slot=21053" , "FrameName", "_default", "SynchronMode" ,True
462 call hToolbarSelect("FormControls",true)
464 Kontext "FormControls"
467 '/// insert a text box
468 printlog "insert a text box"
469 call hDrawingWithSelection ( 40, 40, 50, 50 )
471 Kontext "FormControls"
472 ControlProperties.Click
475 Kontext "ControlPropertiesTabControl"
476 ControlPropertiesTabControl.setPage TabDataControl
477 Kontext "TabDataControl"
478 XFormDataModel.select 1
479 TabDataControl.TypeKeys "<RETURN>", true
481 XFormBindExpressionName.setText("testtool")
482 TabDataControl.TypeKeys "<RETURN>", true
484 Kontext "ControlPropertiesDialog"
485 ControlPropertiesDialog.Close