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_011.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 10:42:41 $
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 '\******************************************************************************
40 testcase tiTextToolbar
42 Dim iWaitIndex as integer
48 hTextrahmenErstellen ("This is a Text, which will be formatted in several ways", 20,20,40,80)
52 Kontext "TextObjectbar"
53 if TextObjectbar.Exists <> TRUE then 'isVisible
54 ViewToolbarsTextFormatting
56 WaitSlot (3000) 'sleep (3)
57 Kontext "TextObjectbar"
58 Printlog "- choose random font"
60 Zufall=((2*Rnd)+1) ' wird nicht auf den verfuegbaren bereich getreckt :-( TODO TBO!
61 Schriftart.GetItemcount
63 Schriftart.Select (Zufall)
64 Printlog Schriftart.GetSelText + " chosen"
66 Kontext "TextObjectbar"
68 Printlog "- Change size of font"
69 Schriftgroesse.Select (Zufall)
70 Printlog Schriftgroesse.GetSelText + " chosen"
72 Kontext "TextObjectbar"
73 Printlog "- Font attribute bold"
77 Kontext "TextObjectbar"
78 Printlog "- Font attribute cursive"
82 Kontext "TextObjectbar"
83 Printlog "- Font attribute cursiv"
87 Kontext "TextObjectbar"
88 Printlog "- font attribute color"
90 FontColorGraphics.TearOff
94 TB_Farbe.MouseDoubleClick 50, 50
98 Kontext "TextObjectbar"
99 Printlog "- Allign text left"
103 Kontext "TextObjectbar"
104 Printlog "- Allign text centered"
108 Kontext "TextObjectbar"
109 Printlog "- align text to right"
113 Kontext "TextObjectbar"
114 Printlog "- Justified"
118 Kontext "TextObjectbar"
119 if TextObjectbar.isEnabled <> TRUE then
120 warnlog "Couldn't access TextObjectbar - known bug with bars - FHA"
121 ViewToolbarsTextFormatting
123 WaitSlot (2000) 'sleep 2
124 Printlog "- Raising Font spacing"
126 kontext "TextObjectbar"
129 do while NOT TextObjectbar.isEnabled AND iWaitIndex < 10
131 iWaitIndex = iWaitIndex + 1
133 if NOT TextObjectbar.isEnabled AND iWaitIndex = 10 then
134 warnlog "Dialogue TextObjectbar didnt work. Ending testcase."
138 TextObjectbar.OpenContextMenu
144 TextObjectbar.OpenContextMenu
150 ZeilenabstandErhoehen.Click
153 Kontext "TextObjectbar"
154 Printlog "- Decrease Spacing"
155 ZeilenabstandVerringern.Click
158 Kontext "TextObjectbar"
159 Printlog "- Numbering and Bullets"
165 Kontext "TextObjectBar"
166 Printlog "- Increase Font /Reduce Font"
168 printlog "Click on Increase Font"
171 printlog "Click on Reduce Font"
174 Kontext "TextObjectbar"
175 Printlog "- Text direction from left to right"
177 Printlog "- click button 'Text direction from left to right
179 TextdirectionLeftToRight.Click
180 printlog "hor does work :-)"
181 if (NOT gAsianSup) then
182 warnlog " this doesn't have to work if asian lang support is disabled :-)"
186 warnlog "hor does NOT work :-("
189 Printlog "- click button 'Text direction from top to bottom"
191 TextdirectionTopToBottom.Click
192 printlog "ver does work :-)"
193 if (gAsianSup = FALSE) then
194 warnlog " this doesnt have to work if asian lang support is disabled :-)"
197 if (gAsianSup = TRUE) then
198 warnlog "ver does NOT work :-( , AsianLanguage support is enabled !"
202 Printlog "- open character dialog"
203 Kontext "TextObjectbar"
209 Active.SetPage TabFont
213 if TabFont.Exists Then
215 Printlog "- Tabfont exists"
217 Warnlog "- No dialog exists "
220 Kontext "TextObjectbar"
222 Printlog "- call properties for paragraph using text object toolbar"
227 Active.SetPage TabTabulator
229 Kontext "TabTabulator"
230 if TabTabulator.Exists Then
231 Printlog "- TabTabulator exists"
234 Warnlog "- TabTabulator does not exist"
237 if ( gApplication = "IMPRESS" ) then ' IMPRESS only
239 Kontext "TextObjectbar"
242 if active.exists (5) then
243 messagebox.SetPage TabOptionenNumerierung
245 kontext "TabOptionenNumerierung"
246 if (TabOptionenNumerierung.exists (5) ) then
247 Printlog "Numbering/Bullets window came up :-)"
248 TabOptionenNumerierung.cancel
250 warnlog "no Numbering/Bullets window came up :-("
253 warnlog "no Numbering/Bullets window came up :-( 2"
256 Printlog "-change order of outline points"
258 ViewWorkspaceOutlineView
259 WaitSlot (2000) 'sleep (3)
261 Kontext "DocumentImpressOutlineView"
263 DocumentImpressOutlineView.TypeKeys "Bla bla bla <RETURN><TAB>bla bla bla bla bla <MOD1 SHIFT LEFT>"
266 Kontext "TextObjectbar"
267 HierachieRunter.Click
269 Printlog "- Move back down"
274 Printlog "- Move paragraph up"
277 Printlog "- move paragraph back down and switch to drawing view"
282 if Vorschau.Exists then
283 printlog "- - - - preview window is open, hope there is no problem"
288 Kontext "TextObjectbar"
293 Kontext "TextObjectbar"
294 Printlog "- 1.5 lines"
298 Kontext "TextObjectbar"
306 Kontext "TextObjectbar"
307 do while TextObjectbar.isEnabled = FALSE AND iWaitIndex < 10
309 iWaitIndex = iWaitIndex + 1
311 if TextObjectbar.isEnabled = FALSE AND iWaitIndex = 10 then
312 warnlog "Dialogue TextObjectbar didnt work. Ending testcase."
318 Kontext "TextObjectbar"
319 TextObjectbar.OpenContextMenu
323 hMenuItemUnCheck (13)
325 TextObjectbar.OpenContextMenu
329 hMenuItemUnCheck (14)
331 ViewToolbarsTextFormatting
332 WaitSlot (2000) 'sleep 1
333 if ( gApplication = "IMPRESS" ) then
334 Kontext "DocumentImpressOutlineView"
335 DocumentImpressOutlineView.TypeKeys "<ESCAPE>"
336 hUseAsyncSlot( "EditSelectAll" )
337 DocumentImpressOutlineView.TypeKeys "<DELETE>"
339 ViewWorkspaceDrawingView
341 Kontext "DocumentImpress"
342 WaitSlot (2000) 'sleep 1
343 DocumentImpress.TypeKeys "<ESCAPE>"
344 hUseAsyncSlot( "EditSelectAll" )
345 DocumentImpress.TypeKeys "<DELETE>"
347 Kontext "DocumentDraw"
348 DocumentDraw.TypeKeys "<ESCAPE>"
349 hUseAsyncSlot( "EditSelectAll" )
350 DocumentDraw.TypeKeys "<DELETE>"
352 Printlog "Test ended."
357 '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
359 testcase tiDrawObjectBar
361 Dim Zaehler as integer
367 Call hRechteckErstellen (20,20,70,70)
369 '--------------------------- format line ------------------------
370 Printlog "- call format line using graphic object toolbar"
371 Kontext "DrawingObjectbar"
372 if DrawingObjectbar.Exists = FALSE then
375 if DrawingObjectbar.Exists = FALSE then
376 warnlog "Drawing-Objectbar should have been opened, but wasnt"
384 Active.SetPage TabLinie
386 if TabLinie.Exists Then
388 Printlog "- TabLinie exists "
390 Warnlog "- TabLinie does not exist"
393 '--------------------------- Linienendenstil --------------------
394 Printlog "- Style of line ends"
395 Kontext "DrawingObjectbar"
397 Linienendenstil.TearOff
399 Kontext "Linienenden"
400 if Linienenden.Exists Then
401 Printlog "- dialog exists"
404 Warnlog "- Arrowheads does not exist"
407 '--------------------------- Linienstil -------------------------
408 Printlog "- choose style of lines using graphic object toolbar"
410 Kontext "DrawingObjectbar"
413 Printlog Linienstil.GetSelText + " chosen"
414 Linienstil.Select Linienstil.GetItemCount
415 Printlog Linienstil.GetSelText + " chosen"
418 '--------------------------- Linienbreite------------------------
419 Printlog "- check style of lines using graphic object toolbar"
420 Kontext "DrawingObjectbar"
422 a = Linienbreite.GetText
425 Linienbreite.SetText "0,5"
427 if Linienbreite.GetText = a Then
428 Warnlog "- changes in edit field did not happen; is: '"+Linienbreite.GetText+"', should be : '"+"0,5"+"'"
430 Printlog "- Width of lines changed"
433 '--------------------------- Linienfarbe ------------------------
434 Printlog "- change line color"
435 Kontext "DrawingObjectbar"
437 Zaehler = Linienfarbe.GetItemCount
439 i = Int(Zaehler*Rnd+1)
441 Printlog Linienfarbe.GetSelText + " chosen"
443 '--------------------------- Flaechenformatierung ---------------
444 Printlog "- Call Format area using graphic object toolbar"
445 Kontext "DrawingObjectbar"
450 printlog "clicking on area took ages :-("
454 Active.SetPage TabArea
456 if TabArea.Exists Then
457 Printlog "- TabArea exists "
460 Warnlog "- TabArea does not exist"
465 Kontext "DrawingObjectbar"
467 x = AreaStyle.GetItemCount
471 Printlog "Area Style: (" + i + "/" + x + ") - " + AreaStyle.GetSelText
473 if AreaStyle.GetSelIndex > 1 then
474 Printlog " Area Filling " + AreaFilling.GetSelIndex + " - " + AreaFilling.GetItemCount
475 if (i <> 1) AND (AreaFilling.GetItemCount <> 0) then
476 if (AreaFilling.GetSelIndex = 0) AND (AreaFilling.GetItemCount > 0) then
477 printlog "default item is 0 => means nothing; NO BUG! 100909"
479 AreaFilling.Select (AreaFilling.GetItemCount)
480 Printlog " Selected: " + AreaFilling.GetSelIndex + " - " + AreaFilling.GetSelText
485 '---------------------------- Schatten --------------------------
486 Printlog "- Assign shadow using graphic object toolbar"
487 Kontext "DrawingObjectbar"
491 Printlog "- shadow assigned"
493 '---------------------------- Praesentationsflyer ---------------
494 if ( gApplication = "IMPRESS" ) then ' IMPRESS only
495 Printlog "- Call presentation flyer"
496 Kontext "CommonTaskbar" ' first check , if presentation flyer is up! if not -> make it up :-)
497 if CommonTaskbar.Exists Then
498 printlog "- flyer is already visible :-)"
500 printlog "- flyer wasn't visible :-( -will be now!"
501 Kontext "DrawingObjectbar"
503 ViewToolbarsPresentation ' put it up again!
506 if ((UCase(gApplication)) = "IMPRESS") then ' IMPRESS only
507 Kontext "DrawingObjectbar"
508 if DrawingObjectbar.isVisible = FALSE then
515 '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
517 testcase tiGraphicsObjectBar
521 hGrafikeinfuegen ConvertPath (gTesttoolPath & "global\input\graf_inp\desp.bmp")
523 Kontext "GraphicObjectbar"
524 if ( NOT GraphicObjectbar.Exists() ) then
530 Kontext "GraphicFilterBar"
541 Printlog "remove noise"
544 Printlog "solarization"
547 Kontext "Solarization"
548 if Solarization.exists (5) then
550 Call Dialogtest ( Solarization )
557 warnlog "solarization didn't came up :-("
560 Kontext "GraphicFilterBar"
566 Call Dialogtest ( Aging )
572 Kontext "GraphicFilterBar"
579 Call Dialogtest ( Posterize )
585 kontext "GraphicFilterBar"
597 Call Dialogtest ( Relief )
598 LightSource.TypeKeys "<left><up>"
601 Kontext "GraphicFilterBar"
607 Call Dialogtest ( Mosaic )
615 Kontext "GraphicFilterBar"
616 GraphicFilterBar.Close
618 Kontext "GraphicObjectbar"
619 if GraphicObjectbar.Exists = FALSE then
623 for i = 1 to Grafikmodus.GetItemCount
635 warnlog "not working from testtool redvalue "+ rotanteil.GetRT
641 warnlog "not working from testtool Greenvalue."
647 warnlog "not working from testtool Bluevalue."
653 warnlog "not working from testtool Brightness."
659 warnlog "not working from testtool Contrast."
665 warnlog "not working from testtool Gamma."
669 Kontext "GraphicObjectbar"
675 warnlog "Not working from testtool Transparency."
681 kontext "TabZuschneiden"
682 GroesseBeibehalten.Check
683 MassstabBeibehalten.Check
700 Originalgroesse.Click
701 TabZuschneiden.Cancel
706 '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
708 testcase tiGluepointToolbar
711 Call hRechteckErstellen 20,20,40,40
712 Call hRechteckErstellen 60,60,80,80
714 ViewToolbarsOptionbar
718 if Optionsbar.Exists = False Then
719 ViewToolbarsOptionbar
721 if Optionsbar.Exists = False Then
722 warnlog "Can't open Optionsbar."
729 gMouseMove 30,30,70,70
734 Kontext "Gluepointsobjectbar"
735 if Gluepointsobjectbar.Exists = False Then
736 ViewToolbarsGluepoints
739 '-------------------------------------- Klebepunkt einfuegen ----
741 PunkteEinfuegen.Click
746 Printlog "- insert gluepoint works"
748 Warnlog "- gluepoint could not be insert. Following errors might have their reason here"
751 Kontext "Gluepointsobjectbar"
753 '-------------------------------------- Links -------------------
756 Printlog "- gluepoint left works"
758 Warnlog "- gluepoint left does not work"
761 '-------------------------------------- Rechts ------------------
764 Printlog "- gluepoint right works"
766 Warnlog "- gluepoint right does not work"
769 '-------------------------------------- Oben --------------------
772 Printlog "- gluepoint top works"
774 Warnlog "- gluepoint top does not work"
777 '-------------------------------------- Unten -------------------
780 Printlog "- gluepoint bottom works"
782 Warnlog "- gluepoint bottom does not work"
785 '---------------------- Position an Objekt anpassen -------------
787 PositionAnObjektAnpassen.Click
788 Printlog "- align position to object works"
789 gMouseClick 25,30 ' if you don't click onto an existing point, the state changes back :-[
791 Warnlog "- align position to object does not work"
793 Kontext "Gluepointsobjectbar"
795 '------------------------------------- Horizontal links ---------
796 if PositionAnObjektAnpassen.exists then
797 printlog "PositionAnObjektAnpassen = Exists"
799 if PositionAnObjektAnpassen.GetState(2) <> 0 then
800 PositionAnObjektAnpassen.Click ' make unpressed!
802 '0 = not pressed. 1 = pressed.
805 Kontext "Gluepointsobjectbar"
806 HorizontalLinks.Click
807 Printlog "- align horizontal left works"
809 Warnlog "- align horizontal left does not work"
810 PositionAnObjektAnpassen.Click ' that's the middle button, it has to be UP/not activated!
811 for i = 1 to Gluepointsobjectbar.GetItemCount
812 if (Gluepointsobjectbar.GetState ( i, 0 ) <> 0 ) then ' is no seperator
813 printlog "----------------------------------------------------------------------"
814 printlog "helpid : " + Gluepointsobjectbar.Getstate ( i, 0 ) + " number in row: " + i
815 printlog "itemtype: " + Gluepointsobjectbar.GetState ( i, 1 )
816 printlog "state : " + Gluepointsobjectbar.GetState ( i, 2 )
817 printlog "----------------------------------------------------------------------"
822 '------------------------------------- Horizontal rechts --------
824 HorizontalRechts.Click
825 Printlog "- Align horizontal right does work"
827 Warnlog "- Align horizontal right does notwork"
830 '------------------------------------- Horizontal zentriert -----
832 HorizontalZentriert.Click
833 Printlog "- align horizontal center does work"
835 Warnlog "- align horizontal center does work"
838 '------------------------------------- Vertikal oben ------------
842 Printlog "- Align vertical top does work"
844 Warnlog "- Align vertical top does not work"
846 '------------------------------------- Vertikal unten -----------
850 printlog "- Align vertical bottom does work"
852 Warnlog "- Align vertical bottom does not work"
854 '------------------------------------- Vertikal zentriert -------
856 VertikalZentriert.Click
858 Printlog "- Align vertical center does work"
860 Warnlog "- Align vertical center does not work"
863 Printlog "- End of testing gluepoints"
865 ViewToolbarsOptionbar
868 if Optionsbar.Exists Then
869 warnlog "Couldnt close Optionsbar."
874 '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'
876 testcase tdBezierToolbar
879 Call hRechteckErstellen ( 10, 10, 30, 40 )
882 Call hOpenContextMenu
885 Call hOpenContextMenu
888 Kontext "Bezierobjectbar"
889 if Bezierobjectbar.Exists <> TRUE then
892 if Bezierobjectbar.Exists <> TRUE then
893 warnlog "Bezierobjectbar did not show up. Check why."
897 '----------------------------------- Punkte verschieben ------------------------------------
899 Kontext "Bezierobjectbar"
900 if Bezierobjectbar.Exists <> TRUE then
904 if Bezierobjectbar.Exists <> TRUE then
905 Warnlog "The Bezier-Objectbar should have been opened, but wasnt."
910 Kontext "Bezierobjectbar"
912 Printlog "- Move points"
916 hTypeKeys "<MOD1 TAB>"
918 Printlog "- Insert points"
919 Kontext "Bezierobjectbar"
922 Bezierobjectbar.Move 20, 20
924 Printlog "- Delete points"
926 gMouseMove 25,25,45,45
930 Kontext "Bezierobjectbar"
932 Printlog "- Convert into curve"
935 Printlog "- Place edge point"
938 Printlog "- Smooth transition"
941 Printlog "- Symetric transition"
945 Kontext "Bezierobjectbar"
946 PunkteReduzieren.Click
949 hTypeKeys "<MOD1 TAB>"
950 hTypeKeys "<MOD1 SHIFT SPACE>"
952 Kontext "Bezierobjectbar"
956 Warnlog "- 'Break' could not be executed"
960 hTypeKeys "<MOD1 TAB>"
963 Printlog "- Close bezier"
964 Kontext "Bezierobjectbar"
973 warnlog "Couldn't push button :-( can't reproduce it now, mostly seen on linux, if i loop this test, it happens only 1/5 of the time ... :-)"
978 hTypeKeys "<MOD1 TAB>"
981 Kontext "Bezierobjectbar"
982 Printlog "- Break curve"
987 warnlog "Delete didn't work... why?"
992 Toolbar.OpenContextMenu ' Enable forms button in menuebar
1001 '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'