jl165 merging heads
[LibreOffice.git] / testautomation / framework / required / includes / basic_macroassignment.inc
blob9b29b50810cc33cc76e543fc075c81b9edafcc6e
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 : Update-Test for some dialogs in Basic-IDE
32 '\******************************************************************************
34 testcase tUpdtMacroAssignment
36     printlog( "Update test all dialogs from plain document via assign macro dialog to scriptselector" )
37     
38     const TABPAGE_EVENTS = 2
39     const BASIC_MODULE = "tUpdtMacroAssignment"
40     const DEFAULT_DIALOG_TIMEOUT = 1
41     const RC_TIMEOUT = -1
43     printlog( "New document" )
44     hCreateDocument()
45     
46     printlog( "Create a new BASIC-module for this document" )
47     hInitBasicIDE( BASIC_MODULE )
48     
49     printlog( "Create a new BASIC-dialog" )
50     if ( hNewDialog() ) then
52         printlog( "Select the Dialog-Pane from the DialogWindow" )
53         if ( hSelectDialogPane() ) then
55             printlog( "Show ToolsCollectionBar" )
56             if ( hShowMacroControls() ) then
58                 printlog( "Open the Property-Browser" )
59                 if ( hOpenPropertyBrowser() ) then
61                     kontext "TabGeneralControl"
62                     call dialogtest( TabGeneralControl )
64                     printlog( "Switch to events-tab" )
65                     if ( hSetPBTabPage( TABPAGE_EVENTS ) ) then
67                         printlog( "Current Dialog: Property-Browser / Events-Page" )
68                         call dialogtest( TabEventsControl )
70                         Kontext "TabEventsControl"
71                         printlog( "Click the button for the FocusGained-Event" )
72                         if ( hClickButton( PBFocusGained ) <> RC_TIMEOUT ) then
74                             Kontext "AssignMacro"
75                             printlog( "Current Dialog: Assign Macro" )
76                             if ( AssignMacro.exists( DEFAULT_DIALOG_TIMEOUT ) ) then
78                                 call dialogtest( AssignMacro )
80                                 printlog( "Click the Assign-Button on the Macro-Assignment-Dialog to open Script Selector" )
81                                 if ( hClickButton( AssignButton ) <> RC_TIMEOUT ) then
83                                     Kontext "ScriptSelector"
84                                     if ( ScriptSelector.exists( DEFAULT_DIALOG_TIMEOUT ) ) then
86                                         call dialogtest( ScriptSelector )
88                                         printlog( "Close Script Selector" )
89                                         hCloseDialog( ScriptSelector, "cancel" )
91                                         printlog( "Close all remaining dialogs and documents" )
92                                         Kontext "AssignMacro"
93                                         hCloseDialog( AssignMacro, "cancel" )
94                                         hClosePropertyBrowser()
95                                         hCloseBasicIDE()
96                                         hDestroyDocument()
97                                     else
98                                         warnlog( "Failed to open/access <ScriptSelector>" )
99                                     endif
100                                 else
101                                     warnlog( "Assign-button is not enabled" )
102                                 endif
103                             else
104                                 warnlog( "Failed to open/access <AssignMacro> dialog" )
105                             endif
106                         else
107                             warnlog( "#i64196# - Events missing on properties tab-page" )
108                         endif
109                     else
110                         warnlog( "Failed to switch tabpage to Tab-Events" )
111                     endif
112                 else
113                     warnlog( "Property-Browser is not open, skipping further testing" )
114                 endif
115             else
116                 warnlog( "ToolsCollectionBar is not open" )
117             endif
118         else
119             warnlog( "Selecting failed: ToolsCollectionBar is in the way." )
120         endif
121     else
122         warnlog( "Failed to create a new BASIC-dialog" )
123     endif
125 endcase