diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2009-10-30 15:02:05 +0100 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2009-10-30 15:02:05 +0100 |
commit | 578134e9081326d4d50e0e37d1117b5a17f107cc (patch) | |
tree | 64bfa65580c9590309c2d2a7c9359e5dfbbc9911 | |
parent | 79715a469add3281626c5555a28d116bad5e301a (diff) | |
parent | f8dcbeca9fb7c46e4817022e958bd70080a81253 (diff) |
CWS-TOOLING: integrate CWS jskhgpilot6
Notes
split repo tag: testing_ooo/DEV300_m64
9 files changed, 250 insertions, 199 deletions
diff --git a/testautomation/framework/optional/includes/basic_package_export.inc b/testautomation/framework/optional/includes/basic_package_export.inc index f02e60c79a83..19784c25883f 100755 --- a/testautomation/framework/optional/includes/basic_package_export.inc +++ b/testautomation/framework/optional/includes/basic_package_export.inc @@ -40,9 +40,7 @@ testcase tBasicPackageExport ' Assumption: All actions take place in the user/work directory - ' macro taken from framework/tools/input/macros.txt::tBasicLibraryExport - - printlog( "Export BASIC libraries as package" ) + printlog( "Export BASIC libraries as package/extension" ) const PACKAGE_NAME = "tBasicExport.oxt" const LIBRARY_NAME = "tBasicExport" @@ -51,14 +49,11 @@ testcase tBasicPackageExport dim cDocumentName as string dim cLibraryName as string - + dim iNodeCount as integer - dim iCurrentLib as integer - dim cFile as string - cFile = hGetWorkPath() & PACKAGE_NAME - + dim cFile as string : cFile = hGetWorkPath() & PACKAGE_NAME dim cPackageFileName as string @@ -80,97 +75,123 @@ testcase tBasicPackageExport printlog( "Select the second document" ) kontext "Makro" - iNodeCount = hGetNodeCount( MakroAus ) - cDocumentName = hSelectNode( MakroAus, iNodeCount ) + if ( Makro.exists( 1 ) ) then + iNodeCount = hGetNodeCount( MakroAus ) + cDocumentName = hSelectNode( MakroAus, iNodeCount ) - printlog( "Click <Manage...>" ) - Verwalten.click() - - printlog( "Go to the libraries tabpage" ) - hSelectBasicObjectOrganizerTab( 3 ) - - kontext "TabBibliotheken" - printlog( "Select the document at pos. " & DOCUMENT_POSITION ) - Bibliothek.select( DOCUMENT_POSITION ) - - printlog( "Verify that the correct document has been selected" ) - if ( Bibliothek.getSelText() <> cDocumentName ) then - warnlog( "Incorrect document selected on libraries tab, aborting" ) - goto endsub - endif - - printlog( "Click <New...>" ) - Neu.click() - - kontext "NeueBibliothek" - printlog( "Name the new library: " & LIBRARY_NAME ) - BibliotheksName.setText( LIBRARY_NAME ) - NeueBibliothek.ok() - - kontext "TabBibliotheken" - cLibraryName = BibliotheksListe.getSelText() - if ( cLibraryName <> LIBRARY_NAME ) then - warnlog( "The new library is not selected in the libraries list" ) + printlog( "Click <Manage...>" ) + Verwalten.click() + + printlog( "Go to the libraries tabpage" ) + hSelectBasicObjectOrganizerTab( 3 ) + + kontext "TabBibliotheken" + printlog( "Select the document at pos. " & DOCUMENT_POSITION ) + Bibliothek.select( DOCUMENT_POSITION ) + + printlog( "Verify that the correct document has been selected" ) + if ( Bibliothek.getSelText() <> cDocumentName ) then + warnlog( "Incorrect document selected on libraries tab, aborting test" ) + goto endsub + endif + + printlog( "Click <New...>" ) + Neu.click() + + kontext "NeueBibliothek" + if ( NeueBibliothek.exists( 1 ) ) then + printlog( "Name the new library: " & LIBRARY_NAME ) + BibliotheksName.setText( LIBRARY_NAME ) + NeueBibliothek.ok() + else + warnlog( "Dialog <NeueBibliothek> did not open" ) + goto endsub + endif + + kontext "TabBibliotheken" + cLibraryName = BibliotheksListe.getSelText() + if ( cLibraryName <> LIBRARY_NAME ) then + warnlog( "The new library is not selected in the libraries list" ) + else + printlog( "The correct library is selected in the libraries list" ) + endif + + printlog( "Click <Edit...>" ) + Bearbeiten.click() + + printlog( "Insert a test macro (something simple, e.g. a messagebox" ) + hInsertMacroFromFile( LIBRARY_NAME ) + + printlog( "Close the BASIC IDE" ) + hCloseBasicIDE() else - printlog( "The correct library is selected in the libraries list" ) + warnlog( "Dialog <Makro> did not open, aborting test" ) + goto endsub endif - printlog( "Click <Edit...>" ) - Bearbeiten.click() - - printlog( "Insert a test macro (something simple, e.g. a messagebox" ) - hInsertMacroFromFile( LIBRARY_NAME ) - - printlog( "Close the BASIC IDE" ) - hCloseBasicIDE() - printlog( "Open the BASIC organizer" ) ToolsMacro_uno printlog( "Select the work document" ) kontext "Makro" - iNodeCount = hGetNodeCount( MakroAus ) - hSelectNode( MakroAus, iNodeCount ) - - printlog( "Manage..." ) - Verwalten.click() - - printlog( "Libraries tab" ) - hSelectBasicObjectOrganizerTab( 3 ) - - kontext "TabBibliotheken" - Bibliothek.select( DOCUMENT_POSITION ) - - printlog( "Select the new library" ) - kontext "TabBibliotheken" - for iCurrentLib = 1 to Bibliotheksliste.getItemCount() - Bibliotheksliste.select( iCurrentLib ) - if ( Bibliotheksliste.getSelText() = LIBRARY_NAME ) then - exit for + if ( Makro.exists( 1 ) ) then + iNodeCount = hGetNodeCount( MakroAus ) + hSelectNode( MakroAus, iNodeCount ) + + printlog( "Manage..." ) + Verwalten.click() + + printlog( "Libraries tab" ) + hSelectBasicObjectOrganizerTab( 3 ) + + kontext "TabBibliotheken" + if ( TabBibliotheken.exists( 1 ) and TabBibliotheken.isVisible() ) then + Bibliothek.select( DOCUMENT_POSITION ) + + printlog( "Select the new library" ) + kontext "TabBibliotheken" + for iCurrentLib = 1 to Bibliotheksliste.getItemCount() + Bibliotheksliste.select( iCurrentLib ) + if ( Bibliotheksliste.getSelText() = LIBRARY_NAME ) then + exit for + endif + next iCurrentLib + + kontext "TabBibliotheken" + printlog( "Export the package, close the document afterwards" ) + Export.click() + + kontext "ExportBasicLibraryDlg" + if ( ExportBasicLibraryDlg.exists( 1 ) ) then + printlog( "Select to export as package" ) + ExportAsPackage.check() + ExportBasicLibraryDlg.ok() + + kontext "SpeichernDlg" + if ( SpeichernDlg.exists( 1 ) ) then + printlog( "Save the file, automatic filename extension must be checked" ) + DateiName.setText( hGetWorkPath() & LIBRARY_NAME ) ' automatic filename extension/uno-pkg is default + Speichern.click() + else + warnlog( "Dialog <File Save> did not open" ) + endif + else + warnlog( "Dialog <Export Basic Library> did not open" ) + endif + + kontext "TabBibliotheken" + printlog( "Close libraires tabpage" ) + TabBibliotheken.cancel() + else + warnlog( "Dialog <TabBibliotheken> is not available" ) endif - next iCurrentLib - - kontext "TabBibliotheken" - printlog( "Export the package, close the document afterwards" ) - Export.click() - - kontext "ExportBasicLibraryDlg" - printlog( "Select to export as package" ) - ExportAsPackage.check() - ExportBasicLibraryDlg.ok() - - kontext "SpeichernDlg" - printlog( "Save the file, automatic filename extension must be checked" ) - DateiName.setText( hGetWorkPath() & LIBRARY_NAME ) ' automatic filename extension/uno-pkg is default - Speichern.click() - - kontext "TabBibliotheken" - printlog( "Close libraires tabpage" ) - TabBibliotheken.cancel() - - kontext "Makro" - printlog( "Close BASIC organizer" ) - Makro.cancel() + + kontext "Makro" + printlog( "Close BASIC organizer" ) + Makro.cancel() + else + warnlog( "Dialog <Makro> did not open" ) + endif printlog( "Close all files" ) hFileCloseAll() @@ -190,17 +211,17 @@ testcase tBasicPackageExport endif printlog( "Verify file size" ) - if ( FileLen( cPackageFileName ) <> PACKAGE_SIZE ) then - warnlog( "#i105719# - The exported test-package has an incorrect file size." ) +' if ( FileLen( cPackageFileName ) <> PACKAGE_SIZE ) then +' warnlog( "#i105719# - The exported test-package has an incorrect file size." ) if ( FileLen( cPackageFileName ) = 0 ) then printlog( "File has zero bytes, it is empty." ) else printlog( "Size is.: " & FileLen( cPackageFileName ) ) printlog( "Expected: " & PACKAGE_SIZE ) endif - else - printlog( "File has correct size" ) - endif +' else +' printlog( "File has correct size" ) +' endif endcase diff --git a/testautomation/framework/optional/includes/extras_file_open.inc b/testautomation/framework/optional/includes/extras_file_open.inc index dd2f3149100c..62ad0b7e6587 100755 --- a/testautomation/framework/optional/includes/extras_file_open.inc +++ b/testautomation/framework/optional/includes/extras_file_open.inc @@ -45,6 +45,8 @@ private const MAX_FILE_COUNT = 3000 ' the max number of templates or samples testcase tOpenObjectsWithFileDialog( cCategory as string ) + printlog( "Open templates and samples using the file open dialog" ) + const CFN = "tOpenObjectsWithFileDialog::" @@ -75,9 +77,15 @@ testcase tOpenObjectsWithFileDialog( cCategory as string ) cOfficePath = gOfficeBasisPath else cOfficePath = mid( gOfficeBasisPath, len( gNetzOfficePath ) + 1 ) + if ( FileExists( cOfficePath ) ) then + printlog( "Using: " & cOfficePath ) + else + warnlog( "Test script error: Invalid Office path: " & cOfficePath ) + goto endsub + endif endif - printlog( "Using: " & cOfficePath ) + printlog( "Build path to templates/samples directory" ) select case cCategory case "SAMPLES" : sRootPath = cOfficePath & "share\samples\" & gISOLang sRootPathFallback = "/opt/openoffice.org/basis3.0/share/samples/" & gISOLang @@ -92,10 +100,10 @@ testcase tOpenObjectsWithFileDialog( cCategory as string ) sRootPath = convertpath( sRootPath ) - if ( dir( sRootPath ) = "" ) then + if ( NOT FileExists( sRootPath ) ) then qaerrorlog( "Root Path does not exist: " & sRootPath ) sRootPath = sRootPathFallback - if ( dir( sRootPathFallback ) = "" ) then + if ( NOT FileExists( sRootPathFallback ) ) then warnlog( "No usable office root path found. Aborting test" ) goto endsub printlog( "Using hard coded fallback" ) @@ -104,10 +112,12 @@ testcase tOpenObjectsWithFileDialog( cCategory as string ) printlog( "Using path..: " & sRootPath ) printlog( "Using filter: " & sFilter ) + + printlog( "Retrieve filelist from directory" ) GetAllFileList ( sRootPath, sFilter, lsFile() ) hListDelete( lsFile(), 1 ) - ' Remove .lock-files + printlog( "Remove posible .lock-files from list" ) iTemplateCount = listCount( lsFile() ) iCurrentTemplate = 1 while( iCurrentTemplate <= iTemplateCount ) @@ -119,7 +129,7 @@ testcase tOpenObjectsWithFileDialog( cCategory as string ) endif wend - ' do not test wizard related files + printlog( "Remove Wizard related files from list" ) iTemplateCount = listCount( lsFile() ) iCurrentTemplate = 1 while( iCurrentTemplate <= iTemplateCount ) @@ -131,6 +141,7 @@ testcase tOpenObjectsWithFileDialog( cCategory as string ) endif wend + printlog( "Files to be loaded:" ) hListPrint ( lsFile() , "" , "" ) if ( listcount( lsfile() ) = 1 ) then if ( gProductName = "OpenOffice.org" ) then @@ -140,6 +151,8 @@ testcase tOpenObjectsWithFileDialog( cCategory as string ) warnlog( "Filelist seems to be incomplete. GetAllFileList() failed!" ) goto endsub endif + else + printlog( "List of samples/templates appears to be valid" ) endif iTemplateCount = listCount( lsFile() ) @@ -151,41 +164,53 @@ testcase tOpenObjectsWithFileDialog( cCategory as string ) ' sFileIn holds the file we currently work with sFileIn = lsFile( iCurrentTemplate ) - brc = hFileOpen( sFileIn ) - brc = hHandleActivesOnLoad( 0 , 2 ) + printlog( "Load: " & sFileIn ) + hFileOpen( sFileIn ) + printlog( "Handle known dialogs" ) + hHandleActivesOnLoad( 0 , 2 ) + + printlog( "Check for Filter Selection dialog" ) Kontext "FilterAuswahl" if ( FilterAuswahl.exists( 1 ) ) then warnlog( "Loading failed, ASCII filter dialog present" ) FilterAuswahl.cancel() - while( getDocumentCount > 0 ) - hDestroyDocument() - wend + hFileCloseAll() else - brc = hCloseNavigator() + printlog( "Close navigator, if open" ) + hCloseNavigator() - ' Build the filename sFileOut = cCategory & "_" & iCurrentTemplate sFileOut = convertpath( sPathOut & sFileOut ) - - brc = hFileSaveAsKill( sFileOut ) + + printlog( "Saving file to: " & sFileOut ) + hFileSaveAsKill( sFileOut ) ' note: this is delayed, because the dialogs take time to pop up ' even while the dialog is visible, we can work with the doc. - brc = hHandleInitialDialogs() + printlog( "Handle known dialogs" ) + hHandleInitialDialogs() - brc = hDestroyDocument() + printlog( "Close document" ) + hDestroyDocument() - brc = hFileOpen( sFileOut ) - brc = hHandleActivesOnLoad( 0 , 2 ) - brc = hCloseNavigator() + printlog( "Load document again" ) + hFileOpen( sFileOut ) + + printlog( "Handle known dialogs" ) + hHandleActivesOnLoad( 0 , 2 ) + + printlog( "Close navigator, if open" ) + hCloseNavigator() - brc = hDestroyDocument() + printlog( "Close document" ) + hDestroyDocument() endif - brc = hDeleteFile( sFileOut ) + printlog( "Delete file" ) + hDeleteFile( sFileOut ) next iCurrentTemplate diff --git a/testautomation/framework/optional/includes/filedlg_autocomplete.inc b/testautomation/framework/optional/includes/filedlg_autocomplete.inc index 264685d85594..94d0db418196 100755 --- a/testautomation/framework/optional/includes/filedlg_autocomplete.inc +++ b/testautomation/framework/optional/includes/filedlg_autocomplete.inc @@ -39,17 +39,18 @@ testcase tAutocomplete - + printlog( "Autocompletion in the OpenOffice.org file picker" ) ' IMPORTANT NOTE: Autocompletion is asynchronous. This means that no rule ' exists when exactly it is going to strike. If you are ' using a networked environment you have to make sure that ' all network ressources deliver a decent performance as ' this seriously influences the speed of the autocompletion. - - dim cBasePath as string - + + ' Assemble a work directory path const WORKDIR = "autocomplete" + dim cBasePath as string : cBasePath = hGetWorkPath() + dim cWorkDir as string : cWorkDir = cBasePath & WORKDIR ' These are the files we create in the users homedirectory dim aWorkFile( 3 ) as string @@ -65,7 +66,6 @@ testcase tAutocomplete aWildCard( 1 ) = "autocomplete_?.odt" aWildCard( 2 ) = "autocomplete_b?.odt" aWildCard( 3 ) = "autocomplete_*.odt" - dim cCurrentPath as string dim cAutocomplete as string @@ -80,41 +80,46 @@ testcase tAutocomplete dim slot - do while( getDocumentCount > 0 ) - call hCloseDocument() - loop - - cBasePath = hGetWorkPath() - aFullPath( 1 ) = cBasePath & WORKDIR & gPathSigne & aWorkFile( 1 ) - aFullPath( 2 ) = cBasePath & WORKDIR & gPathSigne & aWorkFile( 2 ) - aFullPath( 3 ) = cBasePath & WORKDIR & gPathSigne & aWorkFile( 3 ) + printlog( "Close all open documents" ) + hFileCloseAll() + + printlog( "Assemble 3 filenames for workfiles" ) + aFullPath( 1 ) = cWorkDir & gPathSigne & aWorkFile( 1 ) + aFullPath( 2 ) = cWorkDir & gPathSigne & aWorkFile( 2 ) + aFullPath( 3 ) = cWorkDir & gPathSigne & aWorkFile( 3 ) + + printlog( "Delete the 3 workfiles if they exist" ) hDeleteFile( aFullPath( 1 ) ) hDeleteFile( aFullPath( 2 ) ) hDeleteFile( aFullPath( 3 ) ) + + printlog( "Try to remove conflicting work directories" ) if ( dir( cBasePath & WORKDIR ) <> "" ) then - rmdir( cBasePath & WORKDIR ) + rmdir( cWorkDir ) endif - mkdir( cBasePath & WORKDIR ) - if ( dir( cBasePath & WORKDIR ) = "" ) then + printlog( "Create workdirectory: " & cWorkDir ) + mkdir( cWorkDir ) + if ( NOT FileExists( cWorkDir ) ) then warnlog( "Failed to create work directory, aborting" ) goto endsub endif gApplication = "WRITER" + printlog( "Create the workfiles - 3 writer files with minimum content" ) for iCurrentDocument = 1 to 3 - call hNewDocument() + call hCreateDocument() kontext "DocumentWriter" DocumentWriter.typeKeys( aWorkFile( iCurrentDocument ) ) hFileSaveAs( aFullPath( iCurrentDocument ) ) - FileClose + hUseAsyncSlot( "FileClose" ) next iCurrentDocument - - printlog( "open the File Open dialog" ) - FileOpen - + printlog( "Open the File Open dialog" ) + hUseAsyncSlot( "FileOpen" ) + kontext "OeffnenDlg" + printlog( "Click the <Standard> button to get to the default work directory" ) Standard.click() cLeft = left( WORKDIR, iLeft ) @@ -131,7 +136,7 @@ testcase tAutocomplete printlog( "Autocompletion succeeded for workdirectory" ) else warnlog( "Autocompletion failed" ) - printlog( "Expected: " & cRight ) + printlog( "Expected: " & cEFString ) printlog( "Found...: " & cAutocomplete ) endif @@ -149,7 +154,7 @@ testcase tAutocomplete printlog( "Autocompletion succeeded for first file" ) else warnlog( "Autocompletion failed" ) - printlog( "Expected: " & cRight ) + printlog( "Expected: " & cEFString ) printlog( "Found...: " & cAutocomplete ) endif @@ -162,7 +167,7 @@ testcase tAutocomplete printlog( "Autocompletion succeeded for second file" ) else warnlog( "Autocompletion failed" ) - printlog( "Expected: " & cRight ) + printlog( "Expected: " & cEFString ) printlog( "Found...: " & cAutocomplete ) endif @@ -198,6 +203,7 @@ testcase tAutocomplete kontext "OeffnenDlg" OeffnenDlg.cancel() + printlog( "Delete workfiles and -directory" ) hDeleteFile( aFullPath( 1 ) ) hDeleteFile( aFullPath( 2 ) ) hDeleteFile( aFullPath( 3 ) ) diff --git a/testautomation/framework/optional/includes/filedlg_cjk_files.inc b/testautomation/framework/optional/includes/filedlg_cjk_files.inc index 0c69736f1558..f616c6d4567a 100755 --- a/testautomation/framework/optional/includes/filedlg_cjk_files.inc +++ b/testautomation/framework/optional/includes/filedlg_cjk_files.inc @@ -39,27 +39,21 @@ testcase tSaveLoadDelFilesCJK() + printlog( "Save, load and delete files from the hight UTF-8 characters list" ) + if ( not hTestLocale() ) then - warnlog( "Test requires UTF-8 locale" ) - goto endsub + qaerrorlog( "Could not verify UTF-8 locale. Make sure an UTF-8 locale is used!" ) endif - dim cStrangeName as string dim iCounter as integer ' iterator - dim iRandom as long ' random number.(needs long for cjk chars) + dim iRandom as long ' random number dim brc as boolean - printlog( CHR$(13) ) - printlog( "Check if CJK-filenames are loaded/saved/deleted" ) - printlog( CHR$(13) ) - - printlog( CHR$(13) + "Names with CJK-chars" ) - printlog( "" ) - - ' Invoke randomizer + printlog( "Invoke randomizer" ) call randomize() + printlog( "Generate filenames, run tests" ) for iCounter = 1 to 2 iRandom = int( 19968 + ( 20911 * rnd ) ) @@ -67,10 +61,10 @@ testcase tSaveLoadDelFilesCJK() printlog( " * Using decimal char: " & iRandom ) cStrangeName = hNameGen_append( iRandom ) - brc = hSaveLoadDelSuccess( cStrangeName ) + hSaveLoadDelSuccess( cStrangeName ) cStrangeName = hNameGen_lead( iRandom ) - brc = hSaveLoadDelSuccess( cStrangeName ) + hSaveLoadDelSuccess( cStrangeName ) kontext "active" if( active.exists() ) then @@ -78,17 +72,17 @@ testcase tSaveLoadDelFilesCJK() printlog( active.gettext() ) active.ok() endif - + + printlog( "Delete the file" ) hDeleteFile( hGetWorkPath() & cStrangeName ) + printlog( "Close navigator, if it exists" ) hCloseNavigator() - next iCounter printlog( "Close the document" ) - brc = hDestroyDocument() - + hDestroyDocument() endcase diff --git a/testautomation/framework/optional/includes/filedlg_filternames.inc b/testautomation/framework/optional/includes/filedlg_filternames.inc index ce0b7231b5c5..e524f40d955f 100755 --- a/testautomation/framework/optional/includes/filedlg_filternames.inc +++ b/testautomation/framework/optional/includes/filedlg_filternames.inc @@ -39,6 +39,7 @@ testcase tVerifyFilterNames + printlog( "Verify filternames listed in the file open dialog" ) if ( gIsoLang <> "en-US" ) then qaerrorlog( "No testing for non-US languages" ) @@ -77,12 +78,14 @@ testcase tVerifyFilterNames dim cFileOut as string cFileOut = hGetWorkPath() & cFile - + printlog( "Create a new document" ) hCreateDocument() + printlog( "Open the File Open dialog" ) FileOpen Kontext "OeffnenDlg" + printlog( "Read the filterlist (en_US only), compare against a reference" ) if ( OeffnenDlg.exists( 1 ) ) then iFilterCount = DateiTyp.getItemCount() @@ -101,7 +104,7 @@ testcase tVerifyFilterNames try asFilterNames( iCurrentItem ) = DateiTyp.getItemText( iCurrentItem ) catch - printlog( "Test broke at pos: " & iCurrentItem ) + printlog( "Problem encountered at pos: " & iCurrentItem ) endcatch next iCurrentItem @@ -113,7 +116,8 @@ testcase tVerifyFilterNames else warnlog( "File Open dialog not present." ) endif - + + printlog( "Close the document" ) hDestroyDocument() if ( iErr <> 0 ) then diff --git a/testautomation/framework/optional/includes/filedlg_multiselection.inc b/testautomation/framework/optional/includes/filedlg_multiselection.inc index d95ae9e1a8b0..00deab80b27c 100755 --- a/testautomation/framework/optional/includes/filedlg_multiselection.inc +++ b/testautomation/framework/optional/includes/filedlg_multiselection.inc @@ -157,7 +157,8 @@ testcase tFiledlgMultiselection1() wend if ( iCurrentTime > 120000 ) then - warnlog( "#i105289# Slow loading of files, should be less than 120 seconds on all platforms" ) + 'Closed issue: qaerrorlog( "#i105289# Slow loading of files, should be less than 120 seconds on all platforms" ) + printlog( "Slow file loading (exceeds 120 seconds)" ) endif lWait = getSystemTicks - lTime ' time diff diff --git a/testautomation/framework/optional/includes/filedlg_reserved_names_unix.inc b/testautomation/framework/optional/includes/filedlg_reserved_names_unix.inc index a414101cfa4b..e84eff3f328f 100755 --- a/testautomation/framework/optional/includes/filedlg_reserved_names_unix.inc +++ b/testautomation/framework/optional/includes/filedlg_reserved_names_unix.inc @@ -39,9 +39,10 @@ testcase tSaveReservedNamesUNIX() + printlog( "Names that are reserved on WINDOWS but are OK on UNIX" ) if ( gPlatGroup = "w95" ) then - printlog( "Test not relevant for Unix(like)" + printlog( "Test not relevant for Windows/DOS family of OSes" ) goto endsub endif @@ -53,7 +54,6 @@ testcase tSaveReservedNamesUNIX() printlog( "" ) printlog( "Document Type is: " & hNumericDocType( iCurrentDocType ) ) - printlog( "Names that are reserved on WINDOWS but are OK on UNIX" ) irc = hSaveLoadDelSuccess( "NUL" , true ) if ( irc <> 0 ) then warnlog( "failed" ) diff --git a/testautomation/framework/optional/includes/security_macrosecurity.inc b/testautomation/framework/optional/includes/security_macrosecurity.inc index 4c69aa062c45..c9083ff5229e 100755 --- a/testautomation/framework/optional/includes/security_macrosecurity.inc +++ b/testautomation/framework/optional/includes/security_macrosecurity.inc @@ -56,6 +56,7 @@ end sub testcase tMacroSecurityLevels( cFileFormat ) + printlog( "Check macro execution behavior for all macro security levels" ) dim cWorkFile as string cWorkFile = gTesttoolPath & "framework\optional\input\BasicDocs\" @@ -80,18 +81,23 @@ testcase tMacroSecurityLevels( cFileFormat ) ' |---------------------------------------------------------| ' *) Covered by test "f_sec_trusted_path.bas" + printlog( "Load a document with macro for each of the four security levels" ) for iSecLevel = 0 to 3 - printlog( "" ) + printlog( "Set macro security level to " & iSecLevel ) hSetMacroSecurityAPI( iSecLevel ) - FileOpen( "URL", cWorkFile, "FrameName", "_default" ) + + printlog( "Load document..." ) + hFileOpen( cWorkFile ) + + printlog( "Check security level dependent behavior" ) select case iSecLevel case 0 : brc = hIdentifyExecutedMacro() if ( not brc ) then if ( gApplication = "MATH" ) then qaerrorlog( "#i68291# Math document forgets eventbinding" ) else - qaerrorlog( "#i53711# Macro was not found/executed" ) + warnlog( "#i53711# Macro was not found/executed" ) endif endif @@ -104,8 +110,7 @@ testcase tMacroSecurityLevels( cFileFormat ) if ( gApplication = "MATH" ) then qaerrorlog( "#i68291# Math document forgets eventbinding" ) else - qaerrorlog( "#i53711# Macro was not found/executed" ) - 'warnlog( "#i65885# - CWS Warnings01/Macro not executed on load" ) + warnlog( "#i53711# Macro was not found/executed" ) endif endif @@ -125,10 +130,12 @@ testcase tMacroSecurityLevels( cFileFormat ) endif end select + printlog( "Close document" ) brc = hDestroyDocument() next iSecLevel + printlog( "Reset security level to default" ) hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT ) endcase diff --git a/testautomation/framework/tools/includes/fileoperations.inc b/testautomation/framework/tools/includes/fileoperations.inc index 3f2078c24c92..d4abf557afe8 100755 --- a/testautomation/framework/tools/includes/fileoperations.inc +++ b/testautomation/framework/tools/includes/fileoperations.inc @@ -62,8 +62,7 @@ function hSaveLoadDelSuccess( cFile as string ) as integer '///<ul> dim brc as boolean - dim cFileExt as string - cFileExt = cFile & hGetSuffix( "current" ) + dim cFileExt as string : cFileExt = cFile & hGetSuffix( "current" ) const CFN = "hSaveLoadDelSuccess::" @@ -160,14 +159,13 @@ function hLoadFileExpectSuccess( fpath as string ) as boolean '///<u>Description</u>: '///<ul> - dim brc as boolean - brc = true + dim brc as boolean : brc = true const CFN = "hLoadFileExpectSuccess::" printlog( CFN & "Enter with option: " & fpath ) '///+<li>Click FileOpen (or use the menu)</li> - FileOpen + hUseAsyncSlot( "FileOpen" ) '///+<li>Enter the filename (with extension)</li> 'printlog( " - Type the filepath/name into the entryfield" ) @@ -232,13 +230,12 @@ function hLoadFileExpectFailure( fpath as string ) as boolean const CFN = "hLoadFileExpectFailure::" - dim brc as boolean - brc = true + dim brc as boolean : brc = true printlog( CFN & "Enter with option: " & fpath ) '///+<li>Click FileOpen</li> - FileOpen + hUseAsyncSlot( "FileOpen" ) Kontext "OeffnenDLG" '///+<li>Enter filepath</li> @@ -321,24 +318,21 @@ function hSaveFileExpectSuccess( fpath as string , bReplace as boolean ) as bool '///<ul> const CFN = "hSaveFileExpectSuccess::" - dim brc as boolean - brc = true + dim brc as boolean : brc = true dim iDocumentCount as integer printlog( CFN & "Enter with options: " & fpath & ", " & bReplace ) '///+<li>Make sure we start from the backing window</li> - do while ( getDocumentCount > 0 ) - hCloseDocument() - loop + hFileCloseAll() '///+<li>Open a new document</li> hCreateDocument() '///+<li>Click "Save As..."</li> - FileSaveAs + hUseAsyncSlot( "FileSaveAs" ) Kontext "SpeichernDlg" if ( SpeichernDlg.exists( 1 ) ) then @@ -429,8 +423,7 @@ function hSaveFileExpectFailure( fpath as string , errortype as integer ) as boo ' This sequence tries to save a document with an invalid name. The errormsg ' is closed, the filedialog cancelled and the file closed. - dim brc as boolean - brc = false + dim brc as boolean : brc = false dim cMsg as string @@ -442,7 +435,7 @@ function hSaveFileExpectFailure( fpath as string , errortype as integer ) as boo '///+<li>Click "Save As;"</li> printlog( "" ) printlog( CFN & "Enter with options: " & fpath & ", " & errortype ) - FileSaveAs + hUseAsyncSlot( "FileSaveAs" ) '///+<li>Enter the filename</li> kontext "SpeichernDlg" @@ -549,14 +542,13 @@ function hCreateDirectoryExpectSuccess( dirname as string ) as boolean '///<u>Description</u>: '///<ul> - dim brc as boolean - brc = true + dim brc as boolean : brc = true const CFN = "hCreateDirectoryExpectSuccess::" printlog( CFN & "Enter with option: " & dirname ) '///+<li>Click "File Open"</li> - FileOpen + hUseAsyncSlot( "FileOpen" ) '///+<li>Click on "New folder"</li> Kontext "OeffnenDlg" @@ -646,7 +638,7 @@ function hDeleteFileViaFileOpen( cFile as String ) as boolean endif '///+<li>Click "File Open"</li> - FileOpen + hUseAsyncSlot( "FileOpen" ) '///+<li>Look for the requested file, get the position from the filelist</li> Kontext "OeffnenDLG" @@ -725,14 +717,16 @@ function hGetFileCountViaFileOpen() as integer '///<ul> '///+<li>Click "File open"</li> - FileOpen + hUseAsyncSlot( "FileOpen" ) '///+<li>Retrieve the number of items in the filepicker window</li> Kontext "OeffnenDLG" - hGetFileCountViaFileOpen() = DateiAuswahl.getItemCount() - - '///+<li>Close "File Open"</li> - OeffnenDLG.cancel() + if ( OeffnenDlg.exists( 2 ) ) then + hGetFileCountViaFileOpen() = DateiAuswahl.getItemCount() + OeffnenDLG.cancel() + else + hGetFileCountViaFileOpen() = -1 + endif '///</ul> end function @@ -871,10 +865,9 @@ function hFindFileObjectViaFileOpen( cName as string ) as integer dim iCurrentObject as integer dim cCurrentName as string dim iFileOpenItemCount as integer - dim iPos as integer - iPos = 0 - dim cPath as string - cPath = cName + + dim iPos as integer : iPos = 0 + dim cPath as string : cPath = cName dim iPathItems as integer dim asPathList( 100 ) as string |