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: id_006.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-08-28 11:43:25 $
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 : wolfram.garten@sun.com
36 '* short description :
38 '***********************************************************************************
39 ' #1 tiToolsSpellchecking
40 ' #1 tiToolsSpellcheckingAutomatic
42 ' #1 tiToolsHyphenation
43 ' #1 tiToolsAutoCorrect
44 ' #1 tChineseTranslation
47 ' #1 tiToolsEyedropper
49 '\**********************************************************************************
52 testcase tiToolsSpellchecking
54 if not gOOO then ' Spellcheck doesn't work in OOo builds.
56 WaitSlot (2000) 'sleep 2
57 call hSetSpellHypLanguage
58 Call hTextrahmenErstellen ("Whaaaat", 10, 10, 30, 40)
61 WaitSlot (1000) 'sleep 1
63 if MessageBox.exists(2) then
64 qaerrorlog "Messagebox : " + MessageBox.gettext() + " appear."
65 qaerrorlog "Maybe no spellchecking for this languages is available."
68 Kontext "Rechtschreibung"
69 if Rechtschreibung.exists then
70 Call DialogTest ( Rechtschreibung )
73 warnlog " Spellcheck dialog didn't came up :-("
78 if Messagebox.exists (5) then
79 warnlog "Shouldn't be any messagebox after pressing close in spellchecker"
89 '--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
91 testcase tiToolsSpellcheckingAutomatic
93 ToolsSpellcheckAutoSpellcheck
94 Call hTextrahmenErstellen ("What", 10, 10, 30, 40)
96 ToolsSpellcheckAutoSpellcheck
100 '--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
102 testcase tiToolsThesaurus
103 if not gOOO then ' Thesaurus doesn't work in OOo builds.
105 dim sFileName as String
107 call hSetSpellHypLanguage
108 if (gApplication = "IMPRESS") then
109 sFileName = (ConvertPath (gTesttoolPath + "graphics\required\input\engtext.odp"))
111 sFileName = (ConvertPath (gTesttoolPath + "graphics\required\input\engtext.odg"))
113 if hFileExists ( sFileName ) = FALSE then
114 warnlog "The language-file was not found or accessible! The test ends."
117 Call hFileOpen (sFileName)
120 hTypeKeys "<TAB><RETURN>"
121 hTypeKeys "<END><SHIFT HOME>"
123 ' Call hTextrahmenErstellen ("SimpleTest" + "<Mod1 Shift left>", 10, 10, 30, 40)
127 Call DialogTest ( Thesaurus )
129 Kontext "SpracheAuswaehlen"
130 Call DialogTest ( SpracheAuswaehlen )
131 SpracheAuswaehlen.cancel
135 if Messagebox.exists (5) then
136 printlog "Messagebox: word not in thesaurus: '"+Messagebox.gettext+"'"
143 warnlog "Thesaurus didn't work :-("
151 '--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
153 testcase tiToolsHyphenation
155 ExtrasSilbentrennungDraw
156 WaitSlot (2000) 'sleep 2
157 ExtrasSilbentrennungDraw
161 testcase tiToolsAutoCorrect
162 dim iLanguage as integer ' for resetting the language
164 WaitSlot (1000) 'sleep 1
166 WaitSlot (2000) 'sleep 1
168 Messagebox.SetPage TabErsetzung
169 Kontext "TabErsetzung"
170 Call DialogTest ( TabErsetzung )
171 iLanguage = WelcheSprache.GetSelIndex
172 WelcheSprache.Select 1 ' select language with empty list
174 ErsetzenDurch.SetText "b"
182 printlog "ok was CRASH before" '#
184 WelcheSprache.select (iLanguage)
186 Messagebox.SetPage TabAusnahmen
187 Kontext "TabAusnahmen"
188 Call DialogTest ( TabAusnahmen )
189 Abkuerzungen.settext "Lala"
190 AbkuerzungenNeu.click
191 AbkuerzungenLoeschen.click
192 Woerter.settext "LALA"
193 WoerterAutomatisch.Check
195 WoerterLoeschen.click
196 WoerterAutomatisch.UnCheck
198 Messagebox.SetPage TabOptionen
199 Kontext "TabOptionen"
200 Call DialogTest ( TabOptionen )
202 Messagebox.SetPage TabTypografisch
203 Kontext "TabTypografisch" ' 1a
204 EinfacheErsetzen.Check
205 EinfachWortAnfang.Click
206 Kontext "Sonderzeichen"
207 Call DialogTest ( Sonderzeichen, 1 )
209 Kontext "TabTypografisch" ' 1b
210 EinfachWortEnde.Click
211 Kontext "Sonderzeichen"
212 Call DialogTest ( Sonderzeichen, 2 )
214 Kontext "TabTypografisch" ' 1s
215 EinfachStandard.Click
217 Kontext "TabTypografisch" ' 2a
218 DoppeltWortAnfang.Click
219 Kontext "Sonderzeichen"
220 Call DialogTest ( Sonderzeichen, 3 )
222 Kontext "TabTypografisch" ' 2b
223 DoppeltWortEnde.Click
224 Kontext "Sonderzeichen"
225 Call DialogTest ( Sonderzeichen, 4 )
227 Kontext "TabTypografisch" ' 2s
228 DoppeltStandard.Click
229 EinfacheErsetzen.UnCheck
230 TabTypografisch.cancel
234 '--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
236 testcase tChineseTranslation
238 qaerrorlog( "#i89634# - Chinese Translation dialog does not close" )
241 dim sFileName as string
242 dim bSavedAsianSupport as boolean
244 if uCase(gApplication) = "IMPRESS" then
245 sFileName = "graphics\required\input\tchinese.odp"
247 sFileName = "graphics\required\input\tchinese.odg"
251 WaitSlot (2000) 'sleep 1
252 bSavedAsianSupport = ActiveDeactivateAsianSupport(TRUE)
253 Call hFileOpen ( ConvertPath(gTesttoolPath + sFileName) )
255 Kontext "Standardbar"
256 if Bearbeiten.GetState(2) <> 1 then
257 Bearbeiten.Click '0 = not pressed. 1 = pressed.
259 if Active.Exists(1) then
262 warnlog "No messagebox after making document editable? - Test canceled here"
266 if uCase(gApplication) = "IMPRESS" then
267 Kontext "DocumentImpress"
269 Kontext "DocumentDraw"
273 hTypeKeys "<MOD1 HOME><RIGHT><RIGHT><SHIFT RIGHT RIGHT>"
274 ToolsChineseTranslation
275 WaitSlot (2000) 'sleep 1
276 kontext "ChineseTranslation"
277 Call DialogTest ( ChineseTranslation )
279 kontext "ChineseDictionary"
280 Call DialogTest ( ChineseDictionary )
282 kontext "ChineseTranslation"
283 ChineseTranslation.OK
285 if Messagebox.exists (5) then
286 printlog "Messagebox: "+Messagebox.gettext+"'"
289 ActiveDeactivateAsianSupport(bSavedAsianSupport)
293 '--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
295 testcase tiToolsMacro
297 WaitSlot (2000) 'sleep 2
300 Call DialogTest ( Makro )
304 Messagebox.SetPage TabModule
306 Call DialogTest ( TabModule )
309 Messagebox.SetPage TabBibliotheken
310 Kontext "TabBibliotheken"
311 Call DialogTest ( TabBibliotheken )
314 if Messagebox.Exists (5) then
315 if Messagebox.GetRT = 304 then
316 Warnlog Messagebox.Gettext
322 Kontext "TabBibliotheken"
324 kontext "NeueBibliothek"
325 sleep 1 'Bibliotheksname
326 NeueBibliothek.cancel
327 Kontext "TabBibliotheken"
328 TabBibliotheken.Close
335 '--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
337 testcase tiToolsGallery
340 WaitSlot (2000) 'sleep 1
345 '--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
347 testcase tiToolsEyedropper
351 Call DialogTest (Pipette)
357 '--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
359 testcase tiToolsOptions
362 WaitSlot (2000) 'sleep 1
363 kontext "OptionenDlg"
368 '--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------