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 : **
32 '\******************************************************************************
36 printLog Chr(13) + "--------- Edit Menu ( w_002_.inc ) ----------"
37 gApplication = "WRITER"
43 Call tEditPasteSpecial
44 Call tEditSelectionMode
47 Call tEditCompareDocument
48 Call tEditFindAndReplace
54 Call tEditFieldsInputList
63 'Writer Master Document
64 gApplication = "MASTERDOCUMENT"
65 Call tMasterDocEditNavigator
70 gApplication = "WRITER"
74 '-----------------------------------------------------------
76 testcase tEditUndoRedo
77 PrintLog "- Edit/Undo - Redo"
79 PrintLog "Open new document"
82 PrintLog "Insert table"
83 Call hTabelleEinfuegen
85 PrintLog "Edit / Undo"
86 hUseAsyncSlot( "EditUndo" )
88 PrintLog "Undo / Redo"
89 hUseAsyncSlot( "EditRedo" )
91 PrintLog "Edit / Undo"
92 hUseAsyncSlot( "EditUndo" )
94 PrintLog "File / Close"
95 hUseAsyncSlot( "FileClose" )
98 if ( Active.Exists( 1 ) ) then
99 warnlog( "No messagebox was expected upon file close" )
100 printlog( Active.getText )
106 '----------------------------------------------------
109 PrintLog "- Edit/Repeat"
111 PrintLog "Open new document"
114 PrintLog "Insert table"
115 Call hTabelleEinfuegen
117 PrintLog "Move cursor out of table"
118 Call wTypeKeys("<Down><Down>")
120 PrintLog "Edit / Repeat"
121 hUseAsyncSlot( "EditRepeat" )
123 PrintLog "Close active document"
127 '----------------------------------------------------
130 PrintLog "- Edit/Paste"
132 PrintLog "Open new document"
135 PrintLog "Insert some text in document"
136 Call wTypeKeys("What a beatiful day !")
138 PrintLog "Edit / Select All"
139 hUseAsyncSlot( "EditSelectAll" )
141 PrintLog "Edit / Cut"
142 hUseAsyncSlot( "EditCut" )
144 PrintLog "Edit / Paste"
145 hUseAsyncSlot( "EditPaste" )
147 PrintLog "Type <Shift Home >"
148 Call wTypeKeys("<Shift Home>")
150 PrintLog "Edit / Copy"
151 hUseAsyncSlot( "EditCopy" )
153 PrintLog "Enter 2 Line breaks"
154 Call wTypeKeys("<Return>", 2)
156 PrintLog "Edit / Paste"
157 hUseAsyncSlot( "EditPaste" )
159 PrintLog "Edit / Select All"
160 hUseAsyncSlot( "EditSelectAll" )
162 PrintLog "Edit / Cut"
163 hUseAsyncSlot( "EditCut" )
165 PrintLog "Close active document"
169 '----------------------------------------------------
171 testcase tEditPasteSpecial
172 PrintLog "- Edit/Paste Special"
173 PrintLog "Open new document"
176 PrintLog " - External Clipboard"
177 PrintLog "Enter some text in external clipboard"
178 SetClipboard "Text from external clipboard!"
180 PrintLog "Paste from external clipboard with Edit / Paste in Office"
181 hUseAsyncSlot( "EditPaste" )
183 Call wTypeKeys("<Mod1 A>")
185 hUseAsyncSlot( "EditCopy" )
187 if GetClipboardText <> "Text from external clipboard!" then
188 Warnlog "External Clipboard not available!"
189 Warnlog "Is: " & GetClipboardText
191 Call wTypeKeys("<End><Return>")
193 SetClipboard "2nd Text from external clipboard!"
195 PrintLog "Edit / Paste / Special"
196 hUseAsyncSlot( "EditPasteSpecialWriter" )
198 Kontext "InhaltEinfuegen"
199 if ( InhaltEinfuegen.Exists( 2 ) ) then
203 Warnlog "Unable to select entry in format list !"
204 InhaltEinfuegen.Close
211 if Active.Exists then
212 if Active.GetRT = 304 then
213 Warnlog "Maybe Bug#109331"
214 Warnlog Active.Gettext
222 Call wTypeKeys("<Home><Shift End>")
223 hUseAsyncSlot( "EditCopy" )
224 if GetClipboardText <> "2nd Text from external clipboard!" then Warnlog "Wrong Text inserted! Is: " & GetClipboardText
227 Warnlog "Dialog 'Paste Special' is not up!"
233 PrintLog " - Internal Clipboard with StarOffice Writer-Text"
234 PrintLog "Enter some text in writer and copy it"
235 Call wTypeKeys("<Return>Text from internal clipboard<Shift Home>")
236 hUseAsyncSlot( "EditCopy" )
237 Call wTypeKeys("<End><Return>")
238 hUseAsyncSlot( "EditPasteSpecialWriter" )
240 PrintLog "Edit / Paste / Special"
241 Kontext "InhaltEinfuegen"
242 if ( InhaltEinfuegen.Exists( 2 ) ) then
243 DialogTest ( InhaltEinfuegen )
246 Call wTypeKeys "<Home><Shift End>"
247 hUseAsyncSlot( "EditCopy" )
248 if GetClipboardText <> "Text from internal clipboard" then Warnlog "Wrong Text inserted! Is: " & GetClipboardText
250 Warnlog "Dialog 'Paste Special' is not up!"
254 PrintLog "Close active document"
258 '----------------------------------------------------
260 testcase tEditSelectionMode
262 PrintLog " - Edit - Selection Mode"
263 PrintLog " Open new writer document"
266 PrintLog " Try to switch to / activate the Block-selectionmode."
267 if ( hUseAsyncSlot( "EditSelectionModeBlock" ) = -1 ) then
268 warnlog " Could not activate Blockmode via Edit-menu."
271 PrintLog " Try to switch to / activate the Standard-selectionmode."
272 if ( hUseAsyncSlot( "EditSelectionModeStandard" ) = -1 ) then
273 warnlog " Could not activate Blockmode via Edit-menu."
276 PrintLog " Close active document."
279 endcase 'tEditSelectionMode
281 '----------------------------------------------------
283 testcase tEditChanges
285 PrintLog "- Edit/Changes"
286 if gApplication = "HTML" then
287 printlog "Not in WriterWeb!"
291 PrintLog "Open new document"
294 PrintLog "Enter some text in document"
295 Call wTypeKeys("Hallo<Return><Return>")
297 PrintLog "Select Edit / Changes / Record"
298 hUseAsyncSlot( "EditChangesRecord" )
300 PrintLog "Enter some more text in document"
301 Call wTypeKeys("Aenderung 1<Return><Up><Up><End>")
302 Call wTypeKeys("<Backspace>", 4)
304 PrintLog "Select Edit / Changes / Record"
305 hUseAsyncSlot( "EditChangesRecord" )
307 PrintLog "Select Edit / Changes / Show"
308 hUseAsyncSlot( "EditChangesShow" )
310 PrintLog "Select Edit / Changes / Show"
311 hUseAsyncSlot( "EditChangesShow" )
313 PrintLog "Select Edit / Changes / Protect Trace"
314 hUseAsyncSlot( "EditChangesProtectTrace" )
316 PrintLog "Passwort-dialog has to come up, cancel it"
318 hCloseDialog( Passwort, "close" )
320 PrintLog "Edit / Changes / Accept or Reject"
321 EditChangesAcceptOrReject
323 PrintLog "Dialog 'Accept or reject changes' has to come up"
325 if Redlining.Exists then
326 PrintLog "Step through all Tabpages"
327 TabControl.SetPage TabListe
328 Call DialogTest ( Redlining )
329 TabControl.SetPage TabFilter
330 Call DialogTest ( Redlining )
332 PrintLog "Close dialog"
334 Warnlog "Dialog 'Redlining' not opened!"
337 Call wTypeKeys("<Down><Right>")
339 PrintLog "Point cursor into a changed text in document"
340 PrintLog "Edit / Changes / Comment"
341 if ( hUseAsyncSlot( "EditChangesComment" ) = -1 ) then
342 Call wTypeKeys("<Up>")
343 if ( hUseAsyncSlot( "EditChangesComment" ) = -1 ) then
344 Warnlog "Unable to execute 'Edit / Changes / Comment!"
349 PrintLog "Dialog to comment a change has to come up"
350 if ( Kommentar.Exists( 5 ) ) then
351 Call DialogTest ( Kommentar )
354 Warnlog "Dialog 'Comment' not opened!"
355 PrintLog "Close dialog 'Comment'"
358 PrintLog "Close active document"
363 '----------------------------------------------------
365 testcase tEditCompareDocument
367 PrintLog "- Edit/Compare Document"
370 sFile = gTesttoolPath & "writer\required\input\bt.sxw"
372 if ( gApplication <> "WRITER" ) then
373 printlog( "Test only designed for WRITER, skipping" )
379 printlog( "Open test document")
380 EditCompareDocumentCalc
383 printlog( "File Open dialog" )
384 if ( OeffnenDlg.exists( 2 ) ) then
386 printlog( "Load file: " & sFile )
387 Dateiname.SetText ConvertPath ( sFile )
390 Kontext "FilterAuswahl"
391 printlog( "Check for filterselection dialog (comes up e.g. if file is broken)" )
392 if Filterauswahl.Exists( 2 ) then
393 warnlog( "Dialog <Filterauswahl> was not expected at this point" )
396 printlog( "No dialog <Filterauswahl>, good" )
400 if Active.Exists( 1 ) then
401 warnlog( "Unexpected messagebox displayed:" )
402 printlog( Active.getText() )
405 printlog( "No unexpected messageboxes, good." )
409 PrintLog "Dialog 'Accept and Reject changes' has to come up"
410 if Redlining.Exists( 1 ) then
411 TabControl.SetPage TabListe
414 TabControl.SetPage TabFilter
416 hCloseDialog( Redlining, "close" )
418 Warnlog "- Dialog 'Redlining' does not exist!"
421 warnlog( "Dialog <FileOpen> did not open")
424 PrintLog "Close active document"
429 '----------------------------------------------------
431 testcase tEditFindAndReplace
432 PrintLog "- Edit/Find & Replace"
434 PrintLog "Open new document"
437 PrintLog "Edit / Find and Replace"
438 Kontext "FindAndReplace"
439 if Attributes.IsVisible = False then
444 PrintLog "in 'Find&Replace' dialog click 'Attributess'"
446 Call DialogTest ( Attribute )
447 PrintLog "Cancel dialog 'Attributess'"
450 Kontext "FindAndReplace"
451 Call DialogTest ( FindAndReplace )
452 PrintLog "In Find&Replace dialog uncheck 'Match case'"
453 SimilaritySearch.UnCheck
454 PrintLog "Click 'Format'"
456 PrintLog "In dialog 'Text format' step throug all tabpages"
459 active.SetPage TabFont
461 Call DialogTest ( TabFont )
463 active.SetPage TabFontEffects
464 kontext "TabFontEffects"
465 Call DialogTest ( TabFontEffects )
468 active.SetPage TabEinzuegeUndAbstaende
469 kontext "TabEinzuegeUndAbstaende"
470 Call DialogTest ( TabEinzuegeUndAbstaende )
473 Active.SetPage TabAusrichtungAbsatz
474 Kontext "TabAusrichtungAbsatz"
475 Call DialogTest ( TabAusrichtungAbsatz )
478 active.SetPage TabTextfluss
479 kontext "TabTextfluss"
480 Call DialogTest ( TabTextfluss )
483 active.SetPage TabHintergrund
484 kontext "TabHintergrund"
485 Call DialogTest ( TabHintergrund )
486 TabHintergrund.Cancel
487 PrintLog "Close 'Text Format' dialog with cancel"
490 Kontext "FindAndReplace"
491 PrintLog "In Find&Replace' select 'Similarity Search'"
492 SimilaritySearch.Check
493 PrintLog "The Searchbutton should be enabled, click it"
494 SimilaritySearchFor.Click
497 Kontext "Aehnlichkeitssuche"
498 DialogTest ( Aehnlichkeitssuche )
499 Aehnlichkeitssuche.Cancel
502 PrintLog "Close 'Similarity Search' button with cancel"
503 Kontext "FindAndReplace"
504 SimilaritySearch.Uncheck
509 PrintLog "Close active document"
512 '----------------------------------------------------
514 testcase tViewNavigator
515 printlog "- Edit/Navigator"
516 Dim ToolboxOk as boolean
519 PrintLog "Open new document"
521 if gApplication = "MASTERDOCUMENT" then
522 Kontext "NavigatorGlobalDoc"
523 if Not NavigatorGlobalDoc.Exists then ViewNavigator
524 Kontext "NavigatorGlobalDoc"
525 Call DialogTest ( NavigatorGlobalDoc )
527 printlog " - Umschalten"
528 GlobaldokumentToolbox.Click Umschalten
530 kontext "NavigatorWriter"
533 Toolbox.TearOff Navigation
534 Kontext "NavigationsFenster"
535 NavigationsFenster.Close
537 Warnlog "Unable to Tear off Navigation Toolbox!"
540 Kontext "NavigatorWriter"
543 Kontext "NavigatorGlobalDoc"
544 printlog( "Click <Edit>" )
545 if ( hClickButton( Bearbeiten ) = -1 ) then
546 warnlog( "Unable to click <Edit> button, cannot switch Navigator-Mode" )
550 hCloseDialog( Navigator, "close" )
552 PrintLog "Close active document"
556 Kontext "NavigatorWriter"
557 if Not NavigatorWriter.Exists then ViewNavigator
558 Kontext "NavigatorWriter"
559 PrintLog "Open Navigator"
560 Call DialogTest ( NavigatorWriter )
562 printlog " - Navigation"
565 PrintLog "Tear Off Toolbox from Navigator"
566 Toolbox.TearOff Navigation
568 Warnlog "Unable to tear off Toolbox (#i32092)"
572 if ToolboxOK = True then
573 Kontext "NavigationsFenster"
576 PrintLog "Close Navigator Toolbox"
577 NavigationsFenster.Close
582 Kontext "NavigatorWriter"
584 PrintLog " - In Navigator window click 'Previous page'"
587 if Active.Exists then
588 if Active.GetRT = 304 then
598 Kontext "NavigatorWriter"
599 PrintLog "- In Navigator window click 'Next page'"
602 if Active.Exists then
603 if Active.GetRT = 304 then
613 printlog " - switch Selection box off and on"
614 Kontext "NavigatorWriter"
615 if Auswahlliste.Exists then Auswahlbox.Click
619 if Auswahlliste.NotExists then
620 Warnlog "Navigator not maximized"
624 printlog " - Switch Content View on and off"
630 printlog " - Set Note"
634 printlog " - jump to header"
638 printlog " - jump to footer"
642 printlog " - to Anchor <-> Text"
648 PrintLog "Close Navigator"
655 PrintLog "Close active document"
659 '---------------------------------------------------
661 testcase tEditAutotext
664 Dim CurrentEntryNr as integer
665 Dim unxAutotextCategorie as integer
667 PrintLog "Open new document"
670 PrintLog "Edit / Autotext"
673 DialogTest ( AutoText )
676 Printlog "If it exists: Delete DummyAutotext."
677 if wDeleteAutotext("DummyAutotext") = true then
678 qaerrorlog "DummyAutotext from previous testrun found, now deleted."
681 PrintLog "Click Categories"
685 Kontext "BereicheBearbeitenAutoText"
686 if BereicheBearbeitenAutoText.Exists( 2 ) then
687 DialogTest ( BereicheBearbeitenAutoText )
688 PrintLog "Create a new categorie"
689 Bereich.SetText "Hallo"
690 if Not Umbenennen.IsEnabled then
691 if gNetzInst = False then
692 Warnlog "- Not able to rename Categories, Button 'Rename' disabled!"
696 if Neu.IsEnabled then
700 printlog( "Click <Delete>" )
701 if ( hClickButton( Loeschen ) = -1 ) then
702 warnlog( "Unable to delete category, the button is disabled" )
705 if gNetzInst = False then
706 Warnlog "- Category cannot be created!"
709 BereicheBearbeitenAutoText.Cancel
711 Warnlog "- Dialog to edit Categories not up!"
713 PrintLog "Close 'Edit Categories with 'Cancel'"
716 PrintLog "In Autotext dialog click 'Path..'"
718 Kontext "PfadeAuswaehlen"
719 DialogTest ( PfadeAuswaehlen )
720 Kontext "PfadeAuswaehlen"
721 PrintLog "On 'Select Paths' dialog click 'add'"
725 if OeffnenDlg.Exists( 2 ) then
726 PrintLog "Cancel File-Open dialog"
727 hCloseDialog( OeffnenDlg, "cancel" )
729 Warnlog "Dialog ' Select Paths' not up!"
732 Kontext "PfadeAuswaehlen"
733 PrintLog "Cancel dialog 'Select Paths'"
734 hCloseDialog( PfadeAuswaehlen, "cancel" )
737 PrintLog "We have to create an autotext first"
738 PrintLog "to assure the 'Autotext'-Button enabled"
739 printlog "First close all categories"
740 Liste.TypeKeys "<Home>"
741 for i = 1 to Liste.GetItemCount
743 Liste.TypeKeys "<Down>"
746 unxAutotextCategorie = 1
747 printlog "choose category and remember entry number"
748 Liste.TypeKeys "<Home>"
749 for i = 1 to Liste.GetItemCount
750 if Not Menue.IsEnabled then
751 Liste.TypeKeys "<Down>"
752 unxAutotextCategorie = unxAutotextCategorie + 1
756 Call wTypeKeys ( "Create a dummy autotext" )
757 Call wTypeKeys ( "<Shift Home>" )
761 Liste.Select unxAutotextCategorie
762 NameText.Settext "DummyAutotext"
763 Kuerzel.Settext "dAt"
764 if Menue.IsEnabled(1) then
768 Call hMenuSelectNr ( 1 ) 'New
770 ' This is a workaround as sometimes menu isn't opened for some reason
774 Call hMenuSelectNr ( 1 )
776 Warnlog "Unable to create autotext"
783 Call wTypeKeys "<Home>"
785 Warnlog "Unable to create autotext"
791 printlog "Select created autotext"
795 Liste.Select unxAutotextCategorie
797 Liste.TypeKeys "<Down>"
800 if Menue.IsEnabled(1) then
804 PrintLog "Select Autotext / Rename"
805 Call hMenuSelectNr ( 2 ) 'Rename
808 ' This is a workaround as sometimes menu isn't opened for some reason
812 Call hMenuSelectNr ( 2 )
815 Warnlog "Unable to rename autotext"
822 Warnlog "Unable to rename autotext"
828 Kontext "TextbausteineUmbenennen"
829 if TextbausteineUmbenennen.Exists(5) then
830 Call DialogTest ( TextbausteineUmbenennen )
831 PrintLog "Cancel 'Rename Autotext'"
832 TextbausteineUmbenennen.Cancel
835 Warnlog "Dialog 'Rename Autotext' not up!"
842 PrintLog "Select Autotext / Macro"
843 Call hMenuSelectNr ( 5 )
844 ' if no JRE is installed a messagebox appears
848 if Active.Exists then
849 if Active.GetRT = 304 then
850 if j = 1 then Warnlog Active.Gettext
860 ' Dialog needs some time to be opened
861 Kontext "MakroZuweisen"
862 printlog( "Close <MakroZuweisen> dialog" )
863 if ( MakroZuweisen.exists( 5 ) ) then
864 call Dialogtest( MakroZuweisen )
865 hCloseDialog( MakroZuweisen, "close" )
867 warnlog "AutoText-Macro - Assign Macro took longer than 5 seconds to load. Check why."
870 Warnlog "Menu Autotext->'Macro' disabled !"
878 PrintLog "Select Autotext / Edit"
879 Call hMenuSelectNr ( 4 )
881 PrintLog "Enter some text in document and close it"
882 Call wTypeKeys("Hallo")
883 if GetDocumentCount = 1 then
884 Warnlog "The autotext has been edited in current document!"
886 hUseAsyncSlot( "FileClose" )
888 PrintLog "A message that module has been changed should come up"
889 if Active.Exists then
892 Warnlog "Though changing the text module the document could be closed without a query!"
896 Warnlog "Menu Autotext->'Edit' disabled !"
898 if Active.Exists then
899 if Active.GetRT = 304 then
900 Warnlog Active.Gettext
910 PrintLog "Close 'Autotext' dialog"
912 if Autotext.Exists then Autotext.Close
913 if wDeleteAutotext("DummyAutotext") = false then
914 Warnlog "Unable to delete created autotext"
917 if Autotext.Exists then Autotext.Close
919 PrintLog "Close active document"
923 '----------------------------------------------------------------
925 testcase tEditHyperlink
926 Printlog "- Edit / Hyperlink"
928 PrintLog "Open new document"
931 PrintLog "Insert / Hyperlink"
934 kontext "HyperlinkDialog"
935 if ( HyperlinkDialog.exists( 2 ) ) then
937 PrintLog "Insert / Hyperlink"
938 Call wEinfuegenHyperlink(1)
940 Kontext "TabHyperlinkInternet"
941 printlog( "Check <Internet>" )
944 PrintLog "Enter URL "
945 ZielUrl.Settext "http://www.sonor.de"
948 PrintLog "Click 'Apply'"
951 kontext "HyperlinkDialog"
952 PrintLog "Close Hyperlink dialog"
953 hClickButton( CloseButton )
955 warnlog( "Dialog <Hyperlink> did not open" )
960 hSetDocumentContext()
962 PrintLog "Check if correct URL has been set to document"
963 if ( hUseAsyncSlot( "EditCopy" ) > -1 ) then
964 if GetClipBoardtext = "" then
965 Warnlog "No Hyperlink or wrong hyperlink in document!" & GetClipBoardtext
968 warnlog( "Slot <EditCopy> could not be executed. Most likely the hyperlink was not selected" )
971 PrintLog "Set cursor into link"
972 Call wTypeKeys("<Left>")
974 PrintLog "Edit / Hyperlink has to be enabled"
975 if ( hUseAsyncSlot( "EditHyperlink" ) > -1 ) then
976 kontext "HyperlinkDialog"
977 hClickButton( CloseButton )
979 warnlog( "Slot <EditHyperlink> could not be called" )
982 PrintLog "Close active document"
986 ' ----------------------------------------------------------------
990 PrintLog( "Edit/Fields: Edit Fields dialog: " & gApplication )
991 dim iCurrentType as integer
993 PrintLog( "Open new document" )
996 printlog( "Insert->Field->Other" )
997 hUseAsyncSlot( "InsertFieldsOther" )
999 ' Note that the tabdialog does not have a unique ID yet, so we treat it as "Active"
1001 if ( Active.exists( 2 ) ) then
1003 printlog( "Switch to <Document> tab" )
1004 Active.setPage( TabDokumentFeldbefehle )
1006 kontext "TabDokumentFeldbefehle"
1007 printlog( "Select sender item from the user data, insert the field, close the dialog" )
1008 if ( TabDokumentFeldbefehle.isVisible() ) then
1010 ' Search for the sender item in the "Type" listbox by counting the
1011 ' number of items in the "Select" box. Only the sender item has
1012 ' more than 12 (usually 15) selectable options.
1013 ' This is done to make sure that we have an enabled "Edit..." button
1014 ' in the "Edit Fields" dialog called later in this test
1015 printlog( "Search for suitable field type" )
1016 for iCurrentType = 1 to FeldTyp.getItemCount()
1017 FeldTyp.select( iCurrentType )
1018 if ( Auswahl.isEnabled() and Auswahl.getItemCount() > 12 ) then
1023 hClickButton( Einfuegen )
1024 hCloseDialog( TabDokumentFeldbefehle , "close" )
1026 PrintLog( "Move cursor infront of field (start of document)" )
1027 Call wTypeKeys("<Home>")
1029 PrintLog( "Edit / Fields" )
1030 hUseAsyncSlot( "EditFields" )
1032 Kontext "FeldbefehlBearbeitenDokument"
1033 if ( FeldbefehlBearbeitenDokument.exists( 2 ) ) then
1034 Call DialogTest ( FeldbefehlBearbeitenDokument )
1036 PrintLog( "In 'Edit Fields' dialog select 'Edit'" )
1037 hClickButton( Bearbeiten )
1039 Kontext "TabBenutzerdaten"
1040 if ( TabBenutzerdaten.exists( 2 ) ) then
1041 printlog( "<TabBenutzerdaten> is open. Good." )
1042 call DialogTest( TabBenutzerdaten )
1043 hCloseDialog( TabBenutzerdaten, "cancel" )
1045 warnlog( "<TabBenutzerdaten> did not open" )
1048 warnlog( "<TabDokumentFeldbefehle> is not visible" )
1051 PrintLog( "Close dialog" )
1052 Kontext "FeldbefehlBearbeitenDokument"
1053 hCloseDialog( FeldbefehlBearbeitenDokument, "cancel" )
1055 warnlog( "<FeldbefehlBearbeitenDokument> did not open" )
1058 warnlog( "Unable to open <InsertFieldsOther>")
1061 PrintLog( "Close active document" )
1062 Call hCloseDocument()
1066 '----------------------------------------------------------------
1068 testcase tEditFieldsInputList
1069 PrintLog "- Edit / Fields / Functions"
1070 If gApplication = "HTML" then goto endsub
1072 PrintLog "Open new document"
1075 PrintLog "Select Insert / Fields Other"
1077 PrintLog "Goto Tabpage Functions and select 2nd entry (Input list)"
1079 Active.Setpage TabFunktionen
1080 Kontext "TabFunktionen"
1083 if NewListEntry.IsVisible and NewListEntry.IsEnabled then
1084 PrintLog "Add 1 entry to list"
1085 if NewListEntry.IsEnabled then
1086 NewListEntry.Settext "MyNewListEntry"
1088 if AddListEntry.IsEnabled= True then AddListEntry.Click
1090 PrintLog "Close Fields dialog"
1091 if EntrysList.GetItemCount <> 1 then
1092 Warnlog "Entry has not been added to list!"
1098 Call wTypeKeys "<Home>"
1100 Call wTypeKeys "<Mod1 Shift F9>"
1102 Kontext "EditInputList"
1103 if EditInputList.Exists then
1104 Call DialogTest ( EditInputList )
1105 EditInputList.Cancel
1107 Warnlog "Dialog 'Edit Input list' is not up!"
1110 Warnlog "Unable to 'Edit / Fields'!"
1114 Warnlog "'Input list' probably not found!"
1117 PrintLog "Close active document"
1121 '----------------------------------------------------------------
1123 testcase tEditFootnote
1124 PrintLog "- Edit/Footnote"
1126 PrintLog "Open new document"
1129 PrintLog "Insert / Footnote"
1131 Kontext "FussnoteEinfuegen"
1132 FussnoteEinfuegen.OK
1134 Call wTypeKeys("<PageUp><Left>")
1136 PrintLog "Edit / Footnote"
1139 Kontext "FussnoteBearbeiten"
1140 Call DialogTest ( FussnoteBearbeiten )
1141 PrintLog "Close 'Footnote' dialog"
1142 FussnoteBearbeiten.Cancel
1144 PrintLog "Close active document"
1148 '----------------------------------------------------------------
1150 testcase tEditIndexEntry
1152 PrintLog "- Edit/Index Entry"
1153 if gApplication = "HTML" then
1154 printlog "Not in WriterWeb!"
1158 PrintLog "Open new document"
1161 PrintLog "Write down something in document"
1162 Call wTypeKeys("Ich werde ein Verzeichniseintrag")
1163 Call wTypeKeys("<Left>")
1165 PrintLog "Insert / Indexes / Entry"
1166 Kontext "VerzeichniseintragEinfuegen"
1168 PrintLog "Close dialog"
1171 Warnlog "Index entry couldn't be inserted!(Button disabled)"
1173 EinfuegenSchliessen.Click
1175 Call wTypeKeys("<End><Left>")
1177 PrintLog "Point cursor in Index entry"
1179 PrintLog "Edit / Index entry"
1180 Kontext "VerzeichniseintragBearbeiten"
1181 Call DialogTest (VerzeichniseintragBearbeiten)
1182 BearbeitenSchliessen.Click
1184 Warnlog "Not able to edit index entry!"
1188 PrintLog "Close active document"
1191 '----------------------------------------------------------------
1194 PrintLog "- Edit/Links"
1197 sFile = gTesttoolPath & "writer\required\input\graphics\jolink.jpg"
1199 if ( gApplication = "HTML" ) then
1200 printlog "Not in WriterWeb!"
1204 printlog( "Open a new document" )
1207 printlog( "Insert graphic file (linked): " & sFile )
1208 Call hGrafikVerknuepftEinfuegen ( sFile )
1210 printlog( "Edit->Links" )
1211 if ( hUseAsyncSlot( "EditLinksWriter" ) = -1 ) then
1212 Warnlog "Error on calling Edit / Links ! (disabled)"
1217 Kontext "VerknuepfungenBearbeiten"
1218 if ( VerknuepfungenBearbeiten.Exists( 1 ) ) then
1219 Call DialogTest ( VerknuepfungenBearbeiten )
1221 Kontext "VerknuepfungenBearbeiten"
1222 printlog( "Click <Change>" )
1223 if ( hClickButton( Aendern ) > -1 ) then
1224 Kontext "GrafikEinfuegenDlg"
1225 call DialogTest( GrafikEinfuegenDlg )
1226 hCloseDialog( GrafikEinfuegenDlg, "cancel" )
1228 Warnlog "Error modifying the link!"
1231 Kontext "VerknuepfungenBearbeiten"
1232 printlog( "Click <Update>" )
1233 if ( hClickButton( Aktualisieren ) = -1 ) then
1234 Warnlog "Error on updating the link!"
1237 Kontext "VerknuepfungenBearbeiten"
1238 printlog( "Click <Release>" )
1239 if ( hClickButton( Loesen ) > -1 ) then
1241 printlog( "Check for confirmation message" )
1242 if ( Active.Exists( 1 ) ) then
1243 printlog( "Message displayed, good. Closing with <No>" )
1244 printlog( Active.getText() )
1247 Warnlog( "The <Are you sure you want to remove the selected link?> message is missing" )
1250 Warnlog( "Unable to break the link to the file" )
1253 Kontext "VerknuepfungenBearbeiten"
1254 hCloseDialog( VerknuepfungenBearbeiten, "close" )
1256 Warnlog "Dialog Edit / Links not opened!"
1258 PrintLog "Close active document"
1262 '------------------------------------------------------
1264 testcase tEditPlugIn
1265 PrintLog "- Edit/PlugIn"
1266 PrintLog "Open new document"
1268 PrintLog "Edit / Plugin"
1271 PrintLog "Edit / Plugin"
1273 PrintLog "Close active document"
1277 '------------------------------------------------------
1279 testcase tEditImageMap
1281 PrintLog "- Edit / ImageMap"
1284 sFile = gTesttoolPath & "writer\required\input\graphics\jolink.jpg"
1286 PrintLog "Open new document"
1289 printlog( "Insert graphics file: " & sFile )
1290 if ( hGrafikEinfuegen( sFile ) ) then
1292 printlog( "Edit->Imagemap" )
1295 Kontext "ImageMapEditor"
1296 if ( ImageMapEditor.exists( 1 ) ) then
1297 Call DialogTest (ImageMapEditor)
1298 hCloseDialog( ImageMapEditor, "close" )
1300 printlog( "Check for <Imagemap changed> messagebox (should not appear)" )
1302 if ( Active.exists( 1 ) ) then
1303 qaerrorlog( "#i109605# - <imagemap changed> message displayed." )
1304 printlog( Active.getText )
1307 printlog( "No messagebox on close, good." )
1311 warnlog( "Dialog <ImageMapEditor> did not open" )
1314 warnlog( "Insert graphics failed" )
1317 PrintLog "Close active document"
1321 '------------------------------------------------------
1323 testcase tEditObjectEdit
1324 PrintLog "Edit / Object / Edit"
1326 PrintLog "Open new document"
1330 Call gMouseClick (99,1)
1331 Call gMouseClick (99,1)
1332 Call gMouseClick (99,1)
1334 Call wTypeKeys("<SHIFT F4>")
1338 warnlog "Edit/Object/Edit is disabled with chart added"
1341 PrintLog "Close active document"
1345 '----------------------------------------------------------------
1347 testcase tMasterDocEditNavigator
1348 printlog "- View/Navigator"
1349 Dim ToolboxOk as boolean
1351 gApplication = "MASTERDOCUMENT"
1353 PrintLog "Open new document"
1355 Kontext "NavigatorGlobalDoc"
1356 if Not NavigatorGlobalDoc.Exists then ViewNavigator
1357 Kontext "NavigatorGlobalDoc"
1358 Call DialogTest ( NavigatorGlobalDoc )
1360 printlog " - Umschalten"
1361 GlobaldokumentToolbox.Click Umschalten
1363 kontext "NavigatorWriter"
1366 Toolbox.TearOff Navigation
1367 Kontext "NavigationsFenster"
1368 NavigationsFenster.Close
1370 Warnlog "Unable to Tear off Navigation Toolbox!"
1373 Kontext "NavigatorWriter"
1375 Kontext "NavigatorGlobalDoc"
1378 printlog " - Bearbeiten"
1386 Warnlog " Either taking more than three seconds to switch Navigator-modes, or something has gone wrong."
1394 PrintLog "Close active document"
1396 gApplication = "WRITER"
1399 '---------------------------------------------------