1 '**************************************************************************
2 ' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 ' Copyright 2000, 2010 Oracle and/or its affiliates.
6 ' OpenOffice.org - a multi-platform office productivity suite
8 ' This file is part of OpenOffice.org.
10 ' OpenOffice.org is free software: you can redistribute it and/or modify
11 ' it under the terms of the GNU Lesser General Public License version 3
12 ' only, as published by the Free Software Foundation.
14 ' OpenOffice.org is distributed in the hope that it will be useful,
15 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ' GNU Lesser General Public License version 3 for more details
18 ' (a copy is included in the LICENSE file that accompanied this code).
20 ' You should have received a copy of the GNU Lesser General Public License
21 ' version 3 along with OpenOffice.org. If not, see
22 ' <http://www.openoffice.org/license.html>
23 ' for a copy of the LGPLv3 License.
25 '/************************************************************************
27 '* owner : helge.delfs@oracle.com
29 '* short description: Testcases for the Toolbar.
31 '\******************************************************************
35 printLog Chr(13) + "--------- Toolbar ( w_011_.inc ) ----------"
36 gApplication = "WRITER"
40 'Objektleiste Zeichenobjekt
50 '-----------------------------------------------------------
52 testcase tGraphicFilters
53 printlog "- Objectbar Graphic (Filters)"
54 if gApplication = "HTML" then
55 printlog "This test applies not to HTML-Document"
56 Printlog "Not in WriterWeb!"
60 printlog "Open new document"
62 printlog "Insert graphic '/writer/required/input/grafik/jolink.jpg'"
63 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
65 printlog "- Select all Filters"
66 Kontext "GraphicObjectbar"
67 printlog "In graphic toolbox taer off 'Filter' Toolbox"
68 if Not GraphicObjectbar.Exists then hToolbarSelect ( "Picture", true )
72 Warnlog "Unable to tear off 'Filter'-Toolbar"
77 Kontext "GraphicFilterBar"
79 GraphicFilterBar.Move ( 20, 20 )
81 Warnlog "Unable to move toolbar"
85 printlog "Select 'Invert'"
86 if Invert.IsEnabled then
89 Warnlog "- 'Invert' is disabled !"
92 if CheckForFilters=False then
93 printlog "Close active document"
97 printlog "Click 'Smooth'"
99 if Smooth.IsEnabled then
102 Warnlog "- 'Smooth' is disabled!"
105 if CheckForFilters=False then
106 printlog "Close active document"
111 printlog "Click 'Sharpen'"
112 if Sharpen.IsEnabled then
115 Warnlog "- 'Sharpen' is disabled!"
119 if CheckForFilters=False then
120 printlog "Close active document"
124 printlog "- Remove Noise"
125 printlog "Click 'Remove Noise'"
126 if Remove.IsEnabled then
129 Warnlog "- 'Remove Noise' is disabled!"
133 if ( CheckForFilters=False ) then
134 printlog "Close active document"
138 printlog "- Solarization"
139 printlog "Click 'Solarization'"
140 if Solarization.IsEnabled then
142 Kontext "Solarization"
143 printlog "Cancel upcoming 'Solarization' dialog"
144 if Solarization.Exists then
145 Call Dialogtest( Solarization )
148 Warnlog "- Dialog 'Solarisation' has not been opened! Try a second time!"
149 Kontext "GraphicFilterBar"
150 if Solarization.IsEnabled then
152 Kontext "Solarization"
153 if Solarization.Exists then
154 Call Dialogtest( Solarization )
157 Warnlog "- Dialog 'Solarisation' has not been opened!"
162 Warnlog "- 'Solarization' is disabled!"
165 if CheckForFilters=False then
166 printlog "Close active document"
171 printlog "Click 'Aging'"
172 if Aging.IsEnabled then
174 printlog "Cancel upcoming 'Aging' dialog"
177 Call Dialogtest( Aging )
180 Warnlog "- Dialog 'Aging' has not been opened! Try a second time!"
181 Kontext "GraphicFilterBar"
182 if Aging.IsEnabled then
186 Call Dialogtest( Aging )
189 Warnlog "- Dialog 'Aging' has not been opened!"
194 Warnlog "- 'Aging' is disabled!"
197 if CheckForFilters=False then
198 printlog "Close active document"
202 printlog "- Posterize"
203 printlog "Click 'Posterize'"
204 if Posterize.IsEnabled then
206 printlog "Cancel upcoming 'Posterize' dialog"
208 if Posterize.Exists then
209 Call Dialogtest( Posterize )
212 Warnlog "- Dialog 'Posterize' has not been opened! Try a second time!"
213 Kontext "GraphicFilterBar"
214 if Posterize.IsEnabled then
217 if Posterize.Exists then
218 Call Dialogtest( Posterize )
221 Warnlog "- Dialog 'Posterize' has not been opened!"
226 Warnlog "- 'Posterize' is disabled!"
229 if CheckForFilters=False then
230 printlog "Close active document"
234 printlog "Click 'Pop Art'"
236 if Art.IsEnabled then
239 Warnlog "- 'Pop Art' is disabled!"
242 if CheckForFilters=False then
243 printlog "Close active document"
247 printlog "- Charcoal Sketch"
248 printlog "Click 'Charcoal Sketch'"
249 if CharcoalSketch.IsEnabled then
252 Warnlog "- 'Charcoal Sketch' is disabled!"
255 if CheckForFilters=False then
256 printlog "Close active document"
261 printlog "Click 'Relief'"
262 if Relief.IsEnabled then
265 if Relief.Exists then
266 Call Dialogtest( Relief )
269 printlog "Cancel upcoming 'relief' dialog"
270 Warnlog "- Dialog 'Relief' has not been opened! Try a second time!"
271 Kontext "GraphicFilterBar"
272 if Relief.IsEnabled then
275 if Relief.Exists then
276 Call Dialogtest( Relief )
279 Warnlog "- Dialog 'Relief' has not been opened!"
284 Warnlog "- 'Relief' is disabled!"
287 if CheckForFilters=False then
288 Printlog "Close active document"
293 Printlog "Clock 'Mosaic'"
294 if Mosaic.IsEnabled then
297 Printlog "Cancel upcoming 'Mosaic' dialog"
298 if Mosaic.Exists then
299 Call Dialogtest( Mosaic )
302 Warnlog "- Dialog 'Mosaic' has not been opened!"
305 Warnlog "- 'Mosaic' is disabled!"
308 Printlog "Close active document"
312 '-----------------------------------------------------------
314 testcase tZOEditPoints
315 printlog "- Draw Functions-Objectbar: Edit Points"
316 if gApplication = "HTML" then
317 Printlog "This test does not apply to HTML documents"
318 Printlog "Not in WriterWeb!"
321 Printlog "Open new document"
323 Printlog "Insert a drawing object (rectangle)"
324 Call wZeichenobjektEinfuegen ( "Rechteck", 30, 30, 50, 60 )
325 Printlog "Select drawing object with shortcut 'Shift F4'"
326 Call wTypeKeys ( "<Shift F4>" )
329 if Not Drawbar.Exists then Call hToolbarSelect("Drawing", true)
332 Printlog "In Toolbox click 'Edit Points'"
336 Warnlog "#i56594#Shortcut selecting objects doesn't work"
337 Printlog "Close active document"
342 Printlog "Click 'Edit Points' in toolbox again"
344 Printlog "Close active document"
348 '-----------------------------------------------------------
351 printlog "- Draw Functions-Objectbar: all within Line"
352 if gApplication = "HTML" then
353 Printlog "This test does not apply to HTML documents"
354 Printlog "Not in WriterWeb!"
357 printlog "Open new document"
360 printlog "Insert a drawing object ( rectangle )"
361 Call wZeichenobjektEinfuegen ( "Rechteck", 30, 30, 50, 60 )
362 Call gMouseClick ( 25, 25 )
363 printlog "Select drawing object with shortcut 'Shift F4'"
364 Call wTypeKeys ( "<Shift F4>" )
366 Kontext "DrawingObjectbar"
367 if Not DrawingObjectbar.Exists then hToolbarSelect("GRAPHIC", true)
369 printlog " - Line-Tabdialog"
373 printlog "In Toolbox click 'Line'"
375 Warnlog "#i56594#Shortcut selecting objects doesn't work"
380 printlog "Step through all tabpages in upcoming dialog"
382 Active.SetPage TabLinie
385 Kontext "DrawingObjectbar"
386 if Not DrawingObjectbar.Exists then hToolbarSelect("GRAPHIC", true)
388 printlog " - Arrow Styles"
389 Linienendenstil.TearOff
390 Kontext "Linienenden"
391 Call Dialogtest(Linienenden)
392 printlog "Close dialog"
396 printlog "Close active document"
400 '-----------------------------------------------------------
403 printlog "- Draw Functions-Objectbar: all within rectangle"
404 if gApplication = "HTML" then
405 printlog "This test applies not to HTML document"
406 Printlog "Not in WriterWeb!"
410 printlog "Open new document"
412 printlog "Insert a draw object ( rectangle )"
413 Call wZeichenobjektEinfuegen ( "Rechteck", 30, 30, 50, 60 )
414 ' Set focus to document
415 Call gMouseMove2 ( 50, 25 )
416 Call gMouseClick ( 50, 25 )
417 printlog "Select drawing object with shortcut 'Shift F4'"
418 Call wTypeKeys ( "<Shift F4>" )
420 Kontext "DrawingObjectbar"
421 if Not DrawingObjectbar.Exists then hToolbarSelect("GRAPHIC", true)
422 printlog " - Rectangle-Tabdialog"
425 printlog "In toolbox click 'Area'"
428 Warnlog "#i56594#Shortcut selecting objects doesn't work"
432 printlog "Close upcoming dialog"
434 Active.SetPage TabArea
438 printlog "Close active document"
442 '-----------------------------------------------------------
446 printlog "- Draw Functions-Objectbar: Rest"
447 if gApplication = "HTML" then
448 printlog "This test does not apply to HTML documents"
449 Printlog "Not in WriterWeb!"
453 printlog "Open new document"
455 printlog "Insert a draw object ( rectangle )"
456 Call wZeichenobjektEinfuegen ( "Rechteck", 30, 30, 50, 60 )
457 ' Set focus to document
458 Call gMouseMove2 ( 50, 25 )
459 Call gMouseClick ( 50, 25 )
460 printlog "Select drawing object with shortcut 'Shift F4'"
461 Call wTypeKeys ( "<Shift F4>" )
463 printlog " - Object rotation mode"
466 printlog "Intoolbox click 'Object rotation mode'"
467 Kontext "DrawingObjectbar"
471 Warnlog "Shortcut selecting objects doesn't work"
476 printlog " - Change Anchor"
477 printlog "Click 'Change Anchor' in Toolbox and select 1st entry in anchor list"
478 VerankerungWechseln.Click
480 Call hMenuSelectNr (1)
483 VerankerungWechseln.Click
484 printlog "Click 'Change Anchor' in Toolbox and select 2nd entry in anchor list"
486 Call hMenuSelectNr (2)
489 VerankerungWechseln.Click
491 printlog "Click 'Change Anchor' in Toolbox and select 3rd entry in anchor list"
492 Call hMenuSelectNr (3)
495 printlog " - To Background"
496 printlog "Click 'To Background' in toolbox"
497 InDenHintergrund.Click
499 printlog " - To Foreground"
500 printlog "Click 'To Foreground' in toolbox"
501 InDenVordergrund.Click
503 printlog " - Send to back"
504 printlog "Click 'Send To back' in toolbox"
507 printlog " - Bring to Front"
508 printlog "Click 'To Background' in toolbox"
511 printlog "Close active document"
515 '-----------------------------------------------------------
518 printlog "- Draw Functions-Objectbar: Text"
519 if gApplication = "HTML" then
520 printlog "This test does not apply to HTML documents"
521 Printlog "Not in WriterWeb!"
525 printlog "Open new document"
528 Call wZeichenobjektEinfuegen ( "Text", 30, 30, 50, 60 )
529 printlog "Insert draw object ( Text )"
530 printlog "Insert some text to textbox"
531 Call wTypeKeys ("Draw Functions-Objectbar: Text")
532 printlog "Select the text in textbox with <Strg A>"
533 Call wTypeKeys ("<Mod1 A>", 3)
536 Kontext "DrawTextObjectBar"
537 if DrawTextObjectBar.Exists = false then
538 Call hToolbarSelect("TextObject", true)
541 printlog " - Font Size"
542 printlog "For font size select 9th entry"
544 Schriftgroesse.Select 9
545 Schriftgroesse.TypeKeys "<Return>"
547 Warnlog "Unable to change font size"
552 printlog "In object bar select 6th entry in combobox 'Font'"
556 Warnlog "Unable to select font in object bar"
558 Schriftart.TypeKeys "<Return>"
562 printlog "Click 'Bold' in object bar"
567 printlog "Click 'Italic' in object bar"
571 printlog " - Underline"
572 printlog "Click 'Underline' in object bar"
576 printlog " - Align Left"
577 printlog "Click Align left in object bar"
581 printlog " - Align Right"
582 printlog "Click 'Align right' in object bar"
586 printlog " - Centered"
587 printlog "Click 'Centered' in object bar"
591 printlog " - Justify"
592 printlog "Click 'Justify' in object bar"
596 printlog " - Superscript"
597 printlog "Click 'Superscript' in object bar"
602 Warnlog "- Superscript is probably faded out!"
605 printlog " - Subscript"
607 printlog "Click 'Subscript' in object bar"
611 Warnlog "- Subscript is probably faded out!"
614 printlog " - Font attributes"
616 printlog "Click 'Font attributes' in object bar"
619 printlog "Close upcoming dialog"
621 Active.Setpage TabFont
625 Kontext "TextObjectbar"
627 Warnlog "- Font attributes is probably faded out!"
630 printlog " - Format:Paragraph"
633 printlog "Click Format:Paragraph in object bar"
636 printlog "Close upcoming dialog"
638 Active.Setpage TabEinzuegeUndAbstaende
639 Kontext "TabEinzuegeUndAbstaende"
640 TabEinzuegeUndAbstaende.OK
643 Warnlog "- Format:Paragraph is probably faded out!"
646 printlog "Close active document"
650 '-----------------------------------------------------------
652 testcase tZOVerticalText
653 printlog "- Draw Functions-Objectbar: Vertical Text"
654 if gAsianSup = False then goto endsub
655 if gApplication = "HTML" then
656 printlog "This test applies not to HTML document and only if Asian Support is enabled"
657 Printlog "Not in WriterWeb!"
661 printlog "Open new document"
664 printlog "Insert Draw object ( 'vertical Text' )"
665 Call wZeichenobjektEinfuegen ( "VText", 30, 30, 50, 60 )
666 printlog "Insert some text in textbox and select it"
667 Call wTypeKeys ("Checking vertical text")
668 Call wTypeKeys ("<Shift Home>")
671 printlog "In object bar select 6th entry in combobox 'Font'"
672 Call hToolbarSelect ( "Textobject", true )
675 Schriftart.TypeKeys "<Return>"
678 printlog " - Font Size"
679 printlog "For font size select 9th entry"
680 Schriftgroesse.Select 9
681 Schriftgroesse.TypeKeys "<Return>"
685 printlog "Click 'Bold' in object bar"
690 printlog "Click 'Italic' in object bar"
694 printlog " - Underline"
695 printlog "Click 'Underline' in object bar"
699 printlog " - Align Left"
700 printlog "Click 'Align left' in object bar"
704 printlog " - Align Right"
705 printlog "Click 'Align Right' in object bar"
709 printlog " - Centered"
710 printlog "Click 'Centered' in object bar"
714 printlog " - Justify"
715 printlog "Click 'Justify' in object bar"
719 printlog " - Superscript"
721 printlog "Click 'Superscript' in object bar"
725 Warnlog "- Superscript is probably faded out!"
728 printlog " - Subscript"
730 printlog "Click 'Subscript' in object bar"
734 Warnlog "- Subscript is probably faded out!"
737 printlog " - Font attributes"
739 printlog "Click 'Font attributes' in object bar"
743 Active.Setpage TabFont
747 Kontext "TextObjectbar"
749 Warnlog "- Font attributes is probably faded out!"
752 printlog " - Format:Paragraph"
756 printlog "Click 'Textdirection:Left To Right' in Objectbar"
757 TextdirectionLeftToRight.Click
760 Warnlog "Textdirection Left To Right probably faded out!"
764 printlog "Click 'Textdirection:Top to Bottom' in Objectbar"
765 TextdirectionTopToBottom.Click
768 Warnlog "Textdirection Top to Bottom probably faded out!"
772 printlog "Click 'Format: Paragraph' in object bar."
775 printlog "Close upcoming dialog"
777 Active.Setpage TabEinzuegeUndAbstaende
778 Kontext "TabEinzuegeUndAbstaende"
779 TabEinzuegeUndAbstaende.OK
782 Warnlog "- Format:Paragraph is probably faded out!"
785 printlog "Close active document"