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: security_dialogs.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:19:03 $
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 : Security dialogs in Tools/Options
38 '\******************************************************************************
40 testcase tUpdtSecurityDialogs
42 '///<h1>Security dialogs in Tools/Options</h1>
44 '///<u><pre>Synopsis</pre></u>Quick ressource test for the security dialogs
45 '///+ below Tools/Options -> OpenOffice.org/Security<br>
46 '///<u><pre>Specification document</pre></u><a href="http://specs.openoffice.org/appwide/security/Electronic_Signatures_and_Security.sxw">
47 '///+ Electronic signatures and security</a><br>
48 '///<u><pre>Files used</pre></u>None<br>
49 '///<u><pre>Test case specification</pre></u>
52 const C_PASSWORD = "huhuhu"
54 '///+<li>Open Tools/Options</li>
55 printlog( "Tools/Options" )
58 '///+<li>Select the OpenOffice.org/Security page</li>
59 hToolsOptions( "StarOffice", "Security" )
62 call DialogTest( TabSecurity )
64 '///+<li>Click the "Options..." button<br>
65 '///+ The "Options" dialog should open</li>
68 kontext "TabSecurityOptionsAndWarnings"
69 if ( TabSecurityOptionsAndWarnings.exists( 1 ) ) then
70 call DialogTest( TabSecurityOptionsAndWarnings )
71 printlog( "Options dialog is present" )
73 '///+<li>Cancel Options dialog</li>
74 TabSecurityOptionsAndWarnings.cancel()
76 warnlog( "options dialog is missing" )
79 '///+<li>Check "Persistently save passwords..."<br>
81 if ( PersistentlySavePasswords.isChecked() ) then
82 qaerrorlog( "Security settings already changed by another test" )
84 PersistentlySavePasswords.unCheck()
86 if( active.exists( 1 ) ) then
89 warnlog( "failed to reset password configuration, aborting" )
96 PersistentlySavePasswords.check()
98 '///+ The "Define Master Password" dialog should appear</li>
99 kontext "MasterPasswordDefine"
100 if ( MasterPasswordDefine.exists( 1 ) ) then
101 printlog( "Define Master password dialog is open" )
102 call DialogTest( MasterPasswordDefine )
104 '///+<li>Set password "huhuhu"</li>
105 Password1.setText( C_PASSWORD )
107 '///+<li>Confirm password</li>
108 Password2.setText( C_PASSWORD )
110 '///+<li>Click "OK"</li>
111 MasterPasswordDefine.ok()
114 warnlog( "Define Master Password dialog is missing" )
117 '///+<li>Click "Master Password..."<br>
118 kontext "TabSecurity"
119 MasterPassword.click()
121 '///+ The "Enter Password" dialog should appear</li>
122 kontext "MasterPasswordEnter"
123 if ( MasterPasswordEnter.exists( 1 ) ) then
124 printlog( "Enter master Password dialog is open" )
125 call DialogTest( MasterPasswordEnter )
127 '///+<li>Click "Cancel"</li>
128 MasterPasswordEnter.cancel()
130 warnlog( "Enter Password dialog is missing" )
134 '///+<li>Click "Show Passwords..."<br>
135 kontext "TabSecurity"
136 ShowPasswords.click()
138 '///+ The "Enter Master Password" dialog should open</li>
139 kontext "MasterPasswordEnter"
140 if ( MasterPasswordEnter.exists( 1 ) ) then
141 printlog( "Enter password dialog is open" )
143 '///+<li>Enter "huhuhu"</li>
144 Password.setText( C_PASSWORD )
146 '///+<li>Click "OK"<br>
147 MasterPasswordEnter.ok()
149 '///+ The "Stored Web Connection Information" dialog should open</li>
150 kontext "StoredPasswordsDialog"
151 if ( StoredPasswordsDialog.exists( 1 ) ) then
152 printlog( "Stored passwords dialog is open" )
153 call DialogTest( StoredPasswordsDialog )
155 '///+<li>Close the "Stored Web Connection Information" dialog</li>
156 StoredPasswordsDialog.close()
158 warnlog( "Stored passwords dialog is missing" )
161 warnlog( "Enter Master Password dialog is missing" )
164 '///+<li>Click "Macro Security..."<br>
165 kontext "TabSecurity"
166 MacroSecurity.click()
168 '///+ The Macro Security/Security Level page should open</li>
169 kontext "TabSecurityLevel"
170 if ( TabSecurityLevel.exists( 1 ) and TabSecurityLevel.isVisible() ) then
171 printlog( "Security Level tabpage is open." )
173 '///+<li>Switch to the "Trusted Sources" tabpage</li>
175 active.setPage TabTrustedSources
177 kontext "TabTrustedSources"
178 if ( TabTrustedSources.isVisible() ) then
179 printlog( "Trusted Sources tabpage is visible" )
181 '///+<li>Click "Add..."</li>
184 '///+<li>Cancel "Select Path" dialog</li>
186 if ( OeffnenDlg.exists( 1 ) ) then
187 printlog( "File open dialog is visible" )
188 call DialogTest( OeffnenDlg )
191 '///+<li>Cancel "Macro Security" dialog</li>
192 kontext "TabTrustedSources"
193 if ( TabTrustedSources.exists() ) then
194 TabTrustedSources.cancel()
196 warnlog( "Trusted Sources tabpage not available" )
199 warnlog( "Trusted Paths selector not visible" )
202 warnlog( "Trusted Sources tabpage is not available" )
205 warnlog( "The Macro Security settings dialog is not open" )
208 '///+<li><i><b>Todo: "Protect..." button</b></i></li>
210 '///+<li>Uncheck "Persistently save passwords..."</li>
211 Kontext "TabSecurity"
212 PersistentlySavePasswords.unCheck()
214 '///+<li>Confirm to delete all stored passwords</li>
216 if( active.exists( 1 ) ) then
217 printlog( "Passwords deletion warning is displayed. Good" )
218 call DialogTest( active )
221 warnlog( "Password deletion warning is missing" )
225 '///+<li>Cancel "Tools/Options" dialog</li>
226 kontext "OptionenDlg"