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_undo_history_3.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-09-04 09:20:44 $
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 : Writer Undo-History - Test
38 '\***********************************************************************
42 Call tUndoSection ' Section (Insert/Modify/Delete)
43 Call tUndoHyperlink ' Hyperlink (Insert as Text/as URL button)
44 Call tUndoFootnote ' Footnote (Insert/Modify/Delete)
45 Call tUndoCaption ' Insert Caption
46 Call tUndoAutoText ' Insert Autotext
47 Call tUndoBookmark ' Bookmark (Insert/Rename/Delete)
48 Call tUndoNote ' Note (Insert/Delete)
49 Call tUndoScript ' Script (Insert/Delete)
50 Call tUndoIndexes ' Index/Bibliography entrys (Insert/Delete)
51 Call tUndoFrames ' Frames (Insert/Rename/Delete)
52 Call tUndoTableGeneral ' Tables Part 1
53 Call tUndoTableOptionsMerge ' Tables Part 2
54 Call tUndoTableConvertSort ' Tables Part 3
55 Call tUndoTableSplitDelete ' Tables Part 4
56 Call tUndoHorizontalRuler ' Horizontal ruler
57 Call tUndoGraphics ' Graphics (Insert/Replace/Delete)
63 '/// <B>Section (Insert/Modify/Delete)</B>
64 printlog "Section (Insert)"
70 Active.Setpage TabBereiche
73 '/// string in Undo-list has to be: "Insert section")
74 Call CheckUndoStringInUndoList ( 10, "InsertSection" )
76 printlog "Section (Modify)"
77 '/// Open navigator and select section
78 Call wNavigatorAuswahl ( 7, 1, true )
79 Kontext "NavigatorWriter"
80 '/// Open contextmenu and choose 'Edit'
81 Auswahlliste.OpenContextMenu
85 '/// Change Background-Color
86 Kontext "BereicheBearbeiten"
89 Active.Setpage TabHintergrund
90 Kontext "TabHintergrund"
91 Hintergrundfarbe.TypeKeys "<Down>", 5
94 Kontext "BereicheBearbeiten"
96 '/// string in Undo-list has to be: "Modify section")
97 Call CheckUndoStringInUndoList ( 10, "ModifySection" )
99 printlog "Section (Delete)"
100 '/// Open navigator and select section
101 Call wNavigatorAuswahl ( 7, 1, true )
102 Kontext "NavigatorWriter"
103 '/// Open contextmenu and choose 'Edit'
104 Auswahlliste.OpenContextMenu
106 Call hMenuSelectNr(4)
107 '/// In 'Edit sections' dialog choose 'remove'
108 Kontext "BereicheBearbeiten"
110 BereicheBearbeiten.Ok
111 '/// string in Undo-list has to be: "Delete section")
112 Call CheckUndoStringInUndoList ( 10, "DeleteSection" )
120 testcase tUndoHyperlink
122 '///<B>Hyperlink (Insert as Text/as URL button)</B>
123 printlog "- Insert hyperlink as text"
126 '/// Insert / Hyperlink as Text
128 Call wEinfuegenHyperlink(1)
129 ZielURL.Settext "www.sun.com"
134 '/// string in Undo-list has to be: "Insert Hyperlink")
135 Call CheckUndoStringInUndoList ( 10, "InsertHyperlink" )
137 Call wTypeKeys "<Return>"
139 '/// Insert / Hyperlink as Button
140 printlog "- Insert hyperlink as Button"
142 Call wEinfuegenHyperlink(1)
143 ZielURL.Settext "www.sun.com"
149 '/// string in Undo-list has to be: "insert URL Button")
150 Call CheckUndoStringInUndoList ( 10, "InsertHyperlinkButton" )
158 testcase tUndoFootnote
160 '/// <B>Footnote (Insert/Modify/Delete)</B>
161 printlog "- Footnote (Insert)"
164 '/// Insert / Footnote
166 Kontext "FussnoteEinfuegen"
168 '/// string in Undo-list has to be: "Insert footnote")
169 Call CheckUndoStringInUndoList ( 10, "InsertFootnote" )
171 printlog "- Footnote (Modify)"
175 Active.Setpage TabFussnoten
176 Kontext "TabFussnoten"
178 '/// Change any option in footnote dialog
179 if Seitenende.IsChecked then
186 '/// string in Undo-list has to be: "Modify footnote options")
187 Call CheckUndoStringInUndoList ( 10, "ModifyFootnote" )
189 printlog "- Footnote (Delete)"
190 '/// Point cursor directly to the footnote anchor
191 Call wTypeKeys "<Mod1 Home>"
192 '/// press 'delete' to remove footnote
193 Call wTypeKeys "<Delete>"
194 '/// string in Undo-list has to be: "Delete footnote options")
195 Call CheckUndoStringInUndoList ( 10, "DeleteFootnote" )
202 testcase tUndoCaption
204 '/// <B>Insert a caption</B>
205 printlog "- Insert Caption"
208 '/// Insert a graphic
209 Call hGrafikEinfuegen ( gTesttoolPath & "writer\optional\input\graphics\jolink.jpg" )
210 '/// Insert / Caption
212 Kontext "Beschriftung"
213 '/// Insert a caption more than 20 characters long
214 Beschriftungstext.Settext "This caption has more than 20 characters"
217 '/// string in Undo-list has to be: "Insert Caption: This capt...aracters")
218 Call CheckUndoStringInUndoList ( 10, "InsertCaption" )
225 testcase tUndoAutoText
227 '/// <B>Insert autotext</B>
228 printlog "- Insert autotext"
231 '/// Insert dummy text
232 Call wBlindtextEinfuegen
234 '/// string in Undo-list has to be: "Insert Auto Text")
235 Call CheckUndoStringInUndoList ( 10, "InsertAutotext" )
242 testcase tUndoBookmark
244 Warnlog "#i102310# - tUndoBookmark outcommented due to bug."
248 '/// <B>Bookmark (Insert/Rename/Delete)</B>
249 printlog "- Insert Bookmark"
252 '/// Insert / Bookmark
254 Kontext "TextmarkeEinfuegen"
255 Textmarken.Settext "I'm a bookmark"
256 TextmarkeEinfuegen.Ok
257 '/// string in Undo-list has to be: "Insert Bookmark: I'm a bookmark")
258 Call CheckUndoStringInUndoList ( 10, "InsertBookmark" )
260 printlog "- Rename Bookmark"
261 '/// Open navigator and select bookmark
262 Call wNavigatorAuswahl ( 6, 1, true )
263 Kontext "NavigatorWriter"
264 '/// Open contextmenu and choose 'Edit'
265 Auswahlliste.OpenContextMenu
267 Call hMenuSelectNr(4)
269 Call hMenuSelectNr(3)
271 Kontext "ObjekteUmbenennen"
272 Objektname.Settext "a book"
274 '/// string in Undo-list has to be: "Rename Bookmark: a book")
275 Call CheckUndoStringInUndoList ( 10, "RenameBookmark" )
277 printlog "- Delete Bookmark"
278 '/// Open navigator and select bookmark
279 Call wNavigatorAuswahl ( 6, 1, true )
280 Kontext "NavigatorWriter"
281 '/// Open contextmenu and choose 'Edit'
282 Auswahlliste.OpenContextMenu
284 Call hMenuSelectNr(4)
286 Call hMenuSelectNr(2)
288 '/// string in Undo-list has to be: "Rename Bookmark: a book")
289 Call CheckUndoStringInUndoList ( 10, "DeleteBookmark" )
298 '/// <B>Note (Insert/Delete)</B>
299 printlog "- Insert Note"
304 '/// string in Undo-list has to be: "Insert note")
305 Call CheckUndoStringInUndoList ( 10, "InsertNote" )
306 printlog "- Delete Note"
307 '/// Bring up the Navigator, find the entry "Notes", expand it, and select the expanded section.
308 Call wNavigatorAuswahl( 11, 1 )
309 '/// Enter 'Delete' 'Backspace'
311 Navigator.TypeKeys "<DELETE>"
312 '/// Close the Navigator
314 '/// string in Undo-list has to be: "Delete: 'This is a note'")
315 Call CheckUndoStringInUndoList ( 10, "DeleteNote" )
324 '/// <B>Script (Insert/Delete)</B>
325 printlog "- Insert Script"
330 Kontext "ScriptEinfuegen"
332 '/// string in Undo-list has to be: "Insert script")
333 Call CheckUndoStringInUndoList ( 10, "InsertScript" )
335 '/// Point cursor directly to the script
336 Call wTypeKeys "<Mod1 Home>"
337 '/// press 'delete' to remove script
338 Call wTypeKeys "<Delete>"
339 '/// string in Undo-list has to be: "Delete script")
340 Call CheckUndoStringInUndoList ( 10, "DeleteScript" )
347 testcase tUndoIndexes
349 '/// <B>Indexes (Insert/Delete)</B>
350 printlog "- Insert Index entry"
354 Call wTypeKeys "IndexEntry"
355 Call wTypeKeys "<Shift Home>"
356 '/// Insert / Indexes and Tables / Entry
358 Kontext "VerzeichnisEintragEinfuegen"
360 VerzeichnisEintragEinfuegen.Close
361 '/// string in Undo-list has to be: "Insert index entry")
362 Call CheckUndoStringInUndoList ( 10, "InsertIndexEntry" )
364 printlog "delete index entry with 'Backspace'"
365 Call wTypeKeys ( "<Backspace>"
366 '/// string in Undo-list has to be: "Delete index entry")
367 Call CheckUndoStringInUndoList ( 10, "DeleteIndexEntry" )
370 Call wTypeKeys "BibliographyEntry"
371 Call wTypeKeys "<Shift Home>"
372 printlog "- Insert Bibliography entry"
373 printlog "Insert / Index / Bibliography entry"
374 InsertIndexesBibliographyEntry
375 Kontext "LiteratureintragEinfuegen"
376 EintragEinfuegen.Click
377 LiteratureintragEinfuegen.Close
378 '/// string in Undo-list has to be: "Insert bibliography entry")
379 Call CheckUndoStringInUndoList ( 10, "InsertBibliographyEntry" )
381 Printlog "delete bibliography entry with 'Backspace'"
382 Call wTypeKeys ( "<Backspace>"
383 '/// string in Undo-list has to be: "Delete bibliography entry")
384 Call CheckUndoStringInUndoList ( 10, "DeleteBibliographyEntry" )
393 '/// <B>Frames (Insert/Rename/Delete)</B>
394 printlog "- Insert Frame"
400 Active.Setpage TabZusaetze
401 Kontext "TabZusaetze"
402 ObjektName.Settext "MyFrame"
404 '/// string in Undo-list has to be: "Insert frame: MyFrame")
405 Call CheckUndoStringInUndoList ( 10, "InsertFrame" )
407 printlog "- Rename Frame"
408 '/// Open navigator and select frame
409 Call wNavigatorAuswahl ( 3, 1, true )
410 Kontext "NavigatorWriter"
411 '/// Open contextmenu and choose 'Edit'
412 Auswahlliste.OpenContextMenu
413 Call hMenuSelectNr(4)
414 Call hMenuSelectNr(3)
415 Kontext "ObjekteUmbenennen"
416 Objektname.Settext "MyRenamedFrame"
418 '/// string in Undo-list has to be: "Rename frame: 'MyFrame' -> 'MyRenamedFrame'")
419 Call CheckUndoStringInUndoList ( 10, "RenameFrame" )
420 printlog "- Delete Frame"
421 '/// Type 'Del' to delete the frame
422 Call wTypeKeys "<Delete>"
423 '/// string in Undo-list has to be: "Delete frame: 'MyRenamedFrame'")
424 Call CheckUndoStringInUndoList ( 10, "DeleteFrame" )
431 testcase tUndoTableGeneral
432 Dim sTableName as string
434 '/// <B>Tables Part 1</B>
435 printlog "- insert table"
440 Kontext "TabelleEinfuegenWriter"
441 sTableName = "MyTable"
442 Tabellenname.Settext sTableName
443 TabelleEinfuegenWriter.Ok
444 '/// string in Undo-list has to be: "Insert table")
445 Call CheckUndoStringInUndoList ( 10, "InsertTable" )
446 printlog "- Insert a row"
447 '/// <B>Insert a row</B>
448 Call hToolbarSelect("Table", true)
450 '/// string in Undo-list has to be: "Insert row")
451 Call CheckUndoStringInUndoList ( 10, "InsertRow" )
452 printlog "- Insert a column"
453 '/// <B>Insert a column</B>
454 Call hToolbarSelect("Table", true)
455 SpalteEinfuegen.Click
456 '/// string in Undo-list has to be: "Insert column")
457 Call CheckUndoStringInUndoList ( 10, "InsertColumn" )
458 printlog "- Delete a row"
459 '/// <B>Delete a row</B>
460 Call hToolbarSelect("Table", true)
462 '/// string in Undo-list has to be: "Delete row")
463 Call CheckUndoStringInUndoList ( 10, "DeleteRow" )
464 printlog "- Delete a column"
465 '/// <B>Delete a column</B>
466 Call hToolbarSelect("Table", true)
468 '/// string in Undo-list has to be: "Delete column")
469 Call CheckUndoStringInUndoList ( 10, "DeleteColumn" )
470 printlog "- format a cell"
471 '/// <B>Format cell (enable number recognition form that)</B>
473 Call hToolsOptions ("WRITER","Table")
474 if Not AutomatischeZahlenerkennung.IsChecked then AutomatischeZahlenerkennung.Check
475 Kontext "ExtrasOptionenDlg"
476 ExtrasOptionenDlg.Cancel
478 '/// type '1' in a cell
479 Call wTypeKeys ( "1" )
480 Call wTypeKeys ( "<Right>" )
481 '/// string in Undo-list has to be: "Format cell")
482 Call CheckUndoStringInUndoList ( 10, "FormatCell" )
485 Call hToolsOptions ("WRITER","Table")
486 if AutomatischeZahlenerkennung.IsChecked then AutomatischeZahlenerkennung.UnCheck
487 Kontext "ExtrasOptionenDlg"
488 ExtrasOptionenDlg.Cancel
495 testcase tUndoTableOptionsMerge
497 '/// <B>Tables Part 2</B>
498 printlog "- apply table attributes"
503 Kontext "TabelleEinfuegenWriter"
504 TabelleEinfuegenWriter.Ok
506 printlog "- apply attributes"
509 '/// change some table options
511 Active.Setpage TabTextflussTabelle
512 Kontext "TabTextflussTabelle"
513 if Umbruch.IsChecked then
518 TabTextflussTabelle.Ok
519 '/// string in Undo-list has to be: "Apply table attributes")
520 Call CheckUndoStringInUndoList ( 10, "ApplyTableAttributes" )
522 printlog "- merge tables"
523 '/// <B>Merge tables</B>
524 Call wTypeKeys ( "<Down>" ,2 )
525 '/// Insert a second table
527 Kontext "TabelleEinfuegenWriter"
528 TabelleEinfuegenWriter.Ok
529 '/// Format / Merge / Tables
531 '/// string in Undo-list has to be: "Merge table")
532 Call CheckUndoStringInUndoList ( 10, "MergeTable" )
539 testcase tUndoTableConvertSort
541 '/// <B>Tables Part 3</B>
542 printlog "- Convert to text"
545 '/// Insert text "This<Return>is a<Return>table to text<Return>text"
546 Call wTypeKeys ("This<Return>is a<Return>table to text<Return>text")
548 Call wTypeKeys ( "<Mod1 A>" )
549 '/// Format / Text <-> Table
551 Kontext "TextInTabelleUmwandeln"
552 TextInTabelleUmwandeln.OK
553 '/// string in Undo-list has to be: "Convert table -> text")
554 Call CheckUndoStringInUndoList ( 10, "ConvertTable" )
556 printlog "- Sort table"
557 '/// <B>Sort table</B>
558 Call wTypeKeys ( "<Mod1 A>", 2 )
559 '/// Select all -> Tools / Sort
563 '/// string in Undo-list has to be: "Sort table")
564 Call CheckUndoStringInUndoList ( 10, "SortTable" )
571 testcase tUndoTableSplitDelete
573 '/// <B>Tables Part 4</B>
574 printlog "- Split tables"
579 Kontext "TabelleEinfuegenWriter"
580 TabelleEinfuegenWriter.Ok
581 Call wTypeKeys ( "<Down>", 3 )
583 Kontext "TabelleEinfuegenWriter"
584 TabellenName.Settext "AnotherTable"
585 TabelleEinfuegenWriter.Ok
591 Kontext "TabelleAuftrennen"
593 '/// string in Undo-list has to be: "Split table")
594 Call CheckUndoStringInUndoList ( 10, "SplitTable" )
596 '/// <B>Delete table</B>
597 printlog "- Delete table"
598 '/// Open navigator and select table
599 Call wNavigatorAuswahl ( 2, 1, true )
600 Kontext "NavigatorWriter"
601 '/// Open contextmenu and choose 'Delete'
602 Auswahlliste.OpenContextMenu
603 Call hMenuSelectNr(4)
604 Call hMenuSelectNr(2)
605 '/// string in Undo-list has to be: "Delete table: 'AnotherTable'")
606 Call CheckUndoStringInUndoList ( 10, "DeleteTable" )
613 testcase tUndoHorizontalRuler
615 '/// <B>HorizontalRuler</B>
616 printlog "- Horizontal ruler"
619 '/// Insert / Horizontal Line
622 Kontext "HorizontaleLinieEinfuegen"
623 Auswahl.TypeKeys "<Down>", 4
624 HorizontaleLinieEinfuegen.Ok
625 '/// string in Undo-list has to be: "Insert horizontal ruler")
626 Call CheckUndoStringInUndoList ( 10, "InsertRuler" )
633 testcase tUndoGraphics
635 '/// <B>Graphics (Insert/Delete/Replace)</B>
636 printlog "- Insert graphics from file"
639 '/// Insert a graphic from file
640 Call hGrafikEinfuegen ( gTesttoolPath & "writer\optional\input\graphics\jolink.jpg" )
641 '/// string in Undo-list has to be: "Insert graphics")
642 Call CheckUndoStringInUndoList ( 10, "InsertGraphic" )
644 '/// <B>Delete graphic</B>
645 printlog "- delete graphic"
646 '/// press 'delete' to remove graphic
647 Call wTypeKeys "<Delete>"
648 '/// string in Undo-list has to be: "Delete graphics")
649 Call CheckUndoStringInUndoList ( 10, "DeleteGraphic" )
651 '/// <B>Insert graphic from gallery</B>
652 printlog "- insert graphic from gallery"
654 if Gallery.NotExists(2) then ToolsGallery
658 Call hMenuSelectNr(1)
659 Call hMenuSelectNr(1)
660 '/// string in Undo-list has to be: "Insert graphics")
661 Call CheckUndoStringInUndoList ( 10, "InsertGraphic" )
664 '/// <B>Replace graphic</B>
665 printlog "- replace graphic"
666 '/// Insert another graphics from gallery
669 Call hMenuSelectNr(1)
670 Call hMenuSelectNr(1)
671 '/// string in Undo-list has to be: "Replace graphics")
672 Call CheckUndoStringInUndoList ( 10, "ReplaceGraphic" )
676 if Gallery.Exists then ToolsGallery