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 : helge.delfs@oracle.com
30 '* short description : Testcases for the Objectbars.
32 '\******************************************************************
36 printLog Chr(13) + "--------- Objectbars . Part two. (w_010_1.inc) ----------"
37 gApplication = "WRITER"
48 ' ** Graphics ( same as OLE-Objects and Frames )
54 Call tGraphicProperties
63 Call tHtmlDocGraphicWrap
64 Call tHtmlDocGraphicAlign
65 Call tHtmlDocGraphicProperties
66 gApplication = "WRITER"
69 '-----------------------------------------------------------
71 testcase tInsertFormula
72 printlog "- Table-Objectbar: Formula border in Writer"
73 printlog " Open new document"
75 printlog " Insert a table"
76 Call hTabelleEinfuegen
77 printlog " Click 'Sum' in object bar"
78 Call hToolbarSelect ( "Table", true )
79 if TableObjectbar.IsVisible = true then
83 Warnlog "Unable to access 'Formula'-Button on toolbar!"
88 Warnlog "TableObjectbar is not visible!"
94 Kontext "OL_SW_Rechenleiste"
95 if OL_SW_Rechenleiste.NotExists then
96 warnlog "Formula border doesn't come up"
98 printlog " Click 'Cancel' in object bar"
102 printlog " Close active document"
106 '-----------------------------------------------------------
109 printlog "- Table-Objectbar: Merge Cells"
110 printlog " Open new document"
112 printlog " Insert a table"
113 Call hTabelleEinfuegen
114 printlog " Hit <Shift Right> 2 times"
115 Call wTypeKeys ("<Shift Right>", 2)
117 printlog " Click 'Merge cells' in object bar"
118 Call hToolbarSelect ( "Table", true )
119 if TableObjectbar.IsVisible = true then
120 ZellenVerbinden.Click
122 Warnlog "TableObjectbar is not visible!"
127 printlog " Close active document"
131 '-----------------------------------------------------------
134 printlog "- Table-Objectbar: Split Cells"
135 printlog " Open new document"
137 printlog " Insert a table"
138 Call hTabelleEinfuegen
139 Call hToolbarSelect ( "Table", true )
140 printlog " Click 'Split Cells' in object bar"
141 if TableObjectbar.IsVisible = true then
144 Warnlog "TableObjectbar is not visible!"
148 printlog " Cancel upcoming dialog"
149 Kontext "ZellenTeilen"
151 printlog " Close active document"
155 '-----------------------------------------------------------
158 printlog "- Table-Objectbar: Optimize Table"
159 printlog " Open new document"
162 printlog " Insert a table and select all in document"
163 Call hTabelleEinfuegen
164 Call wTypeKeys ("<Mod1 A>")
165 Call hToolbarSelect ( "Table", true )
167 printlog " Tear Off toolbar 'Optimize'"
168 Kontext "TableObjectBar"
172 Warnlog "Unable to Tear Off Toolbox 'Optimize'"
176 Call wTypeKeys ("<Mod1 a>")
179 Kontext "OptimizeTablebar"
180 printlog " Click 'Space Columns Equally'"
181 SpaltenGleichmaessig.Click
182 printlog " Click 'Space Rows Equally'"
183 ZeilenGleichmaessig.Click
185 printlog " Click 'Optimal Row Height'"
186 OptimaleZeilenhoehe.Click
188 Call wTypeKeys ("Optimize Table")
189 printlog " Enter some text"
191 Kontext "OptimizeTablebar"
192 printlog " Click 'Optimal Column Width'"
193 OptimaleSpaltenbreite.Click
195 printlog " Close toolbar 'Optimize'"
196 OptimizeTablebar.Close
197 printlog " Close active document"
201 '-----------------------------------------------------------
203 testcase tInsertCellRow
204 printlog "- Table-Objectbar: Insert Cell"
205 printlog " Open new document"
207 printlog " Insert Table"
208 Call hTabelleEinfuegen
209 Call hToolbarSelect ( "Table", true )
210 if TableObjectbar.IsVisible = true then
213 Warnlog "TableObjectbar is not visible!"
218 printlog " Click 'Insert Column' in object bar"
220 printlog "- Table-Objectbar: Insert Row"
221 printlog " Click 'Insert Row' in object bar"
222 SpalteEinfuegen.Click
223 printlog " Close active document"
227 '-----------------------------------------------------------
230 printlog "- Table-Objectbar: Delete Row"
231 printlog " Open new document"
233 printlog " Insert a table"
234 Call hTabelleEinfuegen
235 Call hToolbarSelect ( "Table", true )
236 printlog " Click 'Delete Row'"
237 if TableObjectbar.IsVisible = true then
240 Warnlog "TableObjectbar is not visible!"
246 printlog " Click 'Delete Row'"
248 printlog " Close active document"
252 '-----------------------------------------------------------
254 testcase tDeleteColumn
256 printlog "- Table-Objectbar: Delete Column"
257 printlog " Open new document"
259 printlog " Insert a table"
260 Call hTabelleEinfuegen
261 printlog " Click 'Delete Column' 2 times"
263 Call hToolbarSelect ( "Table", true )
264 if TableObjectbar.IsVisible = true then
267 Warnlog "TableObjectbar is not visible!"
273 printlog " Close active document"
277 '-----------------------------------------------------------
279 testcase tGraphicWrap
280 printlog "- Grafik-(Rahmen)-Objectbar: Wrap"
281 printlog " Open new document"
283 printlog " Insert graphic 'writer/input/grafik/jolink.jpg'"
284 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
285 Call hToolbarSelect("Frame", true)
287 printlog " Check 'Wrap Off' in object bar"
291 Warnlog "'Wrap Off' in Objectbar couldn't be checked"
294 if gApplication <> "HTML" then
296 printlog " Check 'Wrap through' in object bar"
300 Warnlog "'Wrap through' in Objectbar couldn't be checked"
304 printlog " Check 'Wrap On' in object bar"
308 Warnlog "'Wrap on' in Objectbar couldn't be checked"
311 Call hToolbarSelect("Picture", true)
313 printlog " Check 'Wrap Left' in object bar"
317 Warnlog "'Wrap Left' in Objectbar couldn't be checked"
321 printlog " Check 'Wrap Right' in object bar"
325 Warnlog "'Wrap Right' in Objectbar couldn't be checked"
329 printlog " Close active document"
333 '-----------------------------------------------------------
335 testcase tGraphicAlign
336 printlog "- Graphic-(Frame)-Objectbar: Align"
337 printlog " Open new document"
339 printlog " Insert graphic 'writer/input/grafik/jolink.jpg'"
340 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
342 Call hToolbarSelect("Frame", true)
344 printlog " Click 'Left' in object bar"
348 Warnlog "'Left' in Objectbar couldn't be checked"
352 printlog " Click 'Right' in object bar"
356 Warnlog "'Right' in Objectbar couldn't be checked"
359 ' Only Left and Right in WriterWeb
360 if gApplication = "HTML" then
361 printlog " Close active document"
367 printlog " Click 'Centered' in object bar (Not WriterWeb)"
371 Warnlog "'Centered' in Objectbar couldn't be checked"
375 printlog " Click 'Center' in object bar (Not WriterWeb)"
379 Warnlog "'Center' in Objectbar couldn't be checked"
383 printlog " Click 'Top' in object bar (Not WriterWeb)"
387 Warnlog "'Top' in Objectbar couldn't be checked"
391 printlog " Click 'Bottom' in object bar (Not WriterWeb)"
395 Warnlog "'Bottom' auf Objectbar couldn't be checked"
398 printlog " Close active document"
402 '-----------------------------------------------------------
404 testcase tGraphicFlip
405 printlog "- Graphic-(Frame)-Objectbar: Flip"
406 if gApplication = "HTML" then
407 Printlog "Not in WriterWeb!"
411 printlog " Open new document"
413 printlog " Insert graphic 'writer/input/grafik/jolink.jpg'"
414 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
416 Call hToolbarSelect("Picture", true)
418 printlog " Click 'Flip Horizontal' in object bar"
419 HorizontalSpiegeln.Click
422 Warnlog "'Flip Horizontal' in Objectbar couldn't be checked"
426 printlog " Click 'Flip Vertical' in object bar"
427 VertikalSpiegeln.Click
430 Warnlog "'Flip vertical' in Objectbar couldn't be checked"
434 printlog " Click 'Flip Horizontal' in object bar"
435 HorizontalSpiegeln.Click
437 printlog " Click 'Flip Vertical' in object bar"
438 VertikalSpiegeln.Click
443 printlog " Close active document"
447 '-----------------------------------------------------------
449 testcase tGraphicArrange
450 printlog "- Graphic-(Frame)-Objectbar: Arrange"
451 printlog " Open new document"
453 printlog " Insert graphic 'writer/input/grafik/jolink.jpg'"
454 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
456 Call hToolbarSelect("Frame", true)
458 printlog " Click 'Send to back' in object bar"
462 Warnlog "'Send to back' in Objectbar couldn't be checked"
466 printlog " Click 'Bring to front' in object bar"
470 Warnlog "'Bring to front' in Objectbar couldn't be checked"
473 printlog " Close active document"
477 '-----------------------------------------------------------
479 testcase tGraphicBorders
480 printlog "- Graphic-(Frame)-Objectbar: Border"
481 printlog " Open new document"
483 printlog " Insert graphic 'writer/input/grafik/jolink.jpg'"
484 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
485 Call hToolbarSelect("Frame", true)
487 printlog " Tear off Toolbox Border"
490 Kontext "TB_Umrandung"
491 TB_Umrandung.Move ( 20, 20 )
492 printlog " Close toolbox"
496 Warnlog "Error in Toolbox Border"
500 Kontext "FrameObjectbar"
501 printlog " Tear off toolbox 'Borderstyle'"
504 Kontext "TB_Umrandungsstil"
505 TB_Umrandungsstil.Move ( 20, 20 )
506 printlog " Close toolbox"
507 TB_Umrandungsstil.Close
510 Warnlog "Error in Toolbox Borderstyle"
514 Kontext "FrameObjectbar"
515 printlog " Tear off Toolbox 'Color'"
519 TB_Farbe.Move ( 20, 20 )
521 printlog " Close toolbox"
524 warnlog "Error in Toolbox Colour"
527 printlog " Close active document"
531 '-----------------------------------------------------------
533 testcase tGraphicProperties
534 printlog "- Graphic-(Frame)-Objectbar: Properties"
537 printlog " Open new document"
539 printlog " Insert graphic 'writer/input/grafik/jolink.jpg'"
540 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
541 Call hToolbarSelect("Picture", true)
543 printlog " Click 'Graphic Properties' in object bar"
546 Warnlog "Error in Objectproperties in Objectbar"
547 printlog " Close active document"
552 printlog " In 'Graphic' dialog step through all tabpages"
554 active.SetPage TabType
556 Call DialogTest ( TabType )
559 active.SetPage TabZusaetze
560 Kontext "TabZusaetze"
561 Call DialogTest ( TabZusaetze )
564 active.SetPage TabUmlauf
566 Call DialogTest ( TabUmlauf )
569 active.SetPage TabHyperlinkRahmen
570 Kontext "TabHyperlinkRahmen"
571 Call DialogTest ( TabHyperlinkRahmen )
574 active.SetPage TabGrafik
576 Call DialogTest ( TabGrafik )
579 active.SetPage TabUmrandung
580 Kontext "TabUmrandung"
581 Call DialogTest ( TabUmrandung )
584 active.SetPage TabMakro
585 ' if no JRE is installed a messagebox appears
589 if Active.Exists then
590 if Active.GetRT = 304 then
591 if j = 1 then Warnlog Active.Gettext
601 Call DialogTest ( TabMakro )
603 printlog " Close 'Graphic' dialog"
604 if gApplication <> "HTML" then
606 active.SetPage TabHintergrund
607 Kontext "TabHintergrund"
608 Call DialogTest ( TabHintergrund )
611 active.SetPage TabZuschneiden
612 Kontext "TabZuschneiden"
613 Call DialogTest ( TabZuschneiden )
614 TabZuschneiden.Cancel
618 printlog " Close active document"
622 '-----------------------------------------------------------
624 testcase tGraphicAnchor
626 printlog "- Graphic-(Frame)-Objectbar: Anchor"
627 printlog " Open new document"
629 printlog " Insert graphic 'writer/input/grafik/jolink.jpg'"
630 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
632 Call hToolbarSelect("Frame", true)
634 printlog " Select Anchor 'to page'"
636 VerankerungWechseln.Click
637 printlog " Click 'Change Anchor' in object bar"
639 Warnlog "Error on anchoring objects"
641 printlog " Close active document"
645 MenuSelect ( MenuGetItemID (1) )
647 printlog " Select Anchor 'Paragraph'"
648 Kontext "FrameObjectbar"
649 VerankerungWechseln.Click
650 MenuSelect ( MenuGetItemID (2) )
652 printlog " Select Anchor 'To Character'"
653 Kontext "FrameObjectbar"
654 VerankerungWechseln.Click
655 MenuSelect ( MenuGetItemID (3) )
657 printlog " Select Anchor 'As Character'"
658 Kontext "FrameObjectbar"
659 VerankerungWechseln.Click
660 MenuSelect ( MenuGetItemID (4) )
663 printlog " Close active document"
667 '-----------------------------------------------------------
669 testcase tFormulaCancel
670 printlog "- Formula Writer: Cancel"
671 printlog " Open new document"
673 printlog " Press <F2>"
674 Call wTypeKeys ("<F2>")
676 printlog " enter a formula"
677 Kontext "OL_SW_Rechenleiste"
678 Eingabefeld.TypeKeys "=summe(a+b)"
679 printlog " Click 'Cancel' in formula bar"
681 printlog " Close active document"
685 '-----------------------------------------------------------
687 testcase tFormulaApply
688 printlog "- Formula Writer: Apply"
690 printlog " Open new document"
691 Call hTabelleEinfuegen
692 printlog " Insert a table"
693 Call wTypeKeys ("12<Right>13<Down>")
694 printlog " Write in document 12<Cursor Right>13<Cursor Down>"
695 Call hToolbarSelect ( "Table", true )
696 printlog " Click 'Sum' in object bar"
697 if TableObjectbar.IsVisible = true then
700 Warnlog "TableObjectbar is not visible!"
705 Kontext "OL_SW_Rechenleiste"
706 Eingabefeld.TypeKeys "(" + Chr(60)+ "A1:B1"
707 Eingabefeld.TypeKeys Chr(62) + ")"
708 printlog " Enter as formula (A1:B1) and click 'Apply'"
711 printlog " Check result of formula"
712 Call wTypeKeys ("<Mod1 A>")
714 if GetClipboardText <> "25" then
715 warnlog "Not possible to calculate in tables anymore. Result isn't 25, is: " + GetClipboardText
717 printlog " Close active document"
721 '-----------------------------------------------------------
723 testcase tHtmlDocGraphicWrap
724 printlog "- Grafik-(Rahmen)-Objectbar: Wrap"
725 gApplication = "HTML"
727 printlog " Open new document"
730 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
731 printlog " Insert graphic 'writer/input/grafik/jolink.jpg'"
732 Call hToolbarSelect("Frame", true)
734 printlog " Check 'Wrap Off' in object bar"
738 Warnlog "'Wrap Off' in Objectbar couldn't be checked"
741 Call hToolbarSelect("Picture", true)
744 printlog " Check 'Wrap Left' in object bar"
747 Warnlog "'Wrap Left' in Objectbar couldn't be checked"
751 printlog " Check 'Wrap Right' in object bar"
755 Warnlog "'Wrap Right' in Objectbar couldn't be checked"
759 printlog " Close active document"
760 gApplication = "WRITER"
763 '-----------------------------------------------------------
765 testcase tHtmlDocGraphicAlign
766 printlog "- Graphic-(Frame)-Objectbar: Align"
767 gApplication = "HTML"
769 printlog " Open new document"
771 printlog " Insert graphic 'writer/input/grafik/jolink.jpg'"
772 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
774 Call hToolbarSelect("Frame", true)
777 printlog " Click 'Left' in object bar"
780 Warnlog "'Left' in Objectbar couldn't be checked"
785 printlog " Click 'Right' in object bar"
788 Warnlog "'Right' in Objectbar couldn't be checked"
791 ' Only Left and Right in WriterWeb
792 printlog " Close active document"
794 gApplication = "WRITER"
797 '-----------------------------------------------------------
799 testcase tHtmlDocGraphicProperties
800 printlog "- Graphic-(Frame)-Objectbar: Properties"
803 gApplication = "HTML"
804 printlog " Open new document"
807 printlog " Insert graphic 'writer/input/grafik/jolink.jpg'"
808 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
809 Call hToolbarSelect("Picture", true)
811 printlog " Click 'Graphic Properties' in object bar"
814 Warnlog "Error in Objectproperties in Objectbar"
815 printlog " Close active document"
820 printlog " In 'Graphic' dialog step through all tabpages"
822 active.SetPage TabType
824 Call DialogTest ( TabType )
827 active.SetPage TabZusaetze
828 Kontext "TabZusaetze"
829 Call DialogTest ( TabZusaetze )
832 active.SetPage TabUmlauf
834 Call DialogTest ( TabUmlauf )
837 active.SetPage TabHyperlinkRahmen
838 Kontext "TabHyperlinkRahmen"
839 Call DialogTest ( TabHyperlinkRahmen )
842 active.SetPage TabGrafik
844 Call DialogTest ( TabGrafik )
847 active.SetPage TabUmrandung
848 Kontext "TabUmrandung"
849 Call DialogTest ( TabUmrandung )
852 active.SetPage TabMakro
853 ' if no JRE is installed a messagebox appears
857 if Active.Exists then
858 if Active.GetRT = 304 then
859 if j = 1 then Warnlog Active.Gettext
869 Call DialogTest ( TabMakro )
870 printlog " Close dialog"
873 printlog " Close active document"
875 gApplication = "WRITER"
878 '-----------------------------------------------------------