1 '**************************************************************************
2 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 '* Copyright 2008 by Sun Microsystems, Inc.
6 '* OpenOffice.org - a multi-platform office productivity suite
8 '* $RCSfile: w_navigator.inc,v $
12 '* last change: $Author: vg $ $Date: 2008-08-18 12:31:20 $
14 '* This file is part of OpenOffice.org.
16 '* OpenOffice.org is free software: you can redistribute it and/or modify
17 '* it under the terms of the GNU Lesser General Public License version 3
18 '* only, as published by the Free Software Foundation.
20 '* OpenOffice.org is distributed in the hope that it will be useful,
21 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
22 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 '* GNU Lesser General Public License version 3 for more details
24 '* (a copy is included in the LICENSE file that accompanied this code).
26 '* You should have received a copy of the GNU Lesser General Public License
27 '* version 3 along with OpenOffice.org. If not, see
28 '* <http://www.openoffice.org/license.html>
29 '* for a copy of the LGPLv3 License.
31 '/************************************************************************
33 '* owner : helge.delfs@sun.com
35 '* short description : Navigator test
37 '\***********************************************************************
40 printLog Chr(13) + "--------- Navigator Functions - ----------"
42 Call tViewNavigator1 ' alle Methoden am Dockingwindow - Navigator
43 Call tViewNavigator2 ' dokument?bergreifenden Methoden am Dockingwindow
44 Call tViewNavigator3 ' Funktionen testen
45 Call tViewNavigator4 ' Inhaltsansicht des Navigators ?berpr?fen
46 Call tViewNavigator5 ' Anspringen von Punkten im Dokument ?ber die Inhaltsansicht
47 Call tViewNavigator6 ' Umbenennen von Objekten aus dem Navigator
51 ' **********************************************************************
53 testcase tViewNavigator1
54 Dim xPos as long : Dim yPos as long: Dim xSize% : Dim ySize%
56 '/// Edit / Navigator ( all methods from Navigator as Window ) ///
57 printlog "- Edit / Navigator : all methods from Navigator as Window"
60 '/// Call Navigator with 'F5' ///
61 printlog " - Call Navigator with F5"
65 if Navigator.NotExists then
66 Warnlog "No Navigator with F5"
70 '/// Move Navigator ///
71 printlog " - move Navigator"
72 Navigator.Move 300, 400
74 Navigator.Move 590, 790
79 xPos = Navigator.GetPosX
80 yPos = Navigator.GetPosY
81 xSize% = Navigator.GetSizeX
82 ySize% = Navigator.GetSizeY
84 '/// Size Navigator ///
85 printlog " - size Navigator"
87 Navigator.Size (300, 400)
89 Warnlog "Sizen Navigator doesn't work.. see #i32449"
93 Navigator.Size (xSize%, ySize%)
95 Printlog "Sizen Navigator doesn't work.. see #i32449"
100 '/// Close and reopen Navigator, size should not change ///
101 printlog " - Close Navigator and reopen, the size has to be the same"
102 xPos = Navigator.GetPosX
103 yPos = Navigator.GetPosY
104 xSize% = Navigator.GetSizeX
105 ySize% = Navigator.GetSizeY
109 if xPos <> Navigator.GetPosX then Warnlog "X-Pos. has been changed : Should -> "+ xPos + " Is -> "+ Navigator.GetPosX
110 if yPos <> Navigator.GetPosY then Warnlog "Y-Pos. has been changed : Should -> "+ yPos + " Is -> "+ Navigator.GetPosY
111 if xSize% <> Navigator.GetSizeX then Warnlog "X-Size has been changed : Should -> "+ xSize% + " Is -> "+ Navigator.GetSizeX
112 if ySize% <> Navigator.GetSizeY then Warnlog "Y-Size has been changed : Should -> "+ ySize% + " Is -> "+ Navigator.GetSizeY
114 '/// Close Navigator ///
118 Warnlog "Unable to close Navigator!"
120 '/// Close document ///
124 ' **********************************************************************
126 testcase tViewNavigator2
127 Dim xPos% : Dim yPos% : Dim xSize% : Dim ySize%
128 Dim datgeht as boolean
129 if gApplication <> "WRITER" then
132 '/// Edit / Navigator ( document-spreading methods with Navigator as Window ) ///
133 printlog "- Edit / Navigator : document-spreading methods with Navigator as Window"
134 '/// New document ///
136 printlog " - Call Navigator in Document and check in another"
137 '/// Insert some text in first document ///
138 call wTypeKeys "Navigator test document 1"
140 '/// Edit / Navigator ///
142 if Navigator.NotExists then ViewNavigator
143 '/// New document ///
145 '/// Insert some text in second document ///
146 call wTypeKeys "Navigator test document 1"
149 '/// Check if Navigator has been opened in new document ///
150 if Navigator.NotExists then Warnlog "In new Document is no Navigator"
152 '/// Close both documents and reopen one ///
153 printlog " - Close all documents and reopen one"
159 '/// Check if Navigator has been opened with document ///
160 Kontext "NavigatorWriter"
161 if NavigatorWriter.NotExists then Warnlog "In new Document is no Navigator"
162 call wTypeKeys "This is a navigator test!"
164 '/// Dock Navigator ///
165 printlog " - dock Navigator in Document and check in another"
169 '/// New Document ///
171 '/// Check if Navigator is in new document docked ///
173 if NOT Navigator.IsDocked then Warnlog "In new Document Navigator is not docked"
175 '/// Close all documents reopen a new and check if Navigator is docked ///
176 printlog " - Close all documents reopen a new and check if Navigator is docked"
181 '/// New document ///
185 DocumentWriter.FadeOut
187 Warnlog "#i35096#Unable to Fade out Navigator!"
190 DocumentWriter.FadeIn
192 Warnlog "#i35096#Unable to Fade out Navigator!"
196 if NOT Navigator.IsDocked then Warnlog "In new Document Navigator is not docked"
198 printlog " - Close Navigator with <F5>"
201 '/// Undock Navigator and close with 'F5' ///
202 call wTypeKeys "<F5>"
205 if NOT Navigator.NotExists then
206 Warnlog "Navigator is already open"
210 Warnlog "Could not close Navigator!"
213 '/// Close document ///
217 ' **********************************************************************
219 testcase tViewNavigator3
220 WarnLog "#i94614# - tViewNavigator3 outcommented"
223 Dim NavigationTearOff as boolean
224 '/// Edit / Navigator : check some Navigator-Functions ///
225 printlog "- Edit / Navigator : check some Navigator-Functions"
226 '/// Open document ( navigator.odt ) ///
227 Call hFileOpen ( gTesttoolpath + "writer\optional\input\navigator\navigator.odt" )
228 Call sMakeReadOnlyDocumentEditable
229 '/// Open Navigator ///
231 if Navigator.NotExists then ViewNavigator
232 Kontext "NavigatorWriter"
233 '/// Enter Pagenumber '5' in Navigator
234 Seitennummer.Settext "5"
235 printlog " - Navigation"
236 '/// Tear Off Navigation Window ///
237 NavigationTearOff = False
240 NavigationTearOff = true
242 Warnlog "Unable to tear off Navigation Toolbar! (#i32092)"
244 if NavigationTearOff = true then
246 Kontext "NavigationsFenster"
247 '/// Move Navigation Window ///
248 NavigationsFenster.Move 300, 400
250 '/// Minimize Navigation Window ///
251 NavigationsFenster.Minimize
253 '/// Maximize Navigation Window ///
254 NavigationsFenster.Maximize
256 Auswahl.MouseDoubleClick ( 45, 20 )
258 '/// Close Navigation Window ///
259 NavigationsFenster.Close
262 '/// Functions in Navigator ///
263 printlog " - next Page"
264 Kontext "NavigatorWriter"
266 '/// previous page ///
267 printlog " - previous page"
270 Call gMouseClick ( 20, 30 )
271 call wTypeKeys " <Left>"
273 InsertFieldsPageNumbers
274 call wTypeKeys "+0<Shift Left><Shift Left><Shift Left>"
279 if GetClipboardText <> "4" then QAErrorlog "#i94614#Previous Page isn't 4 but " & GetClipboardText
280 Kontext "NavigatorWriter"
282 '/// Click Next page 2 times ///
287 Call gMouseClick 20, 60
288 call wTypeKeys " <Left>"
290 InsertFieldsPageNumbers
291 call wTypeKeys "+0<Shift Left><Shift Left><Shift Left>"
295 if GetClipboardText <> "6" then QAErrorlog "#i94614#Next Page isn't 6 but " & GetClipboardText
296 Kontext "NavigatorWriter"
298 printlog " - switch Selectbox off and on"
299 '/// Switsch Select box off and on ///
300 if Auswahlliste.Exists then Auswahlbox.Click
304 if Auswahlliste.NotExists then
305 Warnlog "Navigator hasn't been sized to default size"
308 Kontext "NavigatorWriter"
310 printlog " - Set Reminder"
311 '/// Set Reminder ///
315 printlog " - jump to header"
316 '/// Select Jump to header ///
319 call wTypeKeys "<Home><Shift End>"
322 if GetClipboardText <> "Kopfzeile" then Warnlog "Cursorposition wrong: Not in Header"
323 Kontext "NavigatorWriter"
325 '/// Select Jump to Footer ///
326 printlog " - jump to footer"
329 call wTypeKeys "<Home><Shift End>"
332 if GetClipboardText <> "Fusszeile" then Warnlog "Cursorposition wrong: Not in Footer"
333 Kontext "NavigatorWriter"
335 printlog " - to Anchor <-> Text"
336 '/// Select Anchor to Text ///
339 call wTypeKeys "<Right><Shift Mod1 Right><Shift Left>"
342 if GetClipboardText <> "sed" then Warnlog "Cursorposition wrong: Not in Footer"
344 Kontext "NavigatorWriter"
347 call wTypeKeys "<Home><Shift End>"
350 if GetClipboardText <> "Fussnote" then Warnlog "Cursorposition wrong: Not in Footer"
352 '/// Close Navigator ///
357 Warnlog "Could not close Navigator!"
359 '/// Close document ///
363 ' **********************************************************************
365 testcase tViewNavigator4
366 Dim i : Dim j : Dim Ende : Dim k
367 Dim AlteGruppe$ : Dim AlterUnterwert$
369 if gApplication <> "WRITER" then
372 printlog "- Edit / Navigator : check entry's in Navigator Index"
373 '/// File / Open / 'gTesttoolpath + "writer\optional\input\navigator\navigator.odt"' ///
374 Call hFileOpen ( gTesttoolpath + "writer\optional\input\navigator\navigator.odt" )
375 Call sMakeReadOnlyDocumentEditable
376 '/// Open Navigator through Edit / Navigator ///
378 Kontext "NavigatorWriter"
379 '/// Check all entrys in Navigator and notice the name ///
381 Call wNavigatorAuswahl(i,0) ' Gruppe im Navigator
382 Kontext "NavigatorWriter"
383 printlog "- " + Auswahlliste.Gettext
384 AlteGruppe$ = Auswahlliste.Gettext ' Gruppe merken
386 case 1 : Ende = 7 ' Headings does not work ( Testtoolproblem )
387 case 2 : Ende = 4 ' Tables
388 case 3 : Ende = 1 ' text frame
389 case 4 : Ende = 3 ' Graphics
390 case 5 : Ende = 0 ' OLE-Objects
391 case 6 : Ende = 3 ' Bookmarks
392 case 7 : Ende = 0 ' Sections
393 case 8 : Ende = 2 ' Hyperlinks
394 case 9 : Ende = 0 ' References
395 case 10 : Ende = 0 ' Indexes
396 case 11 : Ende = 0 ' Notes
397 case 12 : Ende = 0 ' Drawing objects
400 Call wNavigatorAuswahl(i,Ende) ' Eintrag im Navigator
401 Kontext "NavigatorWriter"
402 '/// Switch in Navigator to Index View ///
403 AlterUnterwert$ = Auswahlliste.Gettext ' Eintrag merken
405 Auswahlliste.TypeKeys "<Up>", 12
406 if Auswahlliste.Gettext <>AlteGruppe$ then
407 if i <> 1 then Warnlog "- Wrong group with switching to Index View"
409 Auswahlliste.TypeKeys "<Down>",Ende + 1
410 if Auswahlliste.Gettext <> AlterUnterwert$ then Warnlog "Not all Subpoints in Index View are visible"
413 '/// Compare entrys in index view with entrys in Navigator///
419 Warnlog "Could not close Navigator!"
421 '/// Close Navigator ///
423 '/// Close document ///
426 ' **********************************************************************
428 testcase tViewNavigator5
429 QaErrorLog "#i94614# - tViewNavigator5 outcommented"
432 if gApplication <> "WRITER" then
438 Dim Bildname as string
441 printlog "- Edit / Navigator : Check Jumpmark from Index in Navigator"
442 '/// File / Open / 'gTesttoolpath + "writer\optional\input\navigator\navigator.odt"' ///
443 Call hFileOpen ( gTesttoolpath + "writer\optional\input\navigator\navigator.odt" )
444 Call sMakeReadOnlyDocumentEditable
445 '/// Open Navigator ///
446 Kontext "NavigatorWriter"
447 if Not NavigatorWriter.Exists then
449 Kontext "NavigatorWriter"
453 '/// In Navigator switch to Index view ///
454 Call wNavigatorAuswahl(1,0)
455 Kontext "NavigatorWriter"
458 '/// In Navigator select 'Headings' and jump to headers in document ///
460 Auswahlliste.TypeKeys "<Home>"
461 Auswahlliste.TypeKeys "<+>"
462 if Auswahlliste.GetItemCount = 8 then
464 Auswahlliste.Select j
465 Auswahlliste.TypeKeys "<return>"
467 call wTypeKeys "<Home><Shift End>"
471 '/// Check if the correct header has been selected ///
472 if GetClipboardText <> "Heading " & j - 1 then Warnlog "Wrong Jumppoint: Should -> Heading " & j - 1 & " Is -> " & GetClipboardText
473 Kontext "NavigatorWriter"
476 Auswahlliste.TypeKeys "<down>"
477 Dummy = Auswahlliste.GetText
478 Auswahlliste.TypeKeys "<return>"
480 call wTypeKeys "<Home><Shift End>"
484 Kontext "NavigatorWriter"
487 Warnlog "There are not 7 but " & Auswahlliste.GetItemCount & " headings in navigator list"
489 '/// Select in Navigator entry 'Tables' and jump via Navigator to tables in document ///
491 Call wNavigatorAuswahl(2,0)
492 Kontext "NavigatorWriter"
496 Auswahlliste.TypeKeys "<Home>"
499 Auswahlliste.TypeKeys "<down><return>"
501 call wTypeKeys "<Home>"
502 call wTypeKeys "<Mod1 A>"
505 '/// Check if correct tables has been selected ///
506 if GetClipboardText <> "Tabelle" + j then Warnlog "Wrong Cursorposition: Should -> Tabelle" + j + " Is -> " + GetClipboardText
507 Kontext "NavigatorWriter"
510 '/// Select in Navigator entry 'Text frames' and jump via Navigator to text frames in document ///
511 printlog " - Text frames"
512 Call wNavigatorAuswahl(3,0)
513 Kontext "NavigatorWriter"
517 Auswahlliste.TypeKeys "<Home>"
518 Auswahlliste.TypeKeys "<Down><Return>"
520 call wTypeKeys "<Home><Shift End>"
522 '/// Check if correct text frames have been selected ///
525 if Left$(GetClipboardText,6) <> "Figura" then Warnlog "Wrong Cursorposition: Should -> Figura" + " Is -> "+ Left(GetClipboardText,6)
527 Printlog "Unable to go into the Text frame with testtool"
529 Kontext "NavigatorWriter"
531 '/// Select in Navigator entry 'Graphics' and jump via Navigator to graphics in document ///
532 printlog " - Graphics"
533 Call wNavigatorAuswahl(4,0)
534 Kontext "NavigatorWriter"
538 Auswahlliste.TypeKeys "<Home>"
539 '/// Check if correct graphic have been selected ///
541 Auswahlliste.TypeKeys "<down><return>"
545 Active.SetPage TabZusaetze
546 Kontext "TabZusaetze"
547 Bildname = ObjektName.GetText
549 case 1 : if Bildname <> "Der Baer" then Warnlog "Wrong Graphicname: Not -> 'Der B�r' But -> "+ Bildname
550 case 2 : if Bildname <> "Star Division" then Warnlog "Wrong Graphicname: Not -> 'Star Division' But -> "+ Bildname
551 case 3 : if Bildname <> "Der Hase" then Warnlog "Wrong Graphicname: Not -> 'Der Hase' But -> "+ Bildname
554 Kontext "NavigatorWriter"
557 '/// Select in Navigator entry 'Bookmarks' and jump via Navigator to references in document ///
558 printlog " - Bookmarks"
559 Call wNavigatorAuswahl(6,0)
560 Kontext "NavigatorWriter"
564 Auswahlliste.TypeKeys "<Home>"
566 Auswahlliste.TypeKeys "<down><return>"
568 call wTypeKeys "<Shift Mod1 Right>"
572 '/// Check if correct reference have been selected ///
574 case 1 : if GetClipboardText <> "rerum" then Warnlog "Wrong Bookmark: Should -> 'rerum' Is -> "+ GetClipboardText
575 case 2 : if GetClipboardText <> "non " then Warnlog "Wrong Bookmark: Should -> 'non' Is -> "+ GetClipboardText
576 case 3 : if GetClipboardText <> "invenietur" then Warnlog "Wrong Bookmark: Should -> 'invenietur' Is -> "+ GetClipboardText
578 Kontext "NavigatorWriter"
582 '/// Select in Navigator entry 'Hyperlinks' and jump via Navigator to hyperlinks in document ///
583 printlog " - Hyperlinks"
584 Call wNavigatorAuswahl(8,0)
585 Kontext "NavigatorWriter"
589 Auswahlliste.TypeKeys "<Home>"
592 Auswahlliste.TypeKeys "<down><return>"
596 '/// Check if correct hyperlinks have been selected ///
598 case 1 : if GetClipboardText <> "offensantes" then Warnlog "Wrong Hyperlink: Should -> 'offensantes' Is -> "+ GetClipboardText
599 case 2 : if GetClipboardText <> "decreverint" then Warnlog "Wrong Hyperlink: Should -> 'decreverint' Is -> "+ GetClipboardText
601 Kontext "NavigatorWriter"
605 '/// Close Navigator ///
610 Warnlog "Could not close Navigator!"
612 '/// Close document ///
616 ' **********************************************************************
618 testcase tViewNavigator6
620 Dim datIsderAlte(4) as string
622 if gApplication <> "WRITER" then
626 printlog "- Edit / Navigator : Rename Objects"
627 '/// File / Open / 'gTesttoolpath + "writer\optional\input\navigator\st1_1.sxw" ' ///
628 Call hFileOpen ( gTesttoolpath + "writer\optional\input\navigator\st1_1.sxw" )
629 Call sMakeReadOnlyDocumentEditable
631 '/// Open Navigator ///
632 if Navigator.NotExists then ViewNavigator
633 Kontext "NavigatorWriter"
634 Call wNavigatorAuswahl(1,0)
636 printlog "- rename Objects"
637 '/// Rename Objects in Navigator through context menue (4 Objects) ///
639 Kontext "NavigatorWriter"
641 Auswahlliste.Select j + 1
642 printlog "- Now "+ Auswahlliste.GetItemText(j+1) +" is selected!"
643 Auswahlliste.TypeKeys "+"
644 Auswahlliste.Select j + 2
646 datIsderAlte(j) = Auswahlliste.GetitemText(j+2)
648 Auswahlliste.OpenContextMenu
649 Call hMenuSelectNr(4) ' Object nmenu
651 Call hMenuSelectNr(3) ' Rename entry
654 Kontext "ObjekteUmbenennen"
655 if Not ObjekteUmbenennen.Exists then
656 Warnlog "- Dialog to rename object isn't up!"
658 Objektname.Settext "RenamingObjects" + j
663 Warnlog "- Object could not be renamed!"
664 ObjekteUmbenennen.Cancel
668 '/// Check in Navigator if Object has been renamed ///
670 Kontext "NavigatorWriter"
671 if Auswahlliste.GetItemText(j+2) = datIsderAlte(j) then Warnlog "- Entry " + datIsderAlte(j) + " wasn't renamed in Navigator!"
673 Auswahlliste.Select j+1
674 Auswahlliste.TypeKeys "-"
677 Call gMouseDoubleClick(99,50)
678 '/// Save document///
679 Call hFileSaveAsWithFilterKill (gOfficePath + "user\work\uvobj.odt", "writer8")
680 '/// Close document and reopen previous saved document ///
684 printlog "- Saving and Loading the document, check settings"
685 Call hFileOpen(gOfficePath + "user\work\uvobj.odt")
686 '/// Navigator has to be opened with document ///
688 if Navigator.NotExists then
689 Warnlog "- The Navigator should have been opened!"
692 Kontext "NavigatorWriter"
695 Auswahlliste.Select j
696 Auswahlliste.TypeKeys "-"
699 '/// Check table names in Navigator ///
701 Auswahlliste.Select 2
702 Auswahlliste.TypeKeys "+"
703 Auswahlliste.Select 3
704 Auswahlliste.OpenContextMenu
707 Call hMenuSelectNr(4)
709 Call hMenuSelectNr(1)
712 Warnlog "Unable to open Context-menu!"
718 Active.Setpage TabTabelle
720 if Tabellenname.Gettext<>"RenamingObjects1" then Warnlog "- Name of Table in Properties is wrong!"
723 Kontext "NavigatorWriter"
724 Auswahlliste.Select 2
725 Auswahlliste.TypeKeys "-"
727 '/// Check Text frames names in Navigator ///
728 printlog "- Text Frames"
729 Auswahlliste.Select 3
730 Auswahlliste.TypeKeys "+"
731 Auswahlliste.Select 4
732 Auswahlliste.OpenContextMenu
734 Call hMenuSelectNr(4)
736 Call hMenuSelectNr(1)
740 Active.Setpage TabZusaetze
745 Active.Setpage TabZusaetze
747 Kontext "TabZusaetze"
748 if Objektname.Gettext<>"RenamingObjects2" then Warnlog "- Name of textframe in Properties is wrong!"
751 Kontext "NavigatorWriter"
752 Auswahlliste.Select 3
753 Auswahlliste.TypeKeys "-"
755 '/// Check graphic names in Navigator ///
757 Auswahlliste.Select 4
758 Auswahlliste.TypeKeys "+"
759 Auswahlliste.Select 5
760 Auswahlliste.OpenContextMenu
761 Call hMenuSelectNr(4)
763 Call hMenuSelectNr(1)
767 Active.Setpage TabZusaetze
771 Active.Setpage TabZusaetze
773 Kontext "TabZusaetze"
774 if Objektname.Gettext<>"RenamingObjects3" then Warnlog "- Name of graphic in Properties is wrong!"
777 Kontext "NavigatorWriter"
778 Auswahlliste.Select 4
779 Auswahlliste.TypeKeys "-"
781 '/// Check OLE-Objects names in Navigator ///
782 printlog "- Ole-Object"
783 Auswahlliste.Select 5
784 Auswahlliste.TypeKeys "+"
785 Auswahlliste.Select 6
786 Auswahlliste.OpenContextMenu
788 Call hMenuSelectNr(4)
790 Call hMenuSelectNr(1)
793 Warnlog "Unable to open context menu!"
798 Active.Setpage TabZusaetze
802 Active.Setpage TabZusaetze
805 Kontext "TabZusaetze"
806 if Objektname.Gettext<>"RenamingObjects4" then Warnlog "- Name of OLE-Oblect is wrong!"
810 '/// Close Navigator ///
813 '/// Close document ///