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 with connection to the Insert-menu.
32 '\***********************************************************************
36 printLog Chr(13) + "--------- Insert Menu ( w_004_ ) ----------"
37 gApplication = "WRITER"
39 call tInsertManualBreak
41 call tInsertFieldsOther
42 call tInsertSpecialCharacter
49 call tInsertCrossReference
51 call tInsertIndexesEntry
52 call tInsertIndexesIndex
53 call tInsertIndexesBibliographyEntry
60 '-----------------------------------------------------------
62 testcase tInsertManualBreak
63 PrintLog "- Insert / Manual Break"
65 printlog " Open new document"
68 printlog " Insert / Manual break"
71 printlog " Close 'Insert break' dialog with cancel"
72 Kontext "UmbruchEinfuegen"
73 Call DialogTest ( UmbruchEinfuegen )
74 UmbruchEinfuegen.Cancel
76 printlog " Close active document"
80 '-----------------------------------------------------------
82 testcase tInsertFields
83 PrintLog "- Insert / Fields"
85 printlog " Open new document"
89 printlog "Insert / Fields / Date"
92 Warnlog "Unable to execute: Insert / Fields / Date "
94 printlog " Insert / Fields / Date"
95 Call wTypeKeys (" <Return>")
97 printlog "Insert / Fields / Time"
100 Warnlog "Unable to execute: Insert / Fields / Time"
102 printlog " Insert / Fields / Time"
103 Call wTypeKeys (" <Return>")
105 printlog "Insert / Fields / Page Number"
106 InsertFieldsPageNumbers
108 Warnlog "Unable to execute: Insert / Fields / Page numbers"
110 printlog " Insert / Fields / Page numbers"
111 Call wTypeKeys (" <Return>")
113 printlog "Insert / Fields / Page Count"
114 InsertFieldsPageCount
116 Warnlog "Unable to execute: Insert / Fields / Page Count"
118 printlog " Insert / Fields / Page count"
119 Call wTypeKeys (" <Return>")
121 printlog "Insert / Fields / Title"
124 Warnlog "Unable to execute: Insert / Fields / Title"
126 printlog " Insert / Fields / Title"
127 Call wTypeKeys (" <Return>")
129 printlog "Insert / Fields / Author"
132 Warnlog "Unable to execute: Insert / Fields / Author"
134 printlog " Insert / Fields / Author"
135 if gApplication <> "HTML" then
137 printlog "Insert / Fields / Subject"
140 Warnlog "Unable to execute: Insert / Fields / Subject"
142 printlog " If document not HTML then 'Insert / Fields / Subject"
143 Call wTypeKeys (" <Return>")
144 printlog " Press key 'enter'"
147 printlog " Close active document"
151 '-----------------------------------------------------------
153 testcase tInsertFieldsOther
156 printlog "- Insert / Fields / Other"
158 printlog " Open new document"
161 printlog " Insert / Fields / Other"
165 printlog " In dialog step through all tabpages"
166 Active.SetPage TabDokumentFeldbefehle
167 Kontext "TabDokumentFeldbefehle"
168 Call Dialogtest ( TabDokumentFeldbefehle )
171 Active.SetPage TabDokumentinfoFeldbefehle
172 Kontext "TabDokumentinfoFeldbefehle"
173 Call Dialogtest ( TabDokumentinfoFeldbefehle )
176 Active.SetPage TabVariablen
177 Kontext "TabVariablen"
178 Call Dialogtest ( TabVariablen )
180 if gApplication <> "HTML" then
182 Active.SetPage TabReferenzen
183 Kontext "TabReferenzen"
184 Call Dialogtest ( TabReferenzen )
187 Active.SetPage TabFunktionen
188 Kontext "TabFunktionen"
189 Call Dialogtest ( TabFunktionen )
190 for i=1 to Feldtyp.GetItemCount
192 if MakroButton.IsEnabled then
194 ' if no JRE is installed a messagebox appears
198 if Active.Exists then
199 if Active.GetRT = 304 then
200 if j = 1 then Warnlog Active.Gettext
210 Kontext "ScriptSelector"
211 if ( ScriptSelector.exists( 5 ) ) then
214 warnlog( "Dialog <ScriptSelector> is not available" )
216 Kontext "TabFunktionen"
222 Active.SetPage TabDatenbank
223 Kontext "TabDatenbank"
224 Call Dialogtest ( TabDatenbank )
226 printlog " Close dialog"
229 printlog " Close dialog"
232 printlog " Close active document"
236 '-----------------------------------------------------------
238 testcase tInsertSpecialCharacter
239 PrintLog "- Insert / Special Character"
241 printlog " Open new document"
244 printlog " Insert / Special Character"
245 InsertSpecialCharacterWriter
247 Kontext "Sonderzeichen"
248 Call DialogTest (Sonderzeichen)
251 printlog " Close active document"
255 '-----------------------------------------------------------
257 testcase tInsertSection
258 PrintLog "- Insert / Section"
260 printlog " Open new document"
263 printlog " Insert / Section"
267 printlog " In dialog step through all tabpages"
268 printlog "- Tabpage Section"
269 Active.Setpage TabBereiche
270 Kontext "TabBereiche"
271 Call DialogTest (TabBereiche)
273 if gUseSysDlg = False then
280 printlog "- Tabpage Columns"
281 Active.Setpage TabSpalten
283 Call DialogTest (TabSpalten)
286 printlog "- Tabpage Background"
287 Active.Setpage TabHintergrund
288 Kontext "TabHintergrund"
289 Call DialogTest (TabHintergrund)
291 if gApplication <> "HTML" then
292 printlog "Tabpage Indents"
294 Active.Setpage TabSectionIndent
295 Kontext "TabSectionIndent"
296 Call DialogTest (TabSectionIndent)
298 printlog "- Tabpage Footnotes/Endnotes"
300 Active.Setpage TabFussEndnoten
301 Kontext "TabFussEndnoten"
302 Call DialogTest (TabFussEndnoten)
303 TabFussEndnoten.Cancel
305 TabHintergrund.Cancel
307 printlog " Close active document"
311 '-----------------------------------------------------------
313 testcase tInsertHyperlink
315 PrintLog "- Insert / Hyperlink"
317 printlog " Open new document"
320 printlog "- Internet"
321 printlog " Insert / Hyperlink"
324 kontext "HyperlinkDialog"
325 if ( HyperlinkDialog.exists( 2 ) ) then
327 printlog " In 'Hyperlink' dialog step through all pages"
328 Call wEinfuegenHyperlink(1)
329 Call DialogTest ( TabHyperlinkInternet )
332 printlog "- Mail & News"
333 Call wEinfuegenHyperlink(2)
335 Call DialogTest ( TabHyperlinkMailUndNews )
338 printlog "- Document"
339 Call wEinfuegenHyperlink(3)
341 Call DialogTest ( TabHyperlinkDokument )
346 if ( OeffnenDlg.exists( 1 ) ) then
349 warnlog( "Dialog <OeffnenDlg> is not available" )
353 printlog "- New Document"
354 Call wEinfuegenHyperlink(4)
356 Call DialogTest ( TabHyperlinkNeuesDokument )
363 printlog " Close 'Hyperlink' dialog"
364 kontext "HyperlinkDialog"
365 HyperlinkDialog.Close
367 warnlog( "Unable to open <HyperlinkDialog>" )
370 printlog " Close active document"
374 '-----------------------------------------------------------
376 testcase tInsertFootnote
377 PrintLog "- Insert / Footnote"
379 printlog " Open new document"
382 printlog " Insert / Footnote"
384 Kontext "FussnoteEinfuegen"
385 Call DialogTest (FussnoteEinfuegen)
387 printlog " In 'Insert / Footnote' dialog click on browse button"
389 printlog " Close 'Special Character' dialog"
390 Kontext "Sonderzeichen"
393 printlog " Close 'Insert Footnote' dialog"
394 Kontext "FussnoteEinfuegen"
395 FussnoteEinfuegen.Cancel
397 printlog " Close active document"
401 '-----------------------------------------------------------
403 testcase tInsertCaption
404 PrintLog "- Insert / Caption"
406 printlog " Open new document"
409 printlog " Insert graphic '..\writer\required\input\graphics\jolink.jpg"
410 Call hGrafikEinfuegen ( gTesttoolPath + "writer\required\input\graphics\jolink.jpg" )
412 printlog " Insert / Caption"
414 Kontext "Beschriftung"
415 Call DialogTest ( Beschriftung )
417 printlog " In 'Caption' dialog click 'Options'"
418 WeitereOptionen.Click
419 Kontext "NummernkreisOptionen"
420 Call DialogTest ( NummernkreisOptionen )
421 printlog " Close 'Number Range Options' dialog"
422 NummernkreisOptionen.Cancel
424 Kontext "Beschriftung"
425 printlog " Close 'Caption' dialog"
429 Warnlog "Insert / Caption is disabled!"
432 printlog " Close active document"
436 '-----------------------------------------------------------
438 testcase tInsertBookmark
439 PrintLog "- Insert / Bookmark"
441 printlog " Open new document"
444 printlog " Insert / Bookmark"
446 Kontext "TextmarkeEinfuegen"
447 Call DialogTest (TextmarkeEinfuegen)
449 printlog " Close 'Insert Bookmark' dialog"
450 TextmarkeEinfuegen.Cancel
452 printlog " Close active document"
456 '-----------------------------------------------------------
458 testcase tInsertComment
459 dim sNoteText as String
460 PrintLog "- Insert / Comment"
464 printlog " Insert / Comment"
467 Kontext "DocumentWriter"
468 sNoteText = "Comment inserted by testtool !"
469 Call wTypeKeys (sNoteText)
471 Call wNavigatorAuswahl( 11, 1 )
472 Kontext "NavigatorWriter"
473 if Auswahlliste.Gettext <> sNoteText then
474 warnlog ("Comment was not inserted correctly (Focus problem?")
477 printlog " Close active document"
481 '-----------------------------------------------------------
483 testcase tInsertCrossReference
486 printlog "- Insert / Reference Field"
487 if gApplication = "HTML" then
488 printlog "Not in WriterWeb!"
491 printlog " Open new document"
494 printlog " Insert / Cross reference"
497 Kontext "TabReferenzen"
498 if NOT TabReferenzen.IsVisible then Warnlog "Reference Tabpage isn't default!"
500 printlog " Step through all tabpages"
502 Active.SetPage TabFunktionen
503 Kontext "TabFunktionen"
504 for i=1 to Feldtyp.GetItemCount
506 if MakroButton.IsEnabled then
508 ' if no JRE is installed a messagebox appears
513 if Active.Exists then
514 if Active.GetRT = 304 then
515 if j = 1 then Warnlog Active.Gettext
524 Kontext "ScriptSelector"
525 if ( ScriptSelector.exists( 3 ) ) then
528 warnlog( "Dialog <ScriptSelector> is not available" )
530 Kontext "TabFunktionen"
536 Active.SetPage TabDokumentinfoFeldbefehle
537 Kontext "TabDokumentinfoFeldbefehle"
540 Active.SetPage TabVariablen
541 Kontext "TabVariablen"
544 Active.SetPage TabDatenbank
545 Kontext "TabDatenbank"
548 Active.SetPage TabDokumentFeldbefehle
549 Kontext "TabDokumentFeldbefehle"
551 printlog " Close dialog"
552 TabDokumentFeldbefehle.Close
554 printlog " Close active document"
558 '-----------------------------------------------------------
560 testcase tInsertScript
561 PrintLog "- Insert / Script"
563 printlog " Open new document"
566 printlog " Insert / Script"
568 Kontext "ScriptEinfuegen"
569 Call DialogTest (ScriptEinfuegen)
571 ScriptEinfuegen.Cancel
573 printlog " Close active document"
577 '-----------------------------------------------------------
579 testcase tInsertIndexesEntry
580 qaErrorLog "#158646# - Insert Indexes Entry causes crash."
583 PrintLog "- Insert / Indexes / Entry"
584 if gApplication = "HTML" then
585 printlog "Not in WriterWeb!"
588 printlog " Open new document"
591 printlog " Insert / Indexes and Tables / Entry"
593 Kontext "VerzeichniseintragEinfuegen"
594 Call DialogTest (VerzeichniseintragEinfuegen)
595 printlog " Click 'Insert'"
598 Kontext "BenutzerverzeichnisDefinieren"
599 Call DialogTest (BenutzerverzeichnisDefinieren)
600 printlog " Close dialog 'Insert Index Entry'"
601 BenutzerverzeichnisDefinieren.Cancel
602 Kontext "VerzeichniseintragEinfuegen"
603 EinfuegenSchliessen.Click
605 printlog " Close active document"
609 '-----------------------------------------------------------
611 testcase tInsertIndexesIndex
613 Printlog "- Insert / Indexes / Index"
614 if gApplication = "HTML" then
615 printlog "Not in WriterWeb!"
618 printlog " Open new document"
621 printlog " Insert / Indexes and Tables / Indexes and Tables"
625 if Active.Exists then
626 if Active.GetRT = 304 then
627 Warnlog Active.Gettext
632 printlog " Step through all Tabpages"
634 printlog "- TabPage Indexes"
635 Active.Setpage TabVerzeichnisseVerzeichnis
636 Kontext "TabVerzeichnisseVerzeichnis"
637 For i= 1 to VerzeichnisTyp.GetItemCount
639 if i = 2 then printlog "Alphabetical index see bug #i33671 (ok in m54)"
640 VerzeichnisTyp.Select i
641 printlog "- " + VerzeichnisTyp.GetSelText
642 Call DialogTest (TabVerzeichnisseVerzeichnis)
643 printlog "- Entry's to " + VerzeichnisTyp.GetSelText
646 ErzeugenAusGliederung.Check
650 if gUseSysDlg = False then
651 Konkordanzdatei.Check
652 Kontext "KonkordanzdateiOeffnen"
653 if KonkordanzdateiOeffnen.Exists then
654 KonkordanzdateiOeffnen.Cancel
655 Warnlog "Open-Dialog comes up at checking the checkbox!"
657 Kontext "TabVerzeichnisseVerzeichnis"
658 if KonkordanzAuswahl.IsEnabled then
659 KonkordanzAuswahl.Click
661 Call hMenuSelectNr ( 1 )
662 Kontext "KonkordanzdateiOeffnen"
663 if KonkordanzdateiOeffnen.Exists then
664 KonkordanzdateiOeffnen.Cancel
666 Warnlog "No Open-Dialog selecting Concordance-File->Open!"
669 Kontext "TabVerzeichnisseVerzeichnis"
670 KonkordanzAuswahl.Click
672 Call hMenuSelectNr ( 2 )
673 Kontext "SpeichernDlg"
674 if SpeichernDlg.Exists then
677 Warnlog "No Open-Dialog selecting Concordance-File->New!"
680 Warnlog "- Concordance-File couldn't be selected, though checkbox is checked!"
687 Active.Setpage TabVerzeichnisseEintraege
688 Kontext "TabVerzeichnisseEintraege"
689 Call DialogTest (TabVerzeichnisseEintraege)
691 Active.Setpage TabVerzeichnisseVerzeichnis
692 Kontext "TabVerzeichnisseVerzeichnis"
697 printlog "- Tabpage Styles"
698 Active.Setpage TabVerzeichnisseVorlagen
699 Kontext "TabVerzeichnisseVorlagen"
700 Call DialogTest (TabVerzeichnisseVorlagen)
702 printlog "- Tabpage Columns"
704 Active.Setpage TabSpalten
706 Call DialogTest (TabSpalten)
708 printlog "- Tabpage Background"
710 Active.Setpage TabHintergrund
711 Kontext "TabHintergrund"
712 TabHintergrund.Cancel
714 printlog " Close active document"
718 printlog " Open new document"
722 printlog " View Zoom"
726 printlog " Check if 100% Zoom is checked ( Had a bug changed after opening Index dialog )"
727 if Massstab.Exists then
728 if Not Vergroesserung100.IsChecked then
729 Warnlog "100% Zoom is not checked.Maybe Bug#95871! Set Zoom to 100%!"
730 Vergroesserung100.Check
734 printlog " Close 'Zoom' dialog"
737 Warnlog "Dialog 'Zoom' does not exist!"
739 printlog " Close active document"
743 '-----------------------------------------------------------
745 testcase tInsertIndexesBibliographyEntry
746 Printlog "- Insert / Indexes / Bibliography Entry"
747 if gApplication = "HTML" then
748 printlog "Not in WriterWeb!"
751 printlog " Open new document"
754 printlog " Insert / Indexes and Tables / Bibliography Entry "
755 hUseAsyncSlot( "InsertIndexesBibliographyEntry" )
758 if ( Active.Exists() ) then
761 if ( Active.GetRT = 304 ) then
762 Warnlog Active.Gettext
771 Kontext "LiteratureintragEinfuegen"
772 if ( LiteratureintragEinfuegen.exists( 1 ) ) then
773 Call DialogTest ( LiteratureintragEinfuegen )
775 printlog " In dialog 'Insert Bibliography Entry' click 'Edit'"
776 EintragBearbeiten.Click
778 Kontext "LiteratureintragDefinieren"
779 if ( LiteratureintragDefinieren.exists( 1 ) ) then
780 Call DialogTest ( LiteratureintragDefinieren )
781 printlog " Close dialog 'Define Bibliography Entry'"
782 LiteratureintragDefinieren.Close
784 warnlog( "Dialog <LiteratureintragDefinieren> is not available" )
787 Kontext "LiteratureintragEinfuegen"
788 printlog " Close dialog 'Insert Bibliography Entry'"
789 EintragSchliessen.Click
791 warnlog( "Dialog <LiteratureintragEinfuegen> is not available" )
793 printlog " Close active document"
797 '-----------------------------------------------------------
799 testcase tInsertEnvelope
800 PrintLog "- Insert / Envelope"
801 if gApplication = "HTML" then
802 printlog "Not in WriterWeb!"
806 printlog " Open new document"
809 printlog " Insert / Envelope"
813 active.SetPage TabEnvelope
814 Kontext "TabEnvelope"
815 Call DialogTest (TabEnvelope)
818 active.SetPage TabFormatEnvelope
819 Kontext "TabFormatEnvelope"
820 Call DialogTest (TabFormatEnvelope)
821 printlog " Step through all tabpages and click all buttons"
823 printlog "- Edit Addressee"
827 Call hMenuSelectNr(1)
830 Active.Setpage TabFont
834 Kontext "TabFormatEnvelope"
838 Call hMenuSelectNr(2)
841 Active.Setpage TabEinzuegeUndAbstaende
842 Kontext "TabEinzuegeUndAbstaende"
843 TabEinzuegeUndAbstaende.Cancel
845 Kontext "TabFormatEnvelope"
846 printlog "- Edit Sender"
850 Call hMenuSelectNr(1)
853 Active.Setpage TabFont
857 Kontext "TabFormatEnvelope"
861 Call hMenuSelectNr(2)
864 Active.Setpage TabEinzuegeUndAbstaende
865 Kontext "TabEinzuegeUndAbstaende"
866 TabEinzuegeUndAbstaende.Cancel
870 active.SetPage TabDruckerBriefumschlag
871 Kontext "TabDruckerBriefumschlag"
872 Call DialogTest (TabDruckerBriefumschlag)
873 if gPlatgroup = "w95" then
875 Kontext "DruckerEinrichten"
876 if DruckerEinrichten.Exists then
877 DruckerEinrichten.Cancel
879 Warnlog "No Default-Printer!"
881 Kontext "TabDruckerBriefumschlag"
883 printlog " Close dialog"
884 TabDruckerBriefumschlag.Close
886 printlog " Close active document"
890 '-----------------------------------------------------------
892 testcase tInsertFrame
893 PrintLog "- Insert / Frame"
895 printlog " Open new document"
898 printlog " Insert / Frame"
902 printlog " Step through all tabpages"
904 active.SetPage TabType
906 Call DialogTest (TabType)
910 active.SetPage TabZusaetze
911 Kontext "TabZusaetze"
912 Call DialogTest (TabZusaetze)
916 active.SetPage TabUmlauf
918 Call DialogTest (TabUmlauf)
922 active.SetPage TabUmrandung
923 Kontext "TabUmrandung"
924 Call DialogTest (TabUmrandung)
928 active.SetPage TabHintergrund
929 Kontext "TabHintergrund"
930 Call DialogTest (TabHintergrund, 1)
934 Call DialogTest (TabHintergrund, 2)
937 Warnlog "Maybe missing combobox! (#i29517)"
940 if gApplication <> "HTML" then
942 active.SetPage TabHyperlinkRahmen
943 Kontext "TabHyperlinkRahmen"
944 Call DialogTest (TabHyperlinkRahmen)
947 if gUSeSysDlg = False then
953 active.SetPage TabSpalten
955 Call DialogTest (TabSpalten)
956 printlog " Close dialog"
959 printlog " Close dialog"
960 TabHintergrund.Cancel
963 printlog " Close active document"
967 '-----------------------------------------------------------
969 testcase tInsertTable
970 PrintLog "- Insert / Table"
972 printlog " Open new document"
974 printlog " Insert / Table"
977 Kontext "TabelleEinfuegenWriter"
978 Call DialogTest (TabelleEinfuegenWriter)
979 if Spalten.Gettext <> "2" then Warnlog "- Default for Size Columns isn't 2 , it is " + Spalten.Gettext
980 if Zeilen.Gettext <> "2" then Warnlog "- Default for Size Row isn't 2, it is " + Zeilen.Gettext
981 printlog " In 'insert Table' dialog click 'AutoFormat'"
983 Kontext "AutoformatTabelle"
985 printlog " In 'AutoFormat' dialog click 'More'"
987 Call DialogTest ( AutoformatTabelle )
989 if Formatbox.GetItemCount > 2 then
993 Kontext "AutoformatHinzufuegenWriter"
994 Call DialogTest ( AutoformatHinzufuegenWriter )
995 TabellenName.SetText "Hallo"
996 AutoformatHinzufuegenWriter.Cancel
997 Kontext "AutoFormatTabelle"
999 Warnlog "Only " + Formatbox.GetItemCount + " Table formats to select ?"
1001 printlog " Close dialog 'More'"
1003 printlog " Close dialog 'AutoFormat'"
1004 AutoformatTabelle.Cancel
1006 Kontext "TabelleEinfuegenWriter"
1007 printlog " Close dialog ''"
1008 TabelleEinfuegenWriter.Cancel
1010 printlog " Close active document"