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 : thorsten.bosbach@oracle.com
30 '* short description : gridcontrol
32 '\******************************************************************************
34 testcase tGridcontrolLoad
35 const MACRO_NAME = "Show"
36 const FILE_NAME = "framework/optional/input/gridcontrol.odt"
41 printlog( "Open the test document: " & FILE_NAME )
42 call hFileOpenLocally( gTestToolPath & FILE_NAME )
44 printlog "Start the macro, that performs the test"
45 hExecMacro( MACRO_NAME )
47 Kontext "GridControlDialog"
48 if GridControlDialog.exists(5) then
49 for i=1 to gridcontrolcontrol.getcolumncount
50 for a=1 to gridcontrolcontrol.getrowcount
51 printlog " " + i + ":"+a+": '" + gridcontrolcontrol.getitemtype (i,a) + "' '" + gridcontrolcontrol.getitemtext (i,a) + "'"
54 gridcontrolcontrol.select 5
57 if active.exists(5) then
58 printlog active.gettext
61 warnlog "No selection Event by .select"
64 Kontext "GridControlDialog"
65 gridcontrolcontrol.typeKeys("<down>")
68 if active.exists(5) then
69 printlog active.gettext
72 warnlog "No selection event by .typeKeys <down>"
74 Kontext "GridControlDialog"
75 gridcontrolcontrol.typeKeys("<up>")
77 if active.exists(5) then
78 printlog active.gettext
81 warnlog "No selection event by .typeKeys <up>"
84 Kontext "GridControlDialog"
85 GridControlDialog.close
87 warnlog "Gridcontrol Dialog did not come up after pressing button"
90 printlog( "Test exit, cleanup" )
92 hDeleteFile( gLastWorkFile )
96 testcase tTabcontrolLoad
97 const MACRO_NAME = "ShowTab"
98 const FILE_NAME = "framework/optional/input/gridcontrol.odt"
103 printlog( "Open the test document: " & FILE_NAME )
104 call hFileOpenLocally( gTestToolPath & FILE_NAME )
106 printlog "Start the macro, that performs the test"
107 hExecMacro( MACRO_NAME )
109 Kontext "tabcontroldialog"
110 if tabcontroldialog.exists(5) then
111 if tabcontainer.getPageCount = 2 then
112 printlog "There are 2 tabs"
114 warnlog "There are NOT 2 tabs, there are: " + tabcontainer.getpagecount
116 if tabcontainer.getPage = "tabcontrol_1" then
117 printlog "Default tab page is page 1"
119 warnlog "Default tab page is NOT page 1"
121 tabcontainer.setPage tabcontrol_2
123 if tabcontainer.getPage = "tabcontrol_2" then
124 printlog "Switching to tab 2 works"
126 warnlog "Switching to tab 2 failed"
128 tabcontainer.setPage tabcontrol_1
130 if tabcontainer.getPage = "tabcontrol_1" then
131 printlog "Switching to tab 1 works"
133 warnlog "Switching to tab 1 failed"
136 Kontext "tabcontroldialog"
137 tabcontroldialog.close
139 warnlog "tabcontrol Dialog did not come up after pressing button"
142 printlog( "Test exit, cleanup" )
144 hDeleteFile( gLastWorkFile )