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: basic_spectemplate.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $
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 : Load the spec template via http and enable macros
38 '\******************************************************************************
40 testcase tBasicSpecTemplate
42 qaerrorlog( "#i89554# Macro dialog not displayed / document not loaded" )
45 '///<h1>Load the spec template via http and enable macros</h1>
46 '///<i>Required: Macro Security Level must be Default (Medium)</i>
49 const cFile = "http://specs.openoffice.org/collaterals/template/2.0/OpenOffice-org-Specification-Template.ott"
54 dim cWorkFile as string
56 cWorkFile = hGetWorkPath() & "SpecTemplate" & hGetSuffix( "current" )
59 '///+<li>Retrieve the http-proxy from private environment</li>
60 hGetPrivateHttpServer( cProxy, cPort )
62 '///+<li>Set HTTP-Proxy to access a website outside SWAN (not for OOo)</li>
63 printlog( "Init: Set proxy (requires private environment to be set)" )
64 hSetProxies( cProxy, cPort, "", "", "" )
65 if ( WaitSlot() <> WSFinished ) then
66 warnlog( "Slot not finished after 1000 msec." )
68 printlog( "Slot free in less than 1000 msec." )
71 '///+<li>Open the file (using slot)</li>
72 printlog( "FileOpen" )
75 '///+<li>Intercept a possible "General Internet error"</li>
77 if ( Active.exists( 2 ) ) then
78 warnlog( "Unexpected errormessage: " & active.getText()
82 if ( OeffnenDlg.exists( 1 ) ) then
83 printlog( "Recovering - closing File Open dialog" )
90 '///+<li>Handle security warning (allow execution of macros)</li>
91 printlog( "Accept to execute macros" )
92 brc = hAllowMacroExecution()
94 warnlog( "Missing Macro execution dialog. Please check the file/security settings" )
97 '///+<li>Wait until the document is loaded</li>
98 '///+<li>Check for possible warning dialog: Could not resolve host -> Fatal error</li>
100 if ( Active.exists( 5 ) ) then
101 warnlog( "Fatal: Unexpected active: " & Active.getText() )
105 if ( OeffnenDlg.exists( 2 ) ) then
111 '///+<li>Go to the end of the document, write some text</li>
112 printlog( "Change the document")
113 kontext "DocumentWriter"
114 DocumentWriter.typeKeys( "<MOD1 END>" )
115 DocumentWriter.typeKeys( "Changing the document" )
117 '///+<li>Disable the help item from the Spectemplate-menu</li>
118 printlog( "Disable Help Entry from Spec-Template Menu")
124 '///+<li>Save the file</li>
125 hFileSaveAsKill( cWorkFile )
127 '///+<li>Close the document</li>
130 '///+<li>Reload the file</li>
131 hFileOpen( cWorkFile )
133 '///+<li>Allow Macro execution</li>
134 hAllowMacroExecution()
136 '///+<li>Close the document</li>
137 printlog( "Cleanup: Close the document" )
140 '///+<li>Reset proxies (delete all proxies, if changed)</li>
141 printlog( "Cleanup: Delete proxy settings" )
142 hSetProxies( "", "", "", "", "" )
144 '///+<li>Remove the workfile</li>
145 hDeleteFile( cWorkFile )