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: w_hyphenation.inc,v $
13 '* last change: $Author: vg $ $Date: 2008-08-18 12:30:28 $
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 : helge.delfs@sun.com
36 '* short description : hyphenation functionality test
38 '************************************************************************
44 '\***********************************************************************
46 testcase tHyphenation_1
48 Dim testFile as String
49 Dim testWord as String
50 Dim firstPartOfTestWord as String
51 Dim secondPartOfTestWord as String
53 testFile = "tHyphenation.odt"
54 testWord = "following"
55 firstPartOfTestWord = "fol"
56 secondPartOfTestWord = "follow"
58 PrintLog "- Test Hyphenation using ctrl and -"
60 printlog "Test Hyphenation using ctrl and -"
62 printlog "open a test file"
63 Call hFileOpen ( gTesttoolPath + "writer\optional\input\hyphenation\" + testFile )
64 Call sMakeReadOnlyDocumentEditable
66 Call wTypeKeys "<End><Shift Mod1 Left>"
70 printlog "add '-' between 'fol' and 'lowing' , then press 3 times 'space bar' (pc). (7 times on linux)"
71 printlog "+ check if fol in the end of the line"
72 if GetClipboardText = testWord then
73 Call wTypeKeys "<Right>" , 3
74 Call wTypeKeys "<Mod1 SUBTRACT>"
75 Call wTypeKeys "<Home>"
76 if gPlatGroup <> "unx" then
77 Call wTypeKeys "<SPACE>" ,3
79 Call wTypeKeys "<SPACE>" ,7
82 Call wTypeKeys "<End><Left><Shift Mod1 Left>"
85 if GetClipboardText <> firstPartOfTestWord then
86 Warnlog "The hyphenation does NOT work well in first part!"
89 printlog "add '-' between 'follow' and 'ing' , then press 6 times 'space bar'"
90 printlog "+ check if follow in the end of the line ."
91 Call wTypeKeys "<Mod1 z>",2
92 Call wTypeKeys "<End>"
93 Call wTypeKeys "<Left>",3
94 Call wTypeKeys "<Mod1 SUBTRACT>"
95 Call wTypeKeys "<Home>"
96 if gPlatGroup <> "unx" then
97 Call wTypeKeys "<SPACE>" ,3
99 Call wTypeKeys "<SPACE>" ,6
101 Call wTypeKeys "<End><Left><Shift Mod1 Left>"
104 if GetClipboardText = secondPartOfTestWord then
105 Call wTypeKeys "<Home>"
107 printlog "press 5 times 'space bar'"
108 printlog "check if fol in the end of the line ."
109 if gPlatGroup <> "unx" then
110 Call wTypeKeys "<SPACE>" ,3
112 Call wTypeKeys "<SPACE>" ,5
114 Call wTypeKeys "<End><Shift Mod1 Left>"
117 if GetClipboardText <> firstPartOfTestWord then
118 Warnlog "The hyphenation does NOT work well in first part, but it works fine in second part!"
121 Warnlog "The hyphenation does NOT work well in second part!"
125 Warnlog "The test word is wrong !!"
132 '-------------------------------------------------------------------------
134 testcase tHyphenation_2
136 warnlog "#i102304# - outcommenting tHyphenation_2 due to bug."
139 Dim testFile as String
140 Dim testWord as String
141 Dim firstPartOfTestWord as String
142 Dim secondPartOfTestWord as String
143 Dim testWordInHyphenationDlg as String
145 testFile = "tHyphenation.odt"
146 testWord = "following"
147 testWordInHyphenationDlg = "fol=low-ing"
148 firstPartOfTestWord = "fol"
149 secondPartOfTestWord = "follow"
151 PrintLog "- Test Hyphenation using Tools/Hyphenation ,test like fol-lowing"
153 printlog "Test Hyphenation using Tools/Hyphenation ,test like fol-lowing"
155 printlog "open a test file"
156 Call hFileOpen ( gTesttoolPath + "writer\optional\input\hyphenation\" + testFile )
157 Call sMakeReadOnlyDocumentEditable
159 Call wTypeKeys "<End><Shift Mod1 Left>"
163 if GetClipboardText <> testWord then
164 Warnlog "The test word is wrong !!"
168 printlog "Press 3 times 'space bar'"
169 Call wTypeKeys "<Home>"
170 if gPlatGroup <> "unx" then
171 Call wTypeKeys "<SPACE>" ,3
173 Call wTypeKeys "<SPACE>" ,6
176 printlog "Tools/Hyphenation"
177 ToolsLanguageHyphenate
178 Kontext "Silbentrennung"
180 if Not Silbentrennung.Exists then
182 if Active.Exists then
183 if Active.GetRT = 304 then
187 if Active.Exists then
188 if Active.GetRT = 304 then Active.Ok
192 Warnlog "Unable to bring up Dialog 'Hyphenation'!"
196 printlog "check if get 'fol=low-ing'"
197 if Wort.Gettext <> testWordInHyphenationDlg then
198 Warnlog "#i40561# The test can NOT be seperated two times , or something wrong!"
199 Silbentrennung.Cancel
203 if NOT Vor.IsEnabled then
204 Warnlog "the Vor button is Not enabled, or something wrong!"
205 Silbentrennung.Cancel
209 printlog "add '-' between 'fol' and 'lowing' using left arrow key"
213 printlog "Close all dialogue, and recover the file to default"
215 if NOT Active.Exists then
216 Kontext "Silbentrennung"
217 Silbentrennung.Cancel
218 Warnlog "The first message box is NOT pop up"
225 if NOT Active.Exists then
226 Warnlog "The second message box is NOT pop up"
232 printlog "Press 3 times 'space bar' in front of the line"
233 Call wTypeKeys "<BACKSPACE>",3
234 Call wTypeKeys "<SPACE>",3
236 Call wTypeKeys "<End><Left><Shift Mod1 Left>"
239 printlog "Check if get 'fol'"
240 if GetClipboardText <> firstPartOfTestWord then
241 Warnlog "The hyphenation does NOT work well in first part!"
249 '-------------------------------------------------------------------------
251 testcase tHyphenation_3
253 warnlog "#i102304# - outcommenting tHyphenation_3 due to bug."
256 Dim testFile as String
257 Dim testWord as String
258 Dim firstPartOfTestWord
259 Dim secondPartOfTestWord as String
260 Dim testWordInHyphenationDlg1 as String
261 Dim testWordInHyphenationDlg2 as String
263 testFile = "tHyphenation.odt"
264 testWord = "following"
265 firstPartOfTestWord = "fol"
266 secondPartOfTestWord = "follow"
267 testWordInHyphenationDlg1 = "fol=low-ing"
268 testWordInHyphenationDlg2 = "fol-low=ing"
270 printLog "- Test Hyphenation using Tools/Hyphenation ,test like follow-ing"
271 printlog "Test Hyphenation using Tools/Hyphenation ,test like follow-ing"
273 printlog "open a test file"
274 Call hFileOpen ( gTesttoolPath + "writer\optional\input\hyphenation\" + testFile )
275 Call sMakeReadOnlyDocumentEditable
277 Call wTypeKeys "<End><Shift Mod1 Left>"
281 if GetClipboardText <> testWord then
282 Warnlog "The test word is wrong !!"
286 printlog "Press 3 times 'space bar'"
287 Call wTypeKeys "<Home>"
288 if gPlatGroup <> "unx" then
289 Call wTypeKeys "<SPACE>" ,3
291 Call wTypeKeys "<SPACE>" ,6
294 printlog "Tools/Hyphenation"
295 ToolsLanguageHyphenate
296 Kontext "Silbentrennung"
298 if Not Silbentrennung.Exists then
300 if Active.Exists then
301 if Active.GetRT = 304 then
305 if Active.Exists then
306 if Active.GetRT = 304 then Active.Ok
310 Warnlog "Unable to bring up Dialog 'Hyphenation'!"
314 printlog "check if get 'fol=low-ing'"
315 if Wort.Gettext <> testWordInHyphenationDlg1 then
316 Warnlog "#i40561# The test can NOT be seperated two times , or something wrong!"
317 Silbentrennung.Cancel
321 printlog "click left arrow key"
322 if NOT Vor.IsEnabled then
323 Warnlog "the Vor button is Not enabled, or something wrong!"
324 Silbentrennung.Cancel
329 printlog "check if get ''fol-low=ing'"
330 if Wort.Gettext <> testWordInHyphenationDlg2 then
331 Warnlog "The test word should be changed after clicking Vor!"
335 printlog "add '-' between 'follow' and 'ing' pressing right arrow key"
336 if NOT Zurueck.IsEnabled then
337 Warnlog "the Zuruech button is Not enabled, or something wrong!"
342 printlog "check if get 'fol-low=ing'"
343 if Wort.Gettext <> testWordInHyphenationDlg1 then
344 Warnlog "The test word should be changed after clicking Zurueck!"
350 printlog "close all dialogue"
354 if NOT Active.Exists then
355 Warnlog "The first message box is NOT pop up"
362 if NOT Active.Exists then
363 Warnlog "The second message box is NOT pop up"
369 printlog "recover to the default file and press 3 sparc bar in front of the line"
370 Call wTypeKeys "<BACKSPACE>",3
371 Call wTypeKeys "<SPACE>",3
373 Call wTypeKeys "<End><Left><Shift Mod1 Left>"
376 printlog "check if get 'follow' in the end of the line"
377 if GetClipboardText = secondPartOfTestWord then
378 Call wTypeKeys "<Home>"
379 Call wTypeKeys "<SPACE>" , 5
381 Call wTypeKeys "<End><Shift Mod1 Left>"
384 if GetClipboardText <> firstPartOfTestWord then
385 Warnlog "The hyphenation does NOT work well in first part, but it works fine in second part!"
388 Warnlog "The hyphenation does NOT work well in second part!"