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 2000, 2010 Oracle and/or its affiliates.
7 ' OpenOffice.org - a multi-platform office productivity suite
9 ' This file is part of OpenOffice.org.
11 ' OpenOffice.org is free software: you can redistribute it and/or modify
12 ' it under the terms of the GNU Lesser General Public License version 3
13 ' only, as published by the Free Software Foundation.
15 ' OpenOffice.org is distributed in the hope that it will be useful,
16 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ' GNU Lesser General Public License version 3 for more details
19 ' (a copy is included in the LICENSE file that accompanied this code).
21 ' You should have received a copy of the GNU Lesser General Public License
22 ' version 3 along with OpenOffice.org. If not, see
23 ' <http://www.openoffice.org/license.html>
24 ' for a copy of the LGPLv3 License.
26 '/************************************************************************
28 '* owner : thorsten.bosbach@oracle.com
30 '* short description : CJK Ruby Dialogue Proposal Test
32 '\***********************************************************************
34 testcase tRubyDialog_1
36 Dim sBaseText , sRubyText as String
37 Dim sBaseText1 , sRubyText1 as String
39 sBaseText = "BaseText"
40 sRubyText = "RubyText"
42 sBaseText1 = "BaseText1"
43 sRubyText1 = "RubyText1"
45 '/// Check Apply and Close button in Ruby dialogue
48 '/// Check close button.
49 '/// open ruby dialogue , input base text and ruby text , then press close button
50 '/// 1) check if the ruby dialogue is closed
51 '/// 2) check if the base text and ruby text is recorded
55 BasisText1.SetText sBaseText
57 RubyText1.SetText sRubyText
63 if RubyDialog.Exists then
64 Warnlog "The Ruby dialogue is NOT closed !"
70 if Len(BasisText1.GetText) <> 0 then Warnlog "The base text should not been inputed"
71 if Len(RubyText1.SetText) <> 0 then Warnlog "The ruby text should not been inputed"
73 '/// Check Apply button -- Normally , we think it is RubyDialog.OK
74 '/// open ruby dialogue , input base text and ruby text , then press close button
75 '/// Press Apply button , then press close button
76 '/// check if the base text and ruby text is recorded
78 BasisText1.SetText sBaseText1
80 RubyText1.SetText sRubyText1
95 if BasisText1.GetText <> sBaseText1 then Warnlog "The base text should be "+sBaseText1 + " but get " + BasisText1.GetText
96 if RubyText1.GetText <> sRubyText1 then Warnlog "The ruby text should be "+sRubyText1 + " but get " + RubyText1.GetText
105 '-------------------------------------------------------------------------
107 testcase tRubyDialog_2
109 Dim sBaseText as String
111 sBaseText = "test1 test2 test3 test4 test5 test6 test7 test8 test9"
112 '/// Test scrollbar in Ruby dialog
116 '/// when there is less basetext, the scrollbar should appear
119 if RubyDialog.HasScrollbar <> TRUE then warnlog "The Scrollbar should appear when less basetext!"
123 '/// when there is more basetext(here is >4), the scrollbar should appear
124 Kontext "DocumentWriter"
125 DocumentWriter.TypeKeys sBaseText
126 DocumentWriter.TypeKeys "<Shift Home>"
130 if RubyDialog.HasScrollbar <> TRUE then warnlog "The Scrollbar should appear when more basetext!"
138 '-------------------------------------------------------------------------
139 testcase tRubyDialog_3
141 Dim sTestText as String
142 Dim sBaseText1, sBaseText2 as String
144 sTestText = "Test1 Test2"
148 '/// The list in ruby dialogure will be updated as soon as the uses
149 '/// selects new or further words of his text.
150 '/// The update will be done once the user changes his focus
151 '/// back to the Ruby-Dialogue from the text
155 '/// input 2 test words, and mark the second
156 DocumentWriter.TypeKeys sTestText
157 DocumentWriter.TypeKeys "<Shift Left>" , 5
159 '/// There should be only the second test word in basetext1 in ruby dialogue
163 if BasisText1.GetText <> sBaseText2 then warnlog "The BaseText1 should be:" +sBaseText2 + " but get "+BasisText1.GetText
165 '/// Mark 2 test words
166 Kontext "DocumentWriter"
168 DocumentWriter.TypeKeys "<Shift Home>"
171 warnlog "The ruby dialogue is MODE less dialogue , the document can be edited!"
174 '/// Check if the 2 test words are all in the ruby dialogue when set forcus back to the dialogue
177 'this step is meaningless, just let the focus back to ruby dialogue
180 if BasisText1.GetText <> sBaseText1 then warnlog "The BaseText1 should be:" +sBaseText1 + " but get "+BasisText1.GetText
182 if BasisText2.GetText <> sBaseText2 then warnlog "The BaseText2 should be:" +sBaseText2 + " but get "+BasisText2.GetText
191 '-------------------------------------------------------------------------
193 testcase tRubyDialog_4
195 Dim sCharacterStyle as String
198 '/// Check default setting for Character Style of Ruby Text
201 case 01 : sCharacterStyle = "Rubies"
202 case 33 : sCharacterStyle = "Rubys"
203 case 34 : sCharacterStyle = "Rubys"
204 case 39 : sCharacterStyle = "Testo Ruby"
205 case 46 : sCharacterStyle = "Rubytext"
206 case 49 : sCharacterStyle = "Rubys"
207 case 50 : sCharacterStyle = "Rubys"
208 case 55 : sCharacterStyle = "Rubys"
209 case 81 : sCharacterStyle = "ふりがな"
210 case 82 : sCharacterStyle = "윗주 달기" ' not sure TBO
211 case 86 : sCharacterStyle = "拼音和注音符号"
212 case 88 : sCharacterStyle = "注音符號"
213 case else :' QAErrorLog "Now, the test does not support for the language " +iSprache
222 if CharacterStyle.GetSelText <> sCharacterStyle then
223 warnlog "Default setting for Character Style of Ruby Text isn't right, should be "+sCharacterStyle + " but get "+CharacterStyle.GetSelText
224 for i = 1 to CharacterStyle.getItemCount
225 printlog "("+i+"/"+CharacterStyle.getItemCount+"): '"+CharacterStyle.getItemText(i)+"'"
235 '-------------------------------------------------------------------------
237 testcase tRubyDialog_5
239 Dim sCharacterStyle as String
240 Dim sStyleName as String
242 dim iCount as integer
243 dim bError as boolean
244 dim bWileExit as boolean
249 case 01 : sCharacterStyle = "Rubies"
250 case 33 : sCharacterStyle = "Rubys"
251 case 34 : sCharacterStyle = "Rubys"
252 case 39 : sCharacterStyle = "Testo Ruby"
253 case 46 : sCharacterStyle = "Rubytext"
254 case 49 : sCharacterStyle = "Rubys"
255 case 50 : sCharacterStyle = "Rubys"
256 case 55 : sCharacterStyle = "Rubys"
257 case 81 : sCharacterStyle = "ふりがな"
258 case 82 : sCharacterStyle = "윗주 달기" ' not sure TBO was "덧말"
259 case 86 : sCharacterStyle = "拼音和注音符号"
260 case 88 : sCharacterStyle = "注音符號"
261 case else :' QAErrorLog "Now, the test does not support for the language " +iSprache
265 sStyleName = "ZZZ-Test-ZZZ"
269 '/// Open ruby dialogue
273 '/// Click stylist button
278 if Stylist.NotExists then
279 Warnlog "No Stylist with clicking Stylist button!"
282 '/// click Character Style
283 Zeichenvorlagen.Click
285 ' needed to update the listbox count :-(
286 Vorlagenliste.typeKeys ("<end><up><down>")
287 iCount = Vorlagenliste.getItemCount
290 bWileExit = Vorlagenliste.getItemText (i) <> sCharacterStyle
291 while ((i<iCount+1) AND (bWileExit))
292 printlog "" + (i) + ": " + Vorlagenliste.getItemText (i)
293 bWileExit = Vorlagenliste.getItemText (i) <> sCharacterStyle
296 if (i = iCount+1) then
297 warnlog "Style (Rubies) not found: '" + sCharacterStyle + "' inside of entries: " + iCount
300 printlog "Style (Rubies) found: '" + sCharacterStyle + "' @ position: ("+(i)+"/"+icount+")"
301 Vorlagenliste.select (i)
306 '/// find entry ruby and add a new entry
307 AusSelektion.OpenMenu
309 printlog "hMenuSelect 1"
311 printlog "hMenuSelect 1 survived"
314 Kontext "VorlageErzeugen"
316 Vorlagenname.SetText sStyleName
321 '/// check if the new entry is in the Character Style list box in ruby dialogue
324 ' needed to update the listbox count :-(
325 CharacterStyle.typeKeys ("<end><up><down>")
326 iCount = CharacterStyle.GetItemCount
329 while ((i<(iCount+1)) AND (bWileExit))
330 bWileExit = CharacterStyle.getItemText (i+1) <> sStyleName
332 printlog "" + (i) + ": " + CharacterStyle.getItemText (i)
334 printlog CharacterStyle.GetItemCount
335 if ((i = iCount) AND bWileExit) then
336 warnlog "New created entry not found: '" + sStyleName + "' inside of entries: " + iCount
339 printlog "New created entry found: '" + sStyleName + "' @ position: ("+(i)+"/"+icount+")"
340 CharacterStyle.select (i)
346 iCount = Vorlagenliste.getItemCount
348 while ((i<iCount) AND (Vorlagenliste.getItemText (i+1) <> sStyleName))
350 printlog "" + (i) + ": " + Vorlagenliste.getItemText (i)
353 warnlog "Style (Rubies) not found for deleting: '" + sStyleName + "' inside of entries: " + iCount
356 printlog "Style (Rubies) found, will delete it now: '" + sStyleName + "' @ position: ("+i+"/"+icount+")"
357 Vorlagenliste.select (i+1)
359 iCount = Vorlagenliste.getItemCount
360 Vorlagenliste.TypeKeys "<Delete>"
363 if active.exists(5) then
364 printlog "active about deleting; say yes to: '" + active.getText + "'"
367 warnlog "No warning, before deleting style."
371 i = Vorlagenliste.getItemCount
372 if ( (iCount-1) <> i) then
373 warnlog "Style wasn't deleted; count is still the same: " + i + "/" + iCount
375 printlog "Style was deleted; Count is OK: " + i + "/" + iCount