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: help_bookmarks.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $
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 : joerg.skottke@sun.com
36 '* short description : Bookmarks in the help browser
38 '\******************************************************************************
40 testcase tHelpBookmarks
42 '///<H1>Bookmarks in the help browser</H1>
43 '///<h2>help_bookmarks.bas::tHelpBookmarks</h2>
46 dim cStringFind as string
47 dim cStringBookmark as string
48 dim iItemCount as integer
49 const MYBOOKMARK = "myBookMark"
51 '///+<li>Open Help</li>
54 warnlog( "Help not open, aborting test" )
58 '///+<li>Select "Find" tab</li>
59 brc = hSelectHelpTab( "find" )
61 '///+<li>Enter Search Term (Java)</li>
62 SearchFind.setText( "java" )
64 '///+<li>Search whole words and headers only</li>
65 FindInHeadingsOnly.check()
69 '///+<li>Select first match and display the item</li>
71 cStringFind = Result.getSelText()
74 '///+<li>Switch to the bookmarks tab</li>
75 brc = hSelectHelpTab( "bookmarks" )
77 '///+<li>Click the "Add Bookmark" button</li>
78 printlog( " Adding bookmark" )
81 '///+<li>Name the bookmark after checking its default name</li>
84 printlog( " Verifying default name of bookmark" )
85 cStringBookmark = BookmarkName.getText()
86 if ( cStringFind = cStringBookmark ) then
87 printlog( " Bookmark has correct default name: " & cStringFind )
89 warnlog( "Incorrect default name for new bookmark" )
92 printlog( " Accept default name, close dialog with ok" )
95 '///+<li>Verify that the bookmark has been added to the list</li>
96 hSelectHelpTab( "bookmarks" )
97 printlog( " Verify that the bookmark has been added" )
98 Kontext "BookmarksPage"
99 iItemCount = Bookmarks.getItemCount()
100 if ( iItemCount = 1 ) then
101 printlog( " The correct number of bookmarks is listed (1)" )
103 warnlog( "Incorrect number of bookmarks listed" )
106 '///+<li>Abort the test if there is no bookmark listed at all</li>
107 if ( iItemCount = 0 ) then
108 warnlog( "Bookmark has not been created, aborting test" )
113 '///+<li>Verify that the bookmark name makes it to the bookmarks list</li>
114 Kontext "BookmarksPage"
115 Bookmarks.select( 1 )
116 cStringBookmark = Bookmarks.getSelText()
117 if ( cStringBookmark = cStringFind ) then
118 printlog( " Name in the bookmarks-list: " & cStringFind )
120 warnlog( "Incorrect name in bookmarks list: " & cStringBookmark )
123 '///+<li>Close the help</li>
126 '///+<li>Reopen Help</li>
129 '///+<li>Verify that the bookmark is still present</li>
130 brc = hSelectHelpTab( "bookmarks" )
132 '///+<li>Open context menu, select "Rename"</li>
133 printlog( " Open the context menu and rename the bookmark" )
134 Kontext "BookmarksPage"
135 Bookmarks.select( 1 )
136 brc = hUseBookmarksContextMenu( "rename" )
138 '///+<li>Change the name of the bookmark, accept with ok</li>
139 Kontext "AddBookmark"
140 if ( brc and AddBookmark.exists() ) then
141 BookmarkName.setText( MYBOOKMARK )
144 warnlog( "The AddBookmarks dialog is not open" )
147 '///+<li>Verify that the changed name is listed in the listbox</li>
148 hSelectHelpTab( "bookmarks" )
149 kontext "BookmarksPage"
150 Bookmarks.select( 1 )
151 cStringBookmark = Bookmarks.getSelText()
152 if ( cStringBookmark = MYBOOKMARK ) then
153 printlog( " The Bookmark has been renamed: " & cStringBookmark )
155 warnlog( "Incorrect name displayed in bookmarks list" )
158 '///+<li>Close the Help, Close the Office</li>
161 '///+<li>Restart the office, open help, switch to Bookmarks tab</li>
162 printlog( " Exit and restart the office" )
163 call ExitRestartTheOffice()
165 brc = hSelectHelpTab( "bookmarks" )
167 '///+<li>Verify that the renamed bookmark still exists</li>
168 Kontext "BookmarksPage"
169 Bookmarks.select( 1 )
170 cStringBookmark = Bookmarks.getSelText()
171 if ( cStringBookmark = MYBOOKMARK ) then
172 printlog( " The bookmark has the correct name" )
174 warnlog( "Incorrect name displayed in bookmarks list" )
177 '///+<li>Delete the Bookmark (using context menu)</li>
178 brc = hUseBookmarksContextMenu( "delete" )
180 '///+<li>verify that the bookmark has been deleted (none left)</li>
182 if ( bookmarks.getItemCount = 0 ) then
183 printlog( " Bookmark has been deleted" )
185 warnlog( "There are bookmarks left over, please check" )
188 '///+<li>Close the help</li>
191 '///+<li>Open help, switch to bookmarks tab</li>
193 brc = hSelectHelpTab( "bookmarks" )
195 '///+<li>Verify that the bookmark has been deleted</li>
196 kontext "BookmarksPage"
197 iItemCount = Bookmarks.getItemCount()
198 if ( iItemCount = 0 ) then
199 printlog( " The bookmark has been deleted" )
201 warnlog( "Bookmarks have been left over, there should be none" )
204 '///+<li>Close help</li>