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: options.inc,v $
13 '* last change: $Author: jsk $ $Date: 2008-06-19 09:02:10 $
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 : joerg.skottke@sun.com
36 '* short description : Options for extensions
38 '\******************************************************************************
40 testcase tExtensionOptions1
42 '///<h3>Options for extensions</h3>
45 const EXTENSION_NAME = "leaf1.oxt"
46 const OPTIONS_ITEM = "Writer leaf1 en-US"
49 const ITEM_POS_2_ASIAN = 38
51 dim cExtensionName as string
53 dim cExtensionPath as string
54 cExtensionPath = gTesttoolPath & "extensions\optional\input\options\"
56 dim cExtensionFile as string
57 cExtensionFile = convertpath( cExtensionPath & EXTENSION_NAME )
62 '///+<li>Create one single writer document, the node will be merged into it</li>
63 do while ( getDocumentCount > 0 )
66 gApplication = "WRITER"
68 kontext "DocumentWriter"
69 DocumentWriter.typeKeys( "tExtensionOptions1" )
72 '///+<li>Open the Extension Manager, click Add</li>
73 '///+<li>Load the sample extension "leaf1.oxt"</li>
74 '///+<li>Close the Extension Manager</li>
75 printlog( "Add sample extension" )
76 hExtensionAddGUI( cExtensionFile, "verbose,InstallForUser" )
78 '///+<li>Reopen the Extension Manager</li>
79 printlog( "Reopen the Extension Manager" )
81 kontext "PackageManager"
83 '///+<li>Select the extension by name</li>
84 printlog( "Move from the top node to the sample extension" )
85 BrowsePackages.select( EXTENSION_NAME )
87 '///+<li>Test some control states for leaf1.oxt node</li>
88 printlog( "Verify control states" )
90 '///+<li>Add... (enabled)</li>
91 if ( not Add.isEnabled() ) then
92 warnlog( "Add button should be enabled" )
95 '///+<li>Remove (enabled)</li>
96 if ( not Remove.isEnabled() ) then
97 warnlog( "Remove button should be enabled" )
100 '///+<li>Enable (hidden)</li>
101 if ( Enable.exists() ) then
102 warnlog( "Enable button should be hidden" )
105 '///+<li>Disable (enabled)</li>
106 if ( not Disable.isEnabled() ) then
107 warnlog( "Disable button should be enabled" )
110 '///+<li>Updates... (enabled)</li>
111 if ( not Updates.isEnabled() ) then
112 warnlog( "Updates button should be enabled" )
115 '///+<li>Options... (enabled)</li>
116 if ( not Options.isEnabled() ) then
117 warnlog( "Options button should be enabled" )
121 '///+<li>Click on the Options... button</li>
122 printlog( "Open Options dialog from Extension Manager" )
123 kontext "PackageManager"
124 if ( options.exists() ) then
127 '///+<li>Verify that the node "leaf1" is at pos 2 (absolute)</li>
128 printlog( "Verify presence and position of the leaf node" )
129 irc = hSelectOptionsItem( OPTIONS_ITEM , ITEM_POS_1 )
131 warnlog( "Test failed" )
134 '///+<li>Close Options dialog (cancel)
135 printlog( "Cancel Options dialog to get back to the Extension Manager" )
139 warnlog( "Options button does not exist/implemented in CWS jl61" )
142 '///+<li>Close the Extension Manager</li>
143 kontext "PackageManager"
144 printlog( "Close the Extension Manager" )
145 PackageManager.close()
147 '///+<li>Open Tools/Options</li>
148 printlog( "From the document open Tools/Options" )
151 printlog( "Verify presence and position of the leaf node" )
152 if ( bAsianLan ) then
153 irc = hSelectOptionsItem( OPTIONS_ITEM , ITEM_POS_2_ASIAN )
155 irc = hSelectOptionsItem( OPTIONS_ITEM , ITEM_POS_2 )
158 warnlog( "Node <" & OPTIONS_ITEM & "> was not found in Tools/Options" )
160 printlog( "Node is present. Good." )
163 Kontext "OptionenDlg"
164 printlog( "Cancel Tools/Options to get back to the document" )
167 '///+<li>Cleanup: Remove the sample extension</li>
168 printlog( "Remove sample extension" )
169 hExtensionRemoveGUI( EXTENSION_NAME )
171 '///+<li>Cleanup: Close document</li>
172 do while ( getDocumentCount > 0 )