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_int1.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $
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 : thorsten.bosbach@sun.com
36 '* short description : general options test (test for internet-group)
38 '\******************************************************************************
40 testcase tInternetProxy
42 Dim lsSave ( 9 ) as String
44 '///check if all settings are saved in configuration ( Internet / Proxy )
46 '///open a new document
48 '///open tools / options / internet / proxy
50 hToolsOptions ( "Internet", "Proxy" )
52 printlog " - save settings"
53 '///save all default settings
54 iSave = ProxyServer.GetSelIndex
55 ProxyServer.Select ( ProxyServer.GetItemCount )
56 if ProxyServer.GetItemCount > 2 then Warnlog "More than 2 entries are available for ProxyServer-Setting => Bug 88387"
58 lsSave (1) = HTTPProxy.GetText
59 lsSave (2) = HTTPPort.GetText
60 lsSave (3) = FTPProxy.GetText
61 lsSave (4) = FTPPort.GetText
62 lsSave (7) = NoProxy.GetText
65 printlog " - change settings"
66 '///+change all settings to dummy server
67 HTTPProxy.SetText "staroffice-news.germany.sun.com.test"
68 HTTPPort.SetText "1508"
69 FTPProxy.SetText "staroffice-news.germany.sun.com.test"
70 FTPPort.SetText "1509"
71 NoProxy.SetText "staroffice;stardivision;starstarstar"
73 '///+close options dialog with OK
74 Kontext "ExtrasOptionenDlg"
78 '///+close the document
81 '///exit and restart StarOffice
82 printlog " - exit/restart StarOffice"
86 printlog " - check changes"
87 '///+open tools / options / internet / proxy
89 hToolsOptions ( "Internet", "Proxy" )
91 if ProxyServer.GetSelIndex <> ProxyServer.GetItemCount then
92 Warnlog "Proxy Server => changes not saved ( should be the last entry )!"
93 ProxyServer.Select ( ProxyServer.GetItemCount )
96 if HTTPProxy.GetText <> "staroffice-news.germany.sun.com.test" then warnlog "HTTP Proxy => changes not saved!"
97 if FTPProxy.GetText <> "staroffice-news.germany.sun.com.test" then warnlog "FTP Proxy => changes not saved!"
98 if NoProxy.GetText <> "staroffice;stardivision;starstarstar" then warnlog "No Proxy => changes not saved!"
99 if HTTPPort.GetText <> "1508" then warnlog "HTTP Port => changes not saved!"
100 if FTPPort.GetText <> "1509" then warnlog "FTP Port => changes not saved!"
102 if gPlatgroup = "w95" then
103 printlog " - change settings ( only windows )"
106 Kontext "ExtrasOptionenDlg"
110 printlog " - check changes"
112 hToolsOptions ( "Internet", "Proxy" )
114 if ProxyServer.GetSelIndex <> 2 then Warnlog "Proxy Server => changes not saved ( should be the 2nd entry )!"
117 '///reset to default settings
118 printlog " - reset settings"
119 ProxyServer.Select(3) ' manual
120 HTTPProxy.SetText lsSave (1)
121 HTTPPort.SetText lsSave (2)
122 FTPProxy.SetText lsSave (3)
123 FTPPort.SetText lsSave (4)
124 NoProxy.SetText lsSave (7)
125 ProxyServer.Select iSave
127 '///+close options dialog with OK
128 Kontext "ExtrasOptionenDlg"
133 printlog " - check default"
134 '///+open tools / options / internet / proxy
136 hToolsOptions ( "Internet", "Proxy" )
137 if ProxyServer.GetSelIndex <> iSave then Warnlog "Proxy Server => changes not saved!"
138 if HTTPProxy.GetText <> lsSave (1) then warnlog "HTTP Proxy => changes not saved!"
139 if FTPProxy.GetText <> lsSave (3) then warnlog "FTP Proxy => changes not saved!"
140 if NoProxy.GetText <> lsSave (7) then warnlog "No Proxy => changes not saved!"
141 if FTPPort.GetText <> lsSave (4) AND FTPPort.GetText <> "0" then warnlog "FTP Port => changes not saved!"
142 if HTTPPort.GetText <> lsSave (2) AND HTTPPort.GetText <> "0" then warnlog "HTTP Port => changes not saved!"
144 '///+close options dialog with OK
145 Kontext "ExtrasOptionenDlg"
151 testcase tInternetSearch
152 Dim iSave, iInterim, i as Integer
153 Dim lbSave ( 3, 10 ) as boolean
154 Dim lsSave ( 6, 10 ) as String
156 '///check if all settings are saved in configuration ( Internet / Search )
158 '///open a new document
160 '///open tools / options / internet / search
162 hToolsOptions ( "Internet", "Search" )
165 printlog " - save settings"
166 iSave = SuchenIn.GetItemCount
168 Warnlog "Please change the index for this test, there are too many entries in the Search-List!"
174 lsSave (1, i) = DienstName.GetText
175 lsSave (2, i) = Praefix.GetText
176 lsSave (3, i) = Suffix.GetText
177 lsSave (4, i) = Trenner.GetText
178 lsSave (5, i) = Schreibstil.GetSelText
180 lbSave (1, i) = Und.IsChecked
181 lbSave (2, i) = Oder.IsChecked
182 lbSave (3, i) = Exakt.IsChecked
185 '///change settings and insert new entries
186 printlog " - change/insert settings"
189 DienstName.SetText "AAAA_TT_Changes_Name"
191 Praefix.SetText "TT_Changes_Prefix"
192 Suffix.SetText "TT_Changes_Suffix"
193 Trenner.SetText ";;;;"
199 '///+ insert an new entry named ( ZZZZ_TT_New_Name )
202 DienstName.SetText "ZZZZ_TT_New_Name"
204 Praefix.SetText "TT_New_Prefix"
205 Suffix.SetText "TT_New_Suffix"
206 Trenner.SetText ":::::"
210 '///+close options dialog with OK
211 Kontext "ExtrasOptionenDlg"
215 '///+close the document
218 '///exit and restart StarOffice
219 printlog " - exit/restart StarOffice"
222 '///check the changes
223 printlog " - check changes"
224 '///+open tools / options / internet / search
226 hToolsOptions ( "Internet", "Search" )
228 iInterim = SuchenIn.GetItemCount
230 Warnlog "No entrie in Search-List, entries are not saved! The test ends here! => BugID: 82922"
232 if iInterim <> ( iSave + 1 ) then
233 Warnlog "Not all entries in the Search-List are saved! => BugID: 82922"
237 SuchenIn.Select "AAAA_TT_Changes_Name"
238 if DienstName.GetText <> "AAAA_TT_Changes_Name" then Warnlog "AAAA_TT_Changes_Name : Name => changes not saved"
240 if Praefix.GetText <> "TT_Changes_Prefix" then Warnlog "AAAA_TT_Changes_Name : Prefix => changes not saved!"
241 if Suffix.GetText <> "TT_Changes_Suffix" then Warnlog "AAAA_TT_Changes_Name : Suffix => changes not saved!"
242 if Trenner.GetText <> ";;;;" then Warnlog "AAAA_TT_Changes_Name : Seperator => changes not saved!"
243 if Schreibstil.GetSelIndex <> 3 then Warnlog "AAAA_TT_Changes_Name : Case match => changes not saved! BugID:86660"
245 if i <> ( iSave + 1 ) then
247 if DienstName.GetText <> lsSave (1, i) then Warnlog lsSave (1, i) + " : Name => old entry not saved correctly!"
248 if Und.IsChecked <> lbSave (1, i) then Warnlog lsSave (1, i) + " : Und => old entry not saved correctly!"
249 if Oder.IsChecked <> lbSave (2, i) then Warnlog lsSave (1, i) + " : Oder => old entry not saved correctly!"
250 if Exakt.IsChecked <> lbSave (3, i) then Warnlog lsSave (1, i) + " : Exakt => old entry not saved correctly!"
251 if Praefix.GetText <> lsSave (2, i) then Warnlog lsSave (1, i) + " : Prefix => old entry not saved correctly!"
252 if Suffix.GetText <> lsSave (3, i) then Warnlog lsSave (1, i) + " : Suffix => old entry not saved correctly!"
253 if Trenner.GetText <> lsSave (4, i) then Warnlog lsSave (1, i) + " : Seperator => old entry not saved correctly!"
254 if Schreibstil.GetSelText <> lsSave (5, i) then Warnlog lsSave (1, i) + " : Case match => old entry not saved correctly!"
256 SuchenIn.Select "ZZZZ_TT_New_Name"
257 if DienstName.GetText <> "ZZZZ_TT_New_Name" then Warnlog "ZZZZ_TT_New_Name : Name => new entry not saved correctly!"
259 if Praefix.GetText <> "TT_New_Prefix" then Warnlog "ZZZZ_TT_New_Name : Prefix => new entry not saved correctly!"
260 if Suffix.GetText <> "TT_New_Suffix" then Warnlog "ZZZZ_TT_New_Name : Suffix => new entry not saved correctly!"
261 if Trenner.GetText <> ":::::" then Warnlog "ZZZZ_TT_New_Name : Seperator => new entry not saved correctly!"
262 if Schreibstil.GetSelIndex <> 2 then Warnlog "ZZZZ_TT_New_Name : Case match => new entry not saved correctly! BugID:86660"
268 '///reset all settings
269 printlog " - reset settings"
270 SuchenIn.Select "AAAA_TT_Changes_Name"
271 DienstName.SetText lsSave (1, 1)
272 if lbSave(1, 1) = TRUE then Und.Check
273 if lbSave(2, 1) = TRUE then Oder.Check
274 if lbSave(3, 1) = TRUE then Exakt.Check
275 Praefix.SetText lsSave (2, 1)
276 Suffix.SetText lsSave (3, 1)
277 Trenner.SetText lsSave (4, 1)
278 Schreibstil.Select lsSave (5, 1)
283 SuchenIn.Select "ZZZZ_TT_New_Name"
288 '///+close options dialog with OK
289 Kontext "ExtrasOptionenDlg"
294 printlog " - check the reset"
295 '///+open tools / options / internet / search
297 hToolsOptions ( "Internet", "Search" )
299 iInterim = SuchenIn.GetItemCount
300 if iInterim <> iSave then
301 Warnlog "The default can't be reached!"
304 SuchenIn.Select lsSave (1, i)
305 if DienstName.GetText <> lsSave (1, i) then Warnlog lsSave (1, i) + " : Name => old entry not saved correctly!"
306 if Und.IsChecked <> lbSave (1, i) then Warnlog lsSave (1, i) + " : Und => old entry not saved correctly!"
307 if Oder.IsChecked <> lbSave (2, i) then Warnlog lsSave (1, i) + " : Oder => old entry not saved correctly!"
308 if Exakt.IsChecked <> lbSave (3, i) then Warnlog lsSave (1, i) + " : Exakt => old entry not saved correctly!"
309 if Praefix.GetText <> lsSave (2, i) then Warnlog lsSave (1, i) + " : Prefix => old entry not saved correctly!"
310 if Suffix.GetText <> lsSave (3, i) then Warnlog lsSave (1, i) + " : Suffix => old entry not saved correctly!"
311 if Trenner.GetText <> lsSave (4, i) then Warnlog lsSave (1, i) + " : Seperator => old entry not saved correctly!"
312 if Schreibstil.GetSelText <> lsSave (5, i) then Warnlog lsSave (1, i) + " : Case match => old entry not saved correctly!"
317 '///+close options dialog with OK
318 Kontext "ExtrasOptionenDlg"