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 : gregor.hartmann@oracle.com
30 '* short description : Bookmarks in the help browser
32 '\******************************************************************************
34 testcase tHelpBookmarks
36 printlog( "Bookmarks in Help Browser")
38 dim cStringFind as string
39 dim cStringBookmark as string
40 dim iItemCount as integer
41 const MYBOOKMARK = "myBookMark"
43 printlog( "Open Help Browser")
46 warnlog( "Help not open, aborting test")
50 printlog( "Switch to Search Tab (Find)")
51 brc = hSelectHelpTab( "find")
53 printlog( "Enter <Java> as search term")
54 SearchFind.setText( "java")
56 printlog( "Search whole words and headers only")
57 FindInHeadingsOnly.check()
61 printlog( "Select first match and display the item")
63 cStringFind = Result.getSelText()
66 printlog( "Switch to the bookmarks tab")
67 hSelectHelpTab( "bookmarks")
69 printlog( "Click the <Add Bookmark> button")
73 printlog( "Name the bookmark after checking its default name")
74 cStringBookmark = BookmarkName.getText()
75 if ( cStringFind = cStringBookmark ) then
76 printlog( "Bookmark has correct default name: " & cStringFind )
78 warnlog( "Incorrect default name for new bookmark")
81 printlog( "Accept default name, close dialog with ok")
84 printlog( "Verify that the bookmark has been added to the list")
85 hSelectHelpTab( "bookmarks")
87 Kontext "BookmarksPage"
88 printlog( "Verify that the bookmark has been added")
89 iItemCount = Bookmarks.getItemCount()
90 if ( iItemCount = 1 ) then
91 printlog( "The correct number of bookmarks is listed (1)")
93 warnlog( "Incorrect number of bookmarks listed")
96 printlog( "Abort the test if there is no bookmark listed at all")
97 if ( iItemCount = 0 ) then
98 warnlog( "Bookmark has not been created, aborting test")
103 Kontext "BookmarksPage"
104 printlog( "Verify that the bookmark name makes it to the bookmarks list")
105 Bookmarks.select( 1 )
106 cStringBookmark = Bookmarks.getSelText()
107 if ( cStringBookmark = cStringFind ) then
108 printlog( "Name in the bookmarks-list: " & cStringFind )
110 warnlog( "Incorrect name in bookmarks list: " & cStringBookmark )
113 printlog( "Close the help")
116 printlog( "Reopen Help")
119 printlog( "Verify that the bookmark is still present")
120 hSelectHelpTab( "bookmarks")
122 printlog( "Open the context menu and rename the bookmark")
123 Kontext "BookmarksPage"
124 Bookmarks.select( 1 )
125 brc = hUseBookmarksContextMenu( "rename")
127 printlog( "Change the name of the bookmark, accept with ok")
128 Kontext "AddBookmark"
129 if ( brc and AddBookmark.exists() ) then
130 BookmarkName.setText( MYBOOKMARK )
133 warnlog( "The AddBookmarks dialog is not open")
136 printlog( "Verify that the changed name is listed in the listbox")
137 hSelectHelpTab( "bookmarks")
139 kontext "BookmarksPage"
140 Bookmarks.select( 1 )
141 cStringBookmark = Bookmarks.getSelText()
142 if ( cStringBookmark = MYBOOKMARK ) then
143 printlog( "The Bookmark has been renamed: " & cStringBookmark )
145 warnlog( "Incorrect name displayed in bookmarks list")
148 printlog( "Close the Help, Close the Office")
151 printlog( "Restart the office, open help, switch to Bookmarks tab")
152 call ExitRestartTheOffice()
154 hSelectHelpTab( "bookmarks")
156 printlog( "Verify that the renamed bookmark still exists")
157 Kontext "BookmarksPage"
158 if ( Bookmarks.getItemCount() > 0 ) then
159 Bookmarks.select( 1 )
160 cStringBookmark = Bookmarks.getSelText()
161 if ( cStringBookmark = MYBOOKMARK ) then
162 printlog( "The bookmark has the correct name")
164 warnlog( "Incorrect name displayed in bookmarks list")
167 printlog( "Delete the Bookmark (using context menu)")
168 hUseBookmarksContextMenu( "delete")
170 printlog( "verify that the bookmark has been deleted (none left)")
172 if ( bookmarks.getItemCount = 0 ) then
173 printlog( "Bookmark has been deleted")
175 warnlog( "There are bookmarks left over, please check")
178 warnlog( "Bookmarks are lost on program restart")
181 printlog( "Close the help")
184 printlog( "Open help, switch to bookmarks tab")
186 hSelectHelpTab( "bookmarks")
188 printlog( "Verify that the bookmark has been deleted")
189 kontext "BookmarksPage"
190 iItemCount = Bookmarks.getItemCount()
191 if ( iItemCount = 0 ) then
192 printlog( "The bookmark has been deleted")
194 warnlog( "Bookmarks have been left over, there should be none")
197 printlog( "Close help")