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: filedlg_folders4.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 : check the internal file dialog ( 1. part )
38 '\*****************************************************************************
42 '///<h1>Click "Level-Up" button until we reach filesystem root</h1>
43 '///+This test verifies that each click moves one level up in the filesystem.
44 '///+Furthermore it is verified that the button does not get disabled under way.
49 ' We always want to start in a fixed directory structure so the first few dirnames are
50 ' known an can be used for verification
51 dim cStartDir as string
52 cStartDir = gTesttoolPath & "framework\optional\input\filetest\level1\level2\level3"
53 cStartDir = convertpath( cStartDir )
54 printlog( "Start-Directory is: " & cStartDir )
57 ' Find out how deep into the filesystem hierarchy we are so we know when we are at the
58 ' filesystem root. We add one because Windows has one more level where the drive icons
60 dim iDirLevels as integer
61 iDirLevels = hGetDirTreeLevel( cStartDir )
63 if ( instr( lcase( gtSYSName ) , "win" ) = 1 ) then
64 iDirLevels = iDirLevels + 1
65 printlog( "Current threshold (Windows) is: " & iDirLevels)
66 elseif ( gtSysName = "ecomstation" ) then
67 iDirLevels = iDirLevels + 1
68 printlog( "Current threshold (eComStation) is: " & iDirLevels)
70 printlog( "Current threshold (Unix/Linux) is: " & iDirLevels)
73 dim sCurrentDir as string
74 dim sExpectedDir as string
77 '///+<li>Click FileOpen</li>
80 '///+<li>Open [Testtoolpath]\framework\optional\input\filetest\level1\level2\level3</li>
82 Dateiname.SetText( cStartDir )
85 '///+<li>Click the "Level-Up" button until we are in the filesystem root</li>
87 printlog "Click the Level-Up button until we are in the filesystem root"
88 for iClick = 1 to iDirLevels
90 '///+<li>Verify that the button exists</li>
91 if ( UebergeordneterOrdner.exists() ) then
93 '///+<li>Verify that the button is enabled</li>
94 if ( UebergeordneterOrdner.isEnabled() ) then
96 '///+<li>Click the "Level-Up" button</li>
97 UebergeordneterOrdner.Click()
99 warnlog( "Level-Up button is disabled" )
102 warnlog( "Level-Up button does not exist" )
105 '///+<li>Get the name of the first item in the filepicker (excluding CVS)</li>
106 sCurrentDir = hGetFirstNameFromFileList()
108 '///+<li>Verify that the name of the first item is correct. The names of the first six dirs are known</li>
110 case 1 : sExpectedDir = "level3"
111 case 2 : sExpectedDir = "level2"
112 case 3 : sExpectedDir = "level1"
113 case 4 : sExpectedDir = "alldocs"
114 case 5 : sExpectedDir = "includes"
115 case 6 : sExpectedDir = "optional"
118 if ( iClick < 7 ) then
119 if ( sCurrentDir = sExpectedDir ) then
120 printlog( "Current directory name is: " & sCurrentDir & " [ok]" )
122 warnlog( "Error finding directory name:" )
123 printlog( "Current directory name is: " & sCurrentDir & " which is NOT ok" )
124 printlog( "Expected directory name..: " & sExpectedDir )
130 '///+<li>We should now be at the top of the tree, the "Level-Up" button should be disabled</li>
133 '///+<li>Verify that the button exists</li>
134 if ( UebergeordneterOrdner.exists() ) then
136 '///+<li>Check that the button is not enabled</li>
137 if ( not UebergeordneterOrdner.isEnabled() ) then
138 printlog( "Level-Up button is disabled, good" )
140 '///+<li>Warn if the button is enabled</li>
141 warnlog( "The Level-up button should not be enabled for filesystem root" )
144 warnlog( "Level-Up button does not exist" )