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: standard_toolbar_3.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:19:03 $
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 : global update test (Standardbar)
38 '\***************************************************************************
40 testcase tStandardBar_3
42 dim sFileOut as String
43 dim HyperlinkTabID as integer
44 dim iTabPage as integer
46 printlog( "Icons on the standardbar" )
50 printlog( "Cleanup test environment - delete files" )
51 sFileOut = hGetWorkPath() & "FWK-update-functionbar" & hGetSuffix( "current" )
52 ConvertPath ( sFileOut )
53 hDeleteFile( sFileOut )
55 printlog( "Reset the standardbar to defaults" )
58 printlog( "New Spreadsheet document" )
62 if ( Navigator.Exists() ) then
66 printlog( "Insert text into a random cell, press <Enter>" )
67 Kontext "DocumentCalc"
68 DocumentCalc.TypeKeys( "Only for a test.<Return>" )
71 printlog( "Press the 'Save' button" )
72 hWaitForObject( Speichern , 1000 )
76 Kontext "SpeichernDlg"
77 printlog( "- Save the file to: " & sFileOut )
78 Dateiname.SetText( sFileOut )
81 printlog( "Close the document" )
84 printlog( "Click the 'File Open' button" )
85 hUseAsyncSlot( "FileOpen" )
88 Printlog( "Load test file in read-only mode" )
89 if ( OeffnenDlg.exists( 2 ) ) then
90 Dateiname.SetText( sFileOut )
94 warnlog( "File Open dialog is missing" )
99 Kontext "DocumentCalc"
100 printlog( "Try to insert a chart to verify that the document is read-only (this should fail)" )
103 warnlog( "The document is not read-only" )
107 Kontext "Standardbar"
108 printlog( "Click the <Edit File> button" )
109 hWaitForObject( Bearbeiten , 1000 )
110 Bearbeiten.click() : WaitSlot()
112 printlog( "Try to insert a chart (should work this time)" )
115 Kontext "ChartWizard"
116 if ( ChartWizard.exists( 2 ) ) then
117 printlog( "Cancel Chart Wizard" )
121 warnlog( "Chart Wizard should be open" )
124 printlog( "Select a few cells for Cut/Copy/Paste test" )
125 Kontext "DocumentCalc"
126 DocumentCalc.TypeKeys( "<Up>", 7 )
127 DocumentCalc.TypeKeys( "<Shift Down>", 5 )
130 Kontext "Standardbar"
131 hWaitForObject( Ausschneiden , 1000 )
135 Kontext "DocumentCalc"
136 printlog( "Move down one cell" )
137 DocumentCalc.TypeKeys( "<Down>" )
140 Kontext "Standardbar"
141 sleep( 3 ) ' No better solution found yet.
144 Kontext "DocumentCalc"
145 printlog( "Move up 7 cells, then do <shift down>" )
146 DocumentCalc.TypeKeys( "<Up>", 7 )
147 DocumentCalc.TypeKeys( "<Shift Down>", 5 )
151 Kontext "Standardbar"
152 hWaitForObject( Kopieren , 1000 )
156 Kontext "DocumentCalc"
157 printlog( "Press right arrow and RETURN" )
158 DocumentCalc.TypeKeys( "<Right><Return>" )
161 printlog( "Paste again" )
162 Kontext "Standardbar"
163 hWaitForObject( Einfuegen , 1000 )
167 hWaitForObject( Undo , 2000 )
172 hWaitForObject( Redo , 2000 )
176 Kontext "Standardbar"
177 printlog( "Open Navigator" )
178 hWaitForObject( NavigatorButton , 1000 )
179 NavigatorButton.Click()
182 if ( Navigator.Exists( 1 ) ) then
183 printlog( "Close Navigator" )
184 Kontext "Standardbar"
185 NavigatorButton.Click()
187 warnlog( "Navigator did not open" )
191 if ( Navigator.exists() ) then
192 warnlog( "The navigator should not be visible" )
195 Kontext "Standardbar"
196 printlog( "Click <HyperLink> to open the dialog" )
197 hWaitForObject( HyperlinkDialog , 1000 )
198 HyperlinkDialog.Click()
200 for iTabPage = 1 to 4
202 case 1: Kontext "Hyperlink"
203 if ( Hyperlink.exists() ) then HyperlinkTabID = 1
205 case 2: kontext "TabHyperlinkMailUndNews"
206 if ( TabHyperlinkMailUndNews.exists() ) then HyperlinkTabID = 2
208 case 3: kontext "TabHyperlinkDokument"
209 if ( TabHyperlinkDokument.exists() ) then HyperlinkTabID = 3
211 case 4: kontext "TabHyperlinkNeuesDokument"
212 if ( TabHyperlinkNeuesDokument.exists() ) then HyperlinkTabID = 4
219 if ( HyperlinkTabID > 0 ) then
221 if ( HyperlinkTabID <> 1 ) then
222 qaerrorlog( "This is not the internet tabpage, did you " & _
223 "kill the userlayer before running the test?" )
226 kontext "Standardbar"
227 printlog( "Click <HyperLink> to close" )
228 HyperlinkDialog.Click()
231 warnlog( "#i104704# - Insert Hyperlink dialog cannot be accessed" )
232 Kontext "Standardbar"
233 HyperlinkDialog.Click()
236 Kontext "Standardbar"
237 printlog( "Gallery button" )
238 hWaitForObject( GalleryButton , 1000 )
239 GalleryButton.Click()
242 if ( Gallery.exists( 3 ) ) then
243 printlog( "Gallery button again, to close" )
244 kontext "StandardBar"
245 GalleryButton.click()
249 if ( Gallery.exists() ) then
250 warnlog( "Gallery did not close " )
253 warnlog( "The Gallery did not open" )
256 printlog( "Close all documents and delete files" )
258 hDeleteFile( sFileOut )