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: CJK_RubyDialogueProposal_1.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 : thorsten.bosbach@sun.com
36 '* short description : CJK Ruby Dialogue Proposal Test
38 '\***********************************************************************
40 testcase tRubyDialog_1
42 Dim sBaseText , sRubyText as String
43 Dim sBaseText1 , sRubyText1 as String
45 sBaseText = "BaseText"
46 sRubyText = "RubyText"
48 sBaseText1 = "BaseText1"
49 sRubyText1 = "RubyText1"
51 '/// Check Apply and Close button in Ruby dialogue
54 '/// Check close button.
55 '/// open ruby dialogue , input base text and ruby text , then press close button
56 '/// 1) check if the ruby dialogue is closed
57 '/// 2) check if the base text and ruby text is recorded
61 BasisText1.SetText sBaseText
63 RubyText1.SetText sRubyText
69 if RubyDialog.Exists then
70 Warnlog "The Ruby dialogue is NOT closed !"
76 if Len(BasisText1.GetText) <> 0 then Warnlog "The base text should not been inputed"
77 if Len(RubyText1.SetText) <> 0 then Warnlog "The ruby text should not been inputed"
79 '/// Check Apply button -- Normally , we think it is RubyDialog.OK
80 '/// open ruby dialogue , input base text and ruby text , then press close button
81 '/// Press Apply button , then press close button
82 '/// check if the base text and ruby text is recorded
84 BasisText1.SetText sBaseText1
86 RubyText1.SetText sRubyText1
101 if BasisText1.GetText <> sBaseText1 then Warnlog "The base text should be "+sBaseText1 + " but get " + BasisText1.GetText
102 if RubyText1.GetText <> sRubyText1 then Warnlog "The ruby text should be "+sRubyText1 + " but get " + RubyText1.GetText
111 '-------------------------------------------------------------------------
113 testcase tRubyDialog_2
115 Dim sBaseText as String
117 sBaseText = "test1 test2 test3 test4 test5 test6 test7 test8 test9"
118 '/// Test scrollbar in Ruby dialog
122 '/// when there is less basetext, the scrollbar should appear
125 if RubyDialog.HasScrollbar <> TRUE then warnlog "The Scrollbar should appear when less basetext!"
129 '/// when there is more basetext(here is >4), the scrollbar should appear
130 Kontext "DocumentWriter"
131 DocumentWriter.TypeKeys sBaseText
132 DocumentWriter.TypeKeys "<Shift Home>"
136 if RubyDialog.HasScrollbar <> TRUE then warnlog "The Scrollbar should appear when more basetext!"
144 '-------------------------------------------------------------------------
145 testcase tRubyDialog_3
147 Dim sTestText as String
148 Dim sBaseText1, sBaseText2 as String
150 sTestText = "Test1 Test2"
154 '/// The list in ruby dialogure will be updated as soon as the uses
155 '/// selects new or further words of his text.
156 '/// The update will be done once the user changes his focus
157 '/// back to the Ruby-Dialogue from the text
161 '/// input 2 test words, and mark the second
162 DocumentWriter.TypeKeys sTestText
163 DocumentWriter.TypeKeys "<Shift Left>" , 5
165 '/// There should be only the second test word in basetext1 in ruby dialogue
169 if BasisText1.GetText <> sBaseText2 then warnlog "The BaseText1 should be:" +sBaseText2 + " but get "+BasisText1.GetText
171 '/// Mark 2 test words
172 Kontext "DocumentWriter"
174 DocumentWriter.TypeKeys "<Shift Home>"
177 warnlog "The ruby dialogue is MODE less dialogue , the document can be edited!"
180 '/// Check if the 2 test words are all in the ruby dialogue when set forcus back to the dialogue
183 'this step is meaningless, just let the focus back to ruby dialogue
186 if BasisText1.GetText <> sBaseText1 then warnlog "The BaseText1 should be:" +sBaseText1 + " but get "+BasisText1.GetText
188 if BasisText2.GetText <> sBaseText2 then warnlog "The BaseText2 should be:" +sBaseText2 + " but get "+BasisText2.GetText
197 '-------------------------------------------------------------------------
199 testcase tRubyDialog_4
201 Dim sCharacterStyle as String
204 '/// Check default setting for Character Style of Ruby Text
207 case 01 : sCharacterStyle = "Rubies"
208 case 33 : sCharacterStyle = "Rubys"
209 case 34 : sCharacterStyle = "Rubys"
210 case 39 : sCharacterStyle = "Testo Ruby"
211 case 46 : sCharacterStyle = "Rubytext"
212 case 49 : sCharacterStyle = "Rubys"
213 case 55 : sCharacterStyle = "Rubys"
214 case 81 : sCharacterStyle = "ふりがな"
215 case 82 : sCharacterStyle = "윗주 달기" ' not sure TBO
216 case 86 : sCharacterStyle = "拼音和注音符号"
217 case 88 : sCharacterStyle = "注音符號"
218 case else :' QAErrorLog "Now, the test does not support for the language " +iSprache
227 if CharacterStyle.GetSelText <> sCharacterStyle then
228 warnlog "Default setting for Character Style of Ruby Text isn't right, should be "+sCharacterStyle + " but get "+CharacterStyle.GetSelText
229 for i = 1 to CharacterStyle.getItemCount
230 printlog "("+i+"/"+CharacterStyle.getItemCount+"): '"+CharacterStyle.getItemText(i)+"'"
240 '-------------------------------------------------------------------------
242 testcase tRubyDialog_5
244 Dim sCharacterStyle as String
245 Dim sStyleName as String
247 dim iCount as integer
248 dim bError as boolean
249 dim bWileExit as boolean
254 case 01 : sCharacterStyle = "Rubies"
255 case 33 : sCharacterStyle = "Rubys"
256 case 34 : sCharacterStyle = "Rubys"
257 case 39 : sCharacterStyle = "Testo Ruby"
258 case 46 : sCharacterStyle = "Rubytext"
259 case 49 : sCharacterStyle = "Rubys"
260 case 55 : sCharacterStyle = "Rubys"
261 case 81 : sCharacterStyle = "ふりがな"
262 case 82 : sCharacterStyle = "윗주 달기" ' not sure TBO was "덧말"
263 case 86 : sCharacterStyle = "拼音和注音符号"
264 case 88 : sCharacterStyle = "注音符號"
265 case else :' QAErrorLog "Now, the test does not support for the language " +iSprache
269 sStyleName = "ZZZ-Test-ZZZ"
273 '/// Open ruby dialogue
277 '/// Click stylist button
282 if Stylist.NotExists then
283 Warnlog "No Stylist with clicking Stylist button!"
286 '/// click Character Style
287 Zeichenvorlagen.Click
289 ' needed to update the listbox count :-(
290 Vorlagenliste.typeKeys ("<end><up><down>")
291 iCount = Vorlagenliste.getItemCount
294 bWileExit = Vorlagenliste.getItemText (i) <> sCharacterStyle
295 while ((i<iCount+1) AND (bWileExit))
296 printlog "" + (i) + ": " + Vorlagenliste.getItemText (i)
297 bWileExit = Vorlagenliste.getItemText (i) <> sCharacterStyle
300 if (i = iCount+1) then
301 warnlog "Style (Rubies) not found: '" + sCharacterStyle + "' inside of entries: " + iCount
304 printlog "Style (Rubies) found: '" + sCharacterStyle + "' @ position: ("+(i)+"/"+icount+")"
305 Vorlagenliste.select (i)
310 '/// find entry ruby and add a new entry
311 AusSelektion.OpenMenu
313 printlog "hMenuSelect 1"
315 printlog "hMenuSelect 1 survived"
318 Kontext "VorlageErzeugen"
320 Vorlagenname.SetText sStyleName
325 '/// check if the new entry is in the Character Style list box in ruby dialogue
328 ' needed to update the listbox count :-(
329 CharacterStyle.typeKeys ("<end><up><down>")
330 iCount = CharacterStyle.GetItemCount
333 while ((i<(iCount+1)) AND (bWileExit))
334 bWileExit = CharacterStyle.getItemText (i+1) <> sStyleName
336 printlog "" + (i) + ": " + CharacterStyle.getItemText (i)
338 printlog CharacterStyle.GetItemCount
339 if ((i = iCount) AND bWileExit) then
340 warnlog "New created entry not found: '" + sStyleName + "' inside of entries: " + iCount
343 printlog "New created entry found: '" + sStyleName + "' @ position: ("+(i)+"/"+icount+")"
344 CharacterStyle.select (i)
349 '/// delete the new entry and recover to the default.
351 iCount = Vorlagenliste.getItemCount
353 while ((i<iCount) AND (Vorlagenliste.getItemText (i+1) <> sStyleName))
355 printlog "" + (i) + ": " + Vorlagenliste.getItemText (i)
358 warnlog "Style (Rubies) not found for deleting: '" + sStyleName + "' inside of entries: " + iCount
361 printlog "Style (Rubies) found, will delete it now: '" + sStyleName + "' @ position: ("+i+"/"+icount+")"
362 Vorlagenliste.select (i+1)
364 iCount = Vorlagenliste.getItemCount
365 Vorlagenliste.TypeKeys "<Delete>"
368 if active.exists(5) then
369 printlog "active about deleting; say yes to: '" + active.getText + "'"
372 warnlog "No warning, before deleting style."
376 i = Vorlagenliste.getItemCount
377 if ( (iCount-1) <> i) then
378 warnlog "Style wasn't deleted; count is still the same: " + i + "/" + iCount
380 printlog "Style was deleted; Count is OK: " + i + "/" + iCount