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_010_1.inc,v $
13 '* last change: $Author: fredrikh $ $Date: 2008-06-18 08:26:31 $
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 : Testcases for the Objectbars.
38 '\******************************************************************
42 printLog Chr(13) + "--------- Objectbars . Part two. (w_010_1.inc) ----------"
43 gApplication = "WRITER"
54 ' ** Graphics ( same as OLE-Objects and Frames )
60 Call tGraphicProperties
69 Call tHtmlDocGraphicWrap
70 Call tHtmlDocGraphicAlign
71 Call tHtmlDocGraphicProperties
72 gApplication = "WRITER"
75 '-----------------------------------------------------------
77 testcase tInsertFormula
78 printlog "- Table-Objectbar: Formula border in Writer"
79 printlog " Open new document"
81 printlog " Insert a table"
82 Call hTabelleEinfuegen
83 printlog " Click 'Sum' in object bar"
84 Call hToolbarSelect ( "Table", true )
85 if TableObjectbar.IsVisible = true then
89 Warnlog "Unable to access 'Formula'-Button on toolbar!"
94 Warnlog "TableObjectbar is not visible!"
100 Kontext "OL_SW_Rechenleiste"
101 if OL_SW_Rechenleiste.NotExists then
102 warnlog "Formula border doesn't come up"
104 printlog " Click 'Cancel' in object bar"
108 printlog " Close active document"
112 '-----------------------------------------------------------
115 printlog "- Table-Objectbar: Merge Cells"
116 printlog " Open new document"
118 printlog " Insert a table"
119 Call hTabelleEinfuegen
120 printlog " Hit <Shift Right> 2 times"
121 Call wTypeKeys ("<Shift Right>", 2)
123 printlog " Click 'Merge cells' in object bar"
124 Call hToolbarSelect ( "Table", true )
125 if TableObjectbar.IsVisible = true then
126 ZellenVerbinden.Click
128 Warnlog "TableObjectbar is not visible!"
133 printlog " Close active document"
137 '-----------------------------------------------------------
140 printlog "- Table-Objectbar: Split Cells"
141 printlog " Open new document"
143 printlog " Insert a table"
144 Call hTabelleEinfuegen
145 Call hToolbarSelect ( "Table", true )
146 printlog " Click 'Split Cells' in object bar"
147 if TableObjectbar.IsVisible = true then
150 Warnlog "TableObjectbar is not visible!"
154 printlog " Cancel upcoming dialog"
155 Kontext "ZellenTeilen"
157 printlog " Close active document"
161 '-----------------------------------------------------------
164 printlog "- Table-Objectbar: Optimize Table"
165 printlog " Open new document"
168 printlog " Insert a table and select all in document"
169 Call hTabelleEinfuegen
170 Call wTypeKeys ("<Mod1 A>")
171 Call hToolbarSelect ( "Table", true )
173 printlog " Tear Off toolbar 'Optimize'"
174 Kontext "TableObjectBar"
178 Warnlog "Unable to Tear Off Toolbox 'Optimize'"
182 Call wTypeKeys ("<Mod1 a>")
185 Kontext "OptimizeTablebar"
186 printlog " Click 'Space Columns Equally'"
187 SpaltenGleichmaessig.Click
188 printlog " Click 'Space Rows Equally'"
189 ZeilenGleichmaessig.Click
191 printlog " Click 'Optimal Row Height'"
192 OptimaleZeilenhoehe.Click
194 Call wTypeKeys ("Optimize Table")
195 printlog " Enter some text"
197 Kontext "OptimizeTablebar"
198 printlog " Click 'Optimal Column Width'"
199 OptimaleSpaltenbreite.Click
201 printlog " Close toolbar 'Optimize'"
202 OptimizeTablebar.Close
203 printlog " Close active document"
207 '-----------------------------------------------------------
209 testcase tInsertCellRow
210 printlog "- Table-Objectbar: Insert Cell"
211 printlog " Open new document"
213 printlog " Insert Table"
214 Call hTabelleEinfuegen
215 Call hToolbarSelect ( "Table", true )
216 if TableObjectbar.IsVisible = true then
219 Warnlog "TableObjectbar is not visible!"
224 printlog " Click 'Insert Column' in object bar"
226 printlog "- Table-Objectbar: Insert Row"
227 printlog " Click 'Insert Row' in object bar"
228 SpalteEinfuegen.Click
229 printlog " Close active document"
233 '-----------------------------------------------------------
236 printlog "- Table-Objectbar: Delete Row"
237 printlog " Open new document"
239 printlog " Insert a table"
240 Call hTabelleEinfuegen
241 Call hToolbarSelect ( "Table", true )
242 printlog " Click 'Delete Row'"
243 if TableObjectbar.IsVisible = true then
246 Warnlog "TableObjectbar is not visible!"
252 printlog " Click 'Delete Row'"
254 printlog " Close active document"
258 '-----------------------------------------------------------
260 testcase tDeleteColumn
262 printlog "- Table-Objectbar: Delete Column"
263 printlog " Open new document"
265 printlog " Insert a table"
266 Call hTabelleEinfuegen
267 printlog " Click 'Delete Column' 2 times"
269 Call hToolbarSelect ( "Table", true )
270 if TableObjectbar.IsVisible = true then
273 Warnlog "TableObjectbar is not visible!"
279 printlog " Close active document"
283 '-----------------------------------------------------------
285 testcase tGraphicWrap
286 printlog "- Grafik-(Rahmen)-Objectbar: Wrap"
287 printlog " Open new document"
289 printlog " Insert graphic 'writer/input/grafik/jolink.jpg'"
290 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
291 Call hToolbarSelect("Frame", true)
293 printlog " Check 'Wrap Off' in object bar"
297 Warnlog "'Wrap Off' in Objectbar couldn't be checked"
300 if gApplication <> "HTML" then
302 printlog " Check 'Wrap through' in object bar"
306 Warnlog "'Wrap through' in Objectbar couldn't be checked"
310 printlog " Check 'Wrap On' in object bar"
314 Warnlog "'Wrap on' in Objectbar couldn't be checked"
317 Call hToolbarSelect("Picture", true)
319 printlog " Check 'Wrap Left' in object bar"
323 Warnlog "'Wrap Left' in Objectbar couldn't be checked"
327 printlog " Check 'Wrap Right' in object bar"
331 Warnlog "'Wrap Right' in Objectbar couldn't be checked"
335 printlog " Close active document"
339 '-----------------------------------------------------------
341 testcase tGraphicAlign
342 printlog "- Graphic-(Frame)-Objectbar: Align"
343 printlog " Open new document"
345 printlog " Insert graphic 'writer/input/grafik/jolink.jpg'"
346 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
348 Call hToolbarSelect("Frame", true)
350 printlog " Click 'Left' in object bar"
354 Warnlog "'Left' in Objectbar couldn't be checked"
358 printlog " Click 'Right' in object bar"
362 Warnlog "'Right' in Objectbar couldn't be checked"
365 ' Only Left and Right in WriterWeb
366 if gApplication = "HTML" then
367 printlog " Close active document"
373 printlog " Click 'Centered' in object bar (Not WriterWeb)"
377 Warnlog "'Centered' in Objectbar couldn't be checked"
381 printlog " Click 'Center' in object bar (Not WriterWeb)"
385 Warnlog "'Center' in Objectbar couldn't be checked"
389 printlog " Click 'Top' in object bar (Not WriterWeb)"
393 Warnlog "'Top' in Objectbar couldn't be checked"
397 printlog " Click 'Bottom' in object bar (Not WriterWeb)"
401 Warnlog "'Bottom' auf Objectbar couldn't be checked"
404 printlog " Close active document"
408 '-----------------------------------------------------------
410 testcase tGraphicFlip
411 printlog "- Graphic-(Frame)-Objectbar: Flip"
412 if gApplication = "HTML" then
413 Printlog "Not in WriterWeb!"
417 printlog " Open new document"
419 printlog " Insert graphic 'writer/input/grafik/jolink.jpg'"
420 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
422 Call hToolbarSelect("Picture", true)
424 printlog " Click 'Flip Horizontal' in object bar"
425 HorizontalSpiegeln.Click
428 Warnlog "'Flip Horizontal' in Objectbar couldn't be checked"
432 printlog " Click 'Flip Vertical' in object bar"
433 VertikalSpiegeln.Click
436 Warnlog "'Flip vertical' in Objectbar couldn't be checked"
440 printlog " Click 'Flip Horizontal' in object bar"
441 HorizontalSpiegeln.Click
443 printlog " Click 'Flip Vertical' in object bar"
444 VertikalSpiegeln.Click
449 printlog " Close active document"
453 '-----------------------------------------------------------
455 testcase tGraphicArrange
456 printlog "- Graphic-(Frame)-Objectbar: Arrange"
457 printlog " Open new document"
459 printlog " Insert graphic 'writer/input/grafik/jolink.jpg'"
460 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
462 Call hToolbarSelect("Frame", true)
464 printlog " Click 'Send to back' in object bar"
468 Warnlog "'Send to back' in Objectbar couldn't be checked"
472 printlog " Click 'Bring to front' in object bar"
476 Warnlog "'Bring to front' in Objectbar couldn't be checked"
479 printlog " Close active document"
483 '-----------------------------------------------------------
485 testcase tGraphicBorders
486 printlog "- Graphic-(Frame)-Objectbar: Border"
487 printlog " Open new document"
489 printlog " Insert graphic 'writer/input/grafik/jolink.jpg'"
490 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
491 Call hToolbarSelect("Frame", true)
493 printlog " Tear off Toolbox Border"
496 Kontext "TB_Umrandung"
497 TB_Umrandung.Move ( 20, 20 )
498 printlog " Close toolbox"
502 Warnlog "Error in Toolbox Border"
506 Kontext "FrameObjectbar"
507 printlog " Tear off toolbox 'Borderstyle'"
510 Kontext "TB_Umrandungsstil"
511 TB_Umrandungsstil.Move ( 20, 20 )
512 printlog " Close toolbox"
513 TB_Umrandungsstil.Close
516 Warnlog "Error in Toolbox Borderstyle"
520 Kontext "FrameObjectbar"
521 printlog " Tear off Toolbox 'Color'"
525 TB_Farbe.Move ( 20, 20 )
527 printlog " Close toolbox"
530 warnlog "Error in Toolbox Colour"
533 printlog " Close active document"
537 '-----------------------------------------------------------
539 testcase tGraphicProperties
540 printlog "- Graphic-(Frame)-Objectbar: Properties"
543 printlog " Open new document"
545 printlog " Insert graphic 'writer/input/grafik/jolink.jpg'"
546 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
547 Call hToolbarSelect("Picture", true)
549 printlog " Click 'Graphic Properties' in object bar"
552 Warnlog "Error in Objectproperties in Objectbar"
553 printlog " Close active document"
558 printlog " In 'Graphic' dialog step through all tabpages"
560 active.SetPage TabType
562 Call DialogTest ( TabType )
565 active.SetPage TabZusaetze
566 Kontext "TabZusaetze"
567 Call DialogTest ( TabZusaetze )
570 active.SetPage TabUmlauf
572 Call DialogTest ( TabUmlauf )
575 active.SetPage TabHyperlinkRahmen
576 Kontext "TabHyperlinkRahmen"
577 Call DialogTest ( TabHyperlinkRahmen )
580 active.SetPage TabGrafik
582 Call DialogTest ( TabGrafik )
585 active.SetPage TabUmrandung
586 Kontext "TabUmrandung"
587 Call DialogTest ( TabUmrandung )
590 active.SetPage TabMakro
591 ' if no JRE is installed a messagebox appears
595 if Active.Exists then
596 if Active.GetRT = 304 then
597 if j = 1 then Warnlog Active.Gettext
607 Call DialogTest ( TabMakro )
609 printlog " Close 'Graphic' dialog"
610 if gApplication <> "HTML" then
612 active.SetPage TabHintergrund
613 Kontext "TabHintergrund"
614 Call DialogTest ( TabHintergrund )
617 active.SetPage TabZuschneiden
618 Kontext "TabZuschneiden"
619 Call DialogTest ( TabZuschneiden )
620 TabZuschneiden.Cancel
624 printlog " Close active document"
628 '-----------------------------------------------------------
630 testcase tGraphicAnchor
632 printlog "- Graphic-(Frame)-Objectbar: Anchor"
633 printlog " Open new document"
635 printlog " Insert graphic 'writer/input/grafik/jolink.jpg'"
636 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
638 Call hToolbarSelect("Frame", true)
640 printlog " Select Anchor 'to page'"
642 VerankerungWechseln.Click
643 printlog " Click 'Change Anchor' in object bar"
645 Warnlog "Error on anchoring objects"
647 printlog " Close active document"
651 MenuSelect ( MenuGetItemID (1) )
653 printlog " Select Anchor 'Paragraph'"
654 Kontext "FrameObjectbar"
655 VerankerungWechseln.Click
656 MenuSelect ( MenuGetItemID (2) )
658 printlog " Select Anchor 'To Character'"
659 Kontext "FrameObjectbar"
660 VerankerungWechseln.Click
661 MenuSelect ( MenuGetItemID (3) )
663 printlog " Select Anchor 'As Character'"
664 Kontext "FrameObjectbar"
665 VerankerungWechseln.Click
666 MenuSelect ( MenuGetItemID (4) )
669 printlog " Close active document"
673 '-----------------------------------------------------------
675 testcase tFormulaCancel
676 printlog "- Formula Writer: Cancel"
677 printlog " Open new document"
679 printlog " Press <F2>"
680 Call wTypeKeys ("<F2>")
682 printlog " enter a formula"
683 Kontext "OL_SW_Rechenleiste"
684 Eingabefeld.TypeKeys "=summe(a+b)"
685 printlog " Click 'Cancel' in formula bar"
687 printlog " Close active document"
691 '-----------------------------------------------------------
693 testcase tFormulaApply
694 printlog "- Formula Writer: Apply"
696 printlog " Open new document"
697 Call hTabelleEinfuegen
698 printlog " Insert a table"
699 Call wTypeKeys ("12<Right>13<Down>")
700 printlog " Write in document 12<Cursor Right>13<Cursor Down>"
701 Call hToolbarSelect ( "Table", true )
702 printlog " Click 'Sum' in object bar"
703 if TableObjectbar.IsVisible = true then
706 Warnlog "TableObjectbar is not visible!"
711 Kontext "OL_SW_Rechenleiste"
712 Eingabefeld.TypeKeys "(" + Chr(60)+ "A1:B1"
713 Eingabefeld.TypeKeys Chr(62) + ")"
714 printlog " Enter as formula (A1:B1) and click 'Apply'"
717 printlog " Check result of formula"
718 Call wTypeKeys ("<Mod1 A>")
720 if GetClipboardText <> "25" then
721 warnlog "Not possible to calculate in tables anymore. Result isn't 25, is: " + GetClipboardText
723 printlog " Close active document"
727 '-----------------------------------------------------------
729 testcase tHtmlDocGraphicWrap
730 printlog "- Grafik-(Rahmen)-Objectbar: Wrap"
731 gApplication = "HTML"
733 printlog " Open new document"
736 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
737 printlog " Insert graphic 'writer/input/grafik/jolink.jpg'"
738 Call hToolbarSelect("Frame", true)
740 printlog " Check 'Wrap Off' in object bar"
744 Warnlog "'Wrap Off' in Objectbar couldn't be checked"
747 Call hToolbarSelect("Picture", true)
750 printlog " Check 'Wrap Left' in object bar"
753 Warnlog "'Wrap Left' in Objectbar couldn't be checked"
757 printlog " Check 'Wrap Right' in object bar"
761 Warnlog "'Wrap Right' in Objectbar couldn't be checked"
765 printlog " Close active document"
766 gApplication = "WRITER"
769 '-----------------------------------------------------------
771 testcase tHtmlDocGraphicAlign
772 printlog "- Graphic-(Frame)-Objectbar: Align"
773 gApplication = "HTML"
775 printlog " Open new document"
777 printlog " Insert graphic 'writer/input/grafik/jolink.jpg'"
778 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
780 Call hToolbarSelect("Frame", true)
783 printlog " Click 'Left' in object bar"
786 Warnlog "'Left' in Objectbar couldn't be checked"
791 printlog " Click 'Right' in object bar"
794 Warnlog "'Right' in Objectbar couldn't be checked"
797 ' Only Left and Right in WriterWeb
798 printlog " Close active document"
800 gApplication = "WRITER"
803 '-----------------------------------------------------------
805 testcase tHtmlDocGraphicProperties
806 printlog "- Graphic-(Frame)-Objectbar: Properties"
809 gApplication = "HTML"
810 printlog " Open new document"
813 printlog " Insert graphic 'writer/input/grafik/jolink.jpg'"
814 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
815 Call hToolbarSelect("Picture", true)
817 printlog " Click 'Graphic Properties' in object bar"
820 Warnlog "Error in Objectproperties in Objectbar"
821 printlog " Close active document"
826 printlog " In 'Graphic' dialog step through all tabpages"
828 active.SetPage TabType
830 Call DialogTest ( TabType )
833 active.SetPage TabZusaetze
834 Kontext "TabZusaetze"
835 Call DialogTest ( TabZusaetze )
838 active.SetPage TabUmlauf
840 Call DialogTest ( TabUmlauf )
843 active.SetPage TabHyperlinkRahmen
844 Kontext "TabHyperlinkRahmen"
845 Call DialogTest ( TabHyperlinkRahmen )
848 active.SetPage TabGrafik
850 Call DialogTest ( TabGrafik )
853 active.SetPage TabUmrandung
854 Kontext "TabUmrandung"
855 Call DialogTest ( TabUmrandung )
858 active.SetPage TabMakro
859 ' if no JRE is installed a messagebox appears
863 if Active.Exists then
864 if Active.GetRT = 304 then
865 if j = 1 then Warnlog Active.Gettext
875 Call DialogTest ( TabMakro )
876 printlog " Close dialog"
879 printlog " Close active document"
881 gApplication = "WRITER"
884 '-----------------------------------------------------------