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@Sun.Com
30 '* short description : Testcases with connection to the Insert-menu part II.
32 '\***********************************************************************
36 printLog Chr(13) + "--------- Insert Menu ( w_004_ ) ----------"
38 gApplication = "WRITER"
39 call tInsertHorizontalLine
40 call tInsertGraphicsFromFile
41 call tInsertAllGraphicsFromFile
42 call tInsertObjectOLEObject
43 call tInsertObjectPlugIn
44 call tInsertObjectSound
45 call tInsertObjectVideo
46 call tInsertObjectFormula
47 call tInsertObjectChart
51 call tHtmlDocInsertFields
52 call tHtmlDocInsertFieldsOther
53 call tHtmlDocInsertSection
54 call tHtmlDocInsertFrame
55 call tHtmlDocInsertGraphicsFromFile
56 gApplication = "WRITER"
60 testcase tInsertHorizontalLine
61 PrintLog "- Insert / Horizontal Line"
63 printlog " Open new document"
66 printlog " Insert / Horizontal Line"
68 Kontext "HorizontaleLinieEinfuegen"
69 Call DialogTest (HorizontaleLinieEinfuegen)
70 printlog " Close dialog 'Insert Horizontal Ruler'"
71 HorizontaleLinieEinfuegen.Cancel
73 printlog " Close active document"
77 '-----------------------------------------------------------
79 testcase tInsertGraphicsFromFile
80 PrintLog "- Insert / Graphics / From File"
83 printlog " Open new document"
86 printlog " Insert / Graphics from file"
87 InsertGraphicsFromFile
89 Kontext "GrafikEinfuegenDlg"
90 printlog " Select as graphic to insert: '...\writer\required\input\graphics\jolink.jpg"
91 Dateiname.Settext ConvertPath ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
95 if Active.Exists( 1 ) then
96 Warnlog Active.Gettext
98 Kontext "GrafikEinfuegenDlg"
99 GrafikEinfuegenDlg.Cancel
103 printlog " select again 'Insert / Grahics from file'"
104 InsertGraphicsFromFile
106 printlog " Step through all tabpages"
108 active.SetPage TabType
111 Call DialogTest ( TabType )
114 active.SetPage TabZusaetze
116 Kontext "TabZusaetze"
117 Call DialogTest ( TabZusaetze )
120 active.SetPage TabUmlauf
123 Call DialogTest ( TabUmlauf )
126 active.SetPage TabHyperlinkRahmen
128 Kontext "TabHyperlinkRahmen"
129 Call DialogTest ( TabHyperlinkRahmen )
132 active.SetPage TabGrafik
135 Call DialogTest ( TabGrafik )
138 active.SetPage TabUmrandung
140 Kontext "TabUmrandung"
141 Call DialogTest ( TabUmrandung )
144 active.SetPage TabMakro
145 ' if no JRE is installed a messagebox appears
150 if Active.Exists() then
151 if Active.GetRT = 304 then
152 if j = 1 then Warnlog Active.Gettext
163 Call DialogTest ( TabMakro )
165 if gApplication <> "HTML" then
167 active.SetPage TabZuschneiden
169 Kontext "TabZuschneiden"
170 Call DialogTest ( TabZuschneiden )
173 active.SetPage TabHintergrund
175 Kontext "TabHintergrund"
176 Call DialogTest ( TabHintergrund )
177 printlog " Close dialog"
178 TabHintergrund.Cancel
180 printlog " Close dialog"
185 printlog " Close active document"
189 '-----------------------------------------------------------
191 testcase tInsertAllGraphicsFromFile
193 printlog( "Load files of all known graphics formats" )
195 dim iCurrentFile as integer
196 dim GraphicFile as String
197 dim Filtername as String
199 printlog( "Insert a sample of commonly used file formats into a writer document (not linked)" )
201 gApplication = "WRITER"
204 for iCurrentFile = 1 to 25
206 ' MODIFY and ENABLE this SAMPLE snippet to exclude one fileformat from testing
207 ' if ( iCurrentFile = 7 ) AND (gtPlatform="x86") then
208 ' qaErrorLog("#<issue-id># crash on <platform> on loading <image-file>")
211 ' Note: Can be locale dependent!
212 if (iCurrentFile = 4) AND (gPlatform="osx") then
213 qaerrorlog("#i100253# crash on MacOS X on loading ball.eps")
217 Kontext "GrafikEinfuegenDlg"
218 if ( not GrafikEinfuegenDlg.exists() ) then
219 InsertGraphicsFromFile
220 Kontext "GrafikEinfuegenDlg"
223 if ( GrafikEinfuegenDlg.Exists( 2 ) ) then
224 ' the list of files expected to be found in the samples directory
225 select case iCurrentFile
226 case 1 : GraphicFile = "desp.bmp"
227 case 2 : GraphicFile = "columbia.dxf"
228 case 3 : GraphicFile = "extrud.emf"
229 case 4 : GraphicFile = "ball.eps"
230 case 5 : GraphicFile = "airshw.met"
231 case 6 : GraphicFile = "eface.gif"
232 case 7 : GraphicFile = "purzel.gif" ' Animated Gif
233 case 8 : GraphicFile = "borabora.jpg"
234 case 9 : GraphicFile = "grafix1.pbm"
235 case 10 : GraphicFile = "circle.pcx"
236 case 11 : GraphicFile = "papagei1.pcd"
237 case 12 : GraphicFile = "newtonme.pct"
238 case 13 : GraphicFile = "grafix2.pgm"
239 case 14 : GraphicFile = "obst.png"
240 case 15 : GraphicFile = "london.ppm"
241 case 16 : GraphicFile = "tiger.psd"
242 case 17 : GraphicFile = "grafix3.ras"
243 case 18 : GraphicFile = "mickym.sgf"
244 case 19 : GraphicFile = "faxpfeil.sgv"
245 case 20 : GraphicFile = "picture.svm"
246 case 21 : GraphicFile = "pilz.tga"
247 case 22 : GraphicFile = "stabler.tif"
248 case 23 : GraphicFile = "krokodil.wmf"
249 case 24 : GraphicFile = "grafix4.xbm"
250 case 25 : GraphicFile = "papagei2.xpm"
253 GraphicFile = ConvertPath (gTesttoolPath & "global\input\graf_inp\" & GraphicFile)
254 printlog( "Current file " + iCurrentFile + ": " & GraphicFile )
255 printlog( " * Set filter to <All formats>" )
256 DateiName.SetText( GraphicFile )
260 printlog( " * Uncheck Preview- and Link-checkbox, load the file" )
262 Verknuepfen.unCheck()
267 if ( Active.Exists() ) then
268 Warnlog( "Unexpected messagebox: " & Active.GetText() )
269 Warnlog( "Affected file: " & GraphicFile )
278 Warnlog( "Graphic file not selected/Copy or Delete is disabled: " & GraphicFile )
283 warnlog( "Insert Graphics Dialog is not open, aborting" )
291 printlog( "Test the PCD-Filters directly (3 samples)" )
293 for iCurrentFile = 1 to 3
297 Kontext "GrafikEinfuegenDlg"
298 if ( not GrafikEinfuegenDlg.exists() ) then
299 InsertGraphicsFromFile
300 Kontext "GrafikEinfuegenDlg"
303 if ( GrafikEinfuegenDlg.exists( 2 ) ) then
305 select case iCurrentFile
306 case 1 : Filtername = "PCD - Kodak Photo CD (768x512) (*.pcd)"
307 case 2 : Filtername = "PCD - Kodak Photo CD (384x256) (*.pcd)"
308 case 3 : Filtername = "PCD - Kodak Photo CD (192x128) (*.pcd)"
311 GraphicFile = ConvertPath( gTesttoolPath & "global\input\graf_inp\papagei1.pcd" )
313 printlog( "Current filter: " & Filtername )
314 printlog( "Current file..: " & GraphicFile )
315 DateiName.SetText ( GraphicFile )
316 DateiTyp.Select( Filtername )
318 printlog( " * Uncheck Preview- and Link-checkbox, load the file" )
320 Verknuepfen.unCheck()
325 if ( Active.Exists() )then
326 Warnlog( "Unexpected messagebox: " & Active.GetText() )
327 Warnlog( "Affected file..: " & GraphicFile )
328 Warnlog( "Affected filter: " & Filtername )
337 Warnlog( "Problems with filtertype : " & Filtername )
342 warnlog( "Insert Graphics Dialog is not open. Aborting" )
348 Kontext "GrafikEinfuegenDlg"
349 if GrafikEinfuegenDlg.Exists then
350 GrafikEinfuegenDlg.Cancel
357 '-----------------------------------------------------------
359 testcase tInsertObjectOLEObject
360 PrintLog "- Insert / Object / OLE-Objekt"
362 printlog " Open new document"
365 printlog " Insert / Object / OLE-Object"
366 InsertObjectOLEObject
368 Kontext "OLEObjektEinfuegen"
369 printlog " Check both radiobuttons 'Create now' and 'Create from file'"
371 Call DialogTest (OLEObjektEinfuegen, 1)
372 AusDateiErstellen.Check
373 Call DialogTest (OLEObjektEinfuegen, 2)
374 OLEObjektEinfuegen.Cancel
376 printlog " Close active document"
380 '-----------------------------------------------------------
382 testcase tInsertObjectPlugIn
383 PrintLog "- Insert / Object / Plug-In"
385 printlog " Open new document"
388 printlog " Close 'Plug in' dialog"
391 Kontext "PlugInEinfuegen"
392 if PlugInEinfuegen.Exists then
393 Call DialogTest (PlugInEinfuegen)
394 PlugInEinfuegen.Cancel
396 Warnlog "Dialog 'Plugin' is not up!"
399 printlog " Close active document"
403 '-----------------------------------------------------------
405 testcase tInsertObjectSound
406 Printlog "- Insert / Object / Sound"
407 printlog " Open new document"
411 if gUseSysDlg = False then
413 printlog " Insert / Object / Sound"
415 if OeffnenDlg.Exists then
418 Warnlog "Dialog to insert Sound isn't up!"
422 'Warnlog "- Menu disabled or no Sound-PlugIn installed !?"
424 printlog " Close active document"
428 '-----------------------------------------------------------
430 testcase tInsertObjectVideo
431 Printlog "- Insert / Object / Video"
433 printlog " Open new document"
437 if gUseSysDlg = False then
439 printlog " Insert / Object / Video"
441 if OeffnenDlg.Exists then
444 Warnlog "Dialog to insert Video isn't up!"
448 'Warnlog "- Menu disabled or no Video-PlugIn installed !?"
450 printlog " Close active document"
454 '-----------------------------------------------------------
456 testcase tInsertObjectFormula
457 PrintLog "- Insert / Object / Formula"
459 printlog " Open new document"
462 printlog " Insert / Object / Formular"
466 if Active.Exists then
467 if Active.GetRT = 304 then
468 Warnlog Active.Gettext
474 printlog " Click in 'Math' document"
475 Call gMouseClick(1,1)
477 printlog " 'Delete math-object in document"
478 Call wTypeKeys("<Delete>")
480 printlog " Close active document"
484 '-----------------------------------------------------------
486 testcase tInsertObjectChart
487 PrintLog "- Insert / Object / Chart"
489 printlog " Open new document"
491 ' Chart-Wizard will be invoked if data ranges exist
492 ' Therefor a table will be inserted
493 printlog " Insert / Table"
495 Kontext "TabelleEinfuegenWriter"
496 TabelleEinfuegenWriter.Ok
498 printlog " Insert / Object / Chart"
501 Kontext "ChartWizard"
502 if ChartWizard.Exists then
503 printlog "- Chart-Wizard is up=>OK"
504 Call DialogTest ( ChartWizard )
505 printlog " Cancel Chart-Wizard"
508 warnlog "Chart-Wizard is not up though a table has been inserted"
511 printlog " Close active document"
515 '-----------------------------------------------------------
518 PrintLog "- Insert / File"
520 printlog " Open new document"
525 printlog " Insert / File"
528 printlog " Check 'File dialog'"
529 if OeffnenDlg.Exists( 2 ) then
530 Call DialogTest ( OeffnenDlg )
538 if Active.Exists then
539 Warnlog Active.Gettext
547 printlog " Close active document"
551 '-----------------------------------------------------------
553 testcase tHtmlDocInsertFields
554 PrintLog "- Insert / Fields"
556 gApplication = "HTML"
557 printlog " Open new document"
561 printlog "Insert / Fields / Date"
564 Warnlog "Unable to execute: Insert / Fields / Date "
566 printlog " Insert / Fields / Date"
567 Call wTypeKeys (" <Return>")
569 printlog "Insert / Fields / Time"
572 Warnlog "Unable to execute: Insert / Fields / Time"
574 printlog " Insert / Fields / Time"
575 Call wTypeKeys (" <Return>")
577 printlog "Insert / Fields / Page Number"
578 InsertFieldsPageNumbers
580 Warnlog "Unable to execute: Insert / Fields / Page numbers"
582 printlog " Insert / Fields / Page numbers"
583 Call wTypeKeys (" <Return>")
585 printlog "Insert / Fields / Page Count"
586 InsertFieldsPageCount
588 Warnlog "Unable to execute: Insert / Fields / Page Count"
590 printlog " Insert / Fields / Page count"
591 Call wTypeKeys (" <Return>")
593 printlog "Insert / Fields / Title"
596 Warnlog "Unable to execute: Insert / Fields / Title"
598 printlog " Insert / Fields / Title"
599 Call wTypeKeys (" <Return>")
601 printlog "Insert / Fields / Author"
604 Warnlog "Unable to execute: Insert / Fields / Author"
606 printlog " Insert / Fields / Author"
607 if gApplication <> "HTML" then
609 printlog "Insert / Fields / Subject"
612 Warnlog "Unable to execute: Insert / Fields / Subject"
614 printlog " If document not HTML then 'Insert / Fields / Subject"
615 Call wTypeKeys (" <Return>")
616 printlog " Press key 'enter'"
619 printlog " Close active document"
621 gApplication = "WRITER"
624 '-----------------------------------------------------------
626 testcase tHtmlDocInsertFieldsOther
629 printlog "- Insert / Fields / Other"
631 gApplication = "HTML"
632 printlog " Open new document"
635 printlog " Insert / Fields / Other"
639 printlog " In dialog step through all tabpages"
640 Active.SetPage TabDokumentFeldbefehle
641 Kontext "TabDokumentFeldbefehle"
642 Call Dialogtest ( TabDokumentFeldbefehle )
645 Active.SetPage TabDokumentinfoFeldbefehle
646 Kontext "TabDokumentinfoFeldbefehle"
647 Call Dialogtest ( TabDokumentinfoFeldbefehle )
650 Active.SetPage TabVariablen
651 Kontext "TabVariablen"
652 Call Dialogtest ( TabVariablen )
654 if gApplication <> "HTML" then
656 Active.SetPage TabReferenzen
657 Kontext "TabReferenzen"
658 Call Dialogtest ( TabReferenzen )
661 Active.SetPage TabFunktionen
662 Kontext "TabFunktionen"
663 Call Dialogtest ( TabFunktionen )
664 for i=1 to Feldtyp.GetItemCount
666 if MakroButton.IsEnabled then
668 ' if no JRE is installed a messagebox appears
672 if Active.Exists then
673 if Active.GetRT = 304 then
674 if j = 1 then Warnlog Active.Gettext
684 Kontext "ScriptSelector"
685 if ( ScriptSelector.exists( 3 ) ) then
688 warnlog( "Dialog <ScriptSelector> is not available" )
690 Kontext "TabFunktionen"
696 Active.SetPage TabDatenbank
697 Kontext "TabDatenbank"
698 Call Dialogtest ( TabDatenbank )
700 printlog " Close dialog"
703 printlog " Close dialog"
706 printlog " Close active document"
708 gApplication = "WRITER"
711 '-----------------------------------------------------------
713 testcase tHtmlDocInsertSection
714 PrintLog "- Insert / Section"
716 gApplication = "HTML"
717 printlog " Open new document"
720 printlog " Insert / Section"
724 printlog " In dialog step through all tabpages"
725 printlog "- Tabpage Section"
726 Active.Setpage TabBereiche
727 Kontext "TabBereiche"
728 Call DialogTest (TabBereiche)
733 if ( OeffnenDlg.exists( 1 ) ) then
736 warnlog( "Dialog <OeffnenDlg> is not available" )
741 printlog "- Tabpage Columns"
742 Active.Setpage TabSpalten
744 Call DialogTest (TabSpalten)
747 printlog "- Tabpage Background"
748 Active.Setpage TabHintergrund
749 Kontext "TabHintergrund"
750 Call DialogTest (TabHintergrund)
752 if gApplication <> "HTML" then
753 printlog "Tabpage Indents"
755 Active.Setpage TabSectionIndent
756 Kontext "TabSectionIndent"
757 Call DialogTest (TabSectionIndent)
759 printlog "- Tabpage Footnotes/Endnotes"
761 Active.Setpage TabFussEndnoten
762 Kontext "TabFussEndnoten"
763 Call DialogTest (TabFussEndnoten)
764 TabFussEndnoten.Cancel
766 TabHintergrund.Cancel
768 printlog " Close active document"
770 gApplication = "WRITER"
773 '-----------------------------------------------------------
775 testcase tHtmlDocInsertFrame
776 PrintLog "- Insert / Frame"
778 gApplication = "HTML"
779 printlog " Open new document"
782 printlog " Insert / Frame"
786 printlog " Step through all tabpages"
788 active.SetPage TabType
790 Call DialogTest (TabType)
794 active.SetPage TabZusaetze
795 Kontext "TabZusaetze"
796 Call DialogTest (TabZusaetze)
800 active.SetPage TabUmlauf
802 Call DialogTest (TabUmlauf)
806 active.SetPage TabUmrandung
807 Kontext "TabUmrandung"
808 Call DialogTest (TabUmrandung)
812 active.SetPage TabHintergrund
813 Kontext "TabHintergrund"
814 Call DialogTest (TabHintergrund, 1)
818 Call DialogTest (TabHintergrund, 2)
821 Warnlog "Maybe missing combobox! (#i29517)"
824 if gApplication <> "HTML" then
826 active.SetPage TabHyperlinkRahmen
827 Kontext "TabHyperlinkRahmen"
828 Call DialogTest (TabHyperlinkRahmen)
831 if gUSeSysDlg = False then
837 active.SetPage TabSpalten
839 Call DialogTest (TabSpalten)
840 printlog " Close dialog"
843 printlog " Close dialog"
844 TabHintergrund.Cancel
847 printlog " Close active document"
849 gApplication = "WRITER"
852 '-----------------------------------------------------------
854 testcase tHtmlDocInsertGraphicsFromFile
855 PrintLog "- Insert / Graphics / From File"
858 gApplication = "HTML"
859 printlog " Open new document"
862 printlog " Insert / Graphics from file"
863 InsertGraphicsFromFile
865 Kontext "GrafikEinfuegenDlg"
866 printlog " Select as graphic to insert: '...\writer\required\input\graphics\jolink.jpg"
867 Dateiname.Settext ConvertPath ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
871 if Active.Exists( 1 ) then
872 Warnlog Active.Gettext
874 Kontext "GrafikEinfuegenDlg"
875 GrafikEinfuegenDlg.Cancel
879 printlog " select again 'Insert / Grahics from file'"
880 InsertGraphicsFromFile
882 printlog " Step through all tabpages"
884 active.SetPage TabType
887 Call DialogTest ( TabType )
890 active.SetPage TabZusaetze
892 Kontext "TabZusaetze"
893 Call DialogTest ( TabZusaetze )
896 active.SetPage TabUmlauf
899 Call DialogTest ( TabUmlauf )
902 active.SetPage TabHyperlinkRahmen
904 Kontext "TabHyperlinkRahmen"
905 Call DialogTest ( TabHyperlinkRahmen )
908 active.SetPage TabGrafik
911 Call DialogTest ( TabGrafik )
914 active.SetPage TabUmrandung
916 Kontext "TabUmrandung"
917 Call DialogTest ( TabUmrandung )
920 active.SetPage TabMakro
921 ' if no JRE is installed a messagebox appears
926 if Active.Exists then
927 if Active.GetRT = 304 then
928 if j = 1 then Warnlog Active.Gettext
939 Call DialogTest ( TabMakro )
941 if gApplication <> "HTML" then
943 active.SetPage TabZuschneiden
945 Kontext "TabZuschneiden"
946 Call DialogTest ( TabZuschneiden )
949 active.SetPage TabHintergrund
951 Kontext "TabHintergrund"
952 Call DialogTest ( TabHintergrund )
953 printlog " Close dialog"
954 TabHintergrund.Cancel
956 printlog " Close dialog"
961 printlog " Close active document"
963 gApplication = "WRITER"