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 : Items on the standardbar
32 '\***************************************************************************
34 testcase tStandardBar_3
36 printlog( "Items on the standardbar" )
38 dim sFileOut as String
39 dim HyperlinkTabID as integer
40 dim iTabPage as integer
44 printlog( "Cleanup test environment - delete files" )
45 sFileOut = hGetWorkPath() & "FWK-update-functionbar" & hGetSuffix( "current" )
46 ConvertPath ( sFileOut )
47 hDeleteFile( sFileOut )
49 printlog( "Reset the standardbar to defaults" )
52 printlog( "New Spreadsheet document" )
56 if ( Navigator.Exists() ) then
60 printlog( "Insert text into a random cell, press <Enter>" )
61 Kontext "DocumentCalc"
62 DocumentCalc.TypeKeys( "Only for a test.<Return>" )
65 printlog( "Press the 'Save' button" )
66 hWaitForObject( Speichern , 1000 )
70 Kontext "SpeichernDlg"
71 printlog( "- Save the file to: " & sFileOut )
72 Dateiname.SetText( sFileOut )
75 printlog( "Close the document" )
78 printlog( "Click the 'File Open' button" )
79 hUseAsyncSlot( "FileOpen" )
82 Printlog( "Load test file in read-only mode" )
83 if ( OeffnenDlg.exists( 2 ) ) then
84 Dateiname.SetText( sFileOut )
88 warnlog( "File Open dialog is missing" )
93 Kontext "DocumentCalc"
94 printlog( "Try to insert a chart to verify that the document is read-only (this should fail)" )
97 warnlog( "The document is not read-only" )
101 Kontext "Standardbar"
102 printlog( "Click the <Edit File> button" )
103 hWaitForObject( Bearbeiten , 1000 )
104 Bearbeiten.click() : WaitSlot()
106 printlog( "Try to insert a chart (should work this time)" )
109 Kontext "ChartWizard"
110 if ( ChartWizard.exists( 2 ) ) then
111 printlog( "Cancel Chart Wizard" )
115 warnlog( "Chart Wizard should be open" )
118 printlog( "Select a few cells for Cut/Copy/Paste test" )
119 Kontext "DocumentCalc"
120 DocumentCalc.TypeKeys( "<Up>", 7 )
121 DocumentCalc.TypeKeys( "<Shift Down>", 5 )
124 Kontext "Standardbar"
125 hWaitForObject( Ausschneiden , 1000 )
129 Kontext "DocumentCalc"
130 printlog( "Move down one cell" )
131 DocumentCalc.TypeKeys( "<Down>" )
134 Kontext "Standardbar"
135 sleep( 3 ) ' No better solution found yet.
138 Kontext "DocumentCalc"
139 printlog( "Move up 7 cells, then do <shift down>" )
140 DocumentCalc.TypeKeys( "<Up>", 7 )
141 DocumentCalc.TypeKeys( "<Shift Down>", 5 )
145 Kontext "Standardbar"
146 hWaitForObject( Kopieren , 1000 )
150 Kontext "DocumentCalc"
151 printlog( "Press right arrow and RETURN" )
152 DocumentCalc.TypeKeys( "<Right><Return>" )
155 printlog( "Paste again" )
156 Kontext "Standardbar"
157 hWaitForObject( Einfuegen , 1000 )
161 hWaitForObject( Undo , 2000 )
166 hWaitForObject( Redo , 2000 )
170 Kontext "Standardbar"
171 printlog( "Open Navigator" )
172 hWaitForObject( NavigatorButton , 1000 )
173 NavigatorButton.Click()
176 if ( Navigator.Exists( 1 ) ) then
177 printlog( "Close Navigator" )
178 Kontext "Standardbar"
179 NavigatorButton.Click()
181 warnlog( "Navigator did not open" )
185 if ( Navigator.exists() ) then
186 warnlog( "The navigator should not be visible" )
189 Kontext "Standardbar"
190 printlog( "Click <HyperLink> to open the dialog" )
191 hWaitForObject( HyperlinkDialog , 1000 )
192 HyperlinkDialog.Click()
194 for iTabPage = 1 to 4
196 case 1: Kontext "Hyperlink"
197 if ( Hyperlink.exists() ) then HyperlinkTabID = 1
199 case 2: kontext "TabHyperlinkMailUndNews"
200 if ( TabHyperlinkMailUndNews.exists() ) then HyperlinkTabID = 2
202 case 3: kontext "TabHyperlinkDokument"
203 if ( TabHyperlinkDokument.exists() ) then HyperlinkTabID = 3
205 case 4: kontext "TabHyperlinkNeuesDokument"
206 if ( TabHyperlinkNeuesDokument.exists() ) then HyperlinkTabID = 4
213 if ( HyperlinkTabID > 0 ) then
215 if ( HyperlinkTabID <> 1 ) then
216 qaerrorlog( "This is not the internet tabpage, did you " & _
217 "kill the userlayer before running the test?" )
220 kontext "Standardbar"
221 printlog( "Click <HyperLink> to close" )
222 HyperlinkDialog.Click()
225 warnlog( "#i104704# - Insert Hyperlink dialog cannot be accessed" )
226 Kontext "Standardbar"
227 HyperlinkDialog.Click()
230 Kontext "Standardbar"
231 printlog( "Gallery button" )
232 hWaitForObject( GalleryButton , 1000 )
233 GalleryButton.Click()
236 if ( Gallery.exists( 3 ) ) then
237 printlog( "Gallery button again, to close" )
238 kontext "StandardBar"
239 GalleryButton.click()
243 if ( Gallery.exists() ) then
244 warnlog( "Gallery did not close " )
247 warnlog( "The Gallery did not open" )
250 printlog( "Close all documents and delete files" )
252 hDeleteFile( sFileOut )