diff options
author | Joerg Skottke [jsk] <jsk@openoffice.org> | 2010-07-07 19:17:49 +0200 |
---|---|---|
committer | Joerg Skottke [jsk] <jsk@openoffice.org> | 2010-07-07 19:17:49 +0200 |
commit | e2ffe6b8de7cd6277582afad1bff94556db485aa (patch) | |
tree | a68a0d74686557a76227ea9beba5f4461f4c668b /testautomation | |
parent | 9d3fb56757b41358c0adddc9797527c41449de23 (diff) |
automationdev300m84: #ii112847 - Fixed IsNamedDocLoaded by creating an exception list of suffixes which indicate a template being loaded. Not 100 percent safe but better than the old implementation
Diffstat (limited to 'testautomation')
-rwxr-xr-x | testautomation/global/tools/includes/required/t_files.inc | 15 | ||||
-rwxr-xr-x | testautomation/spreadsheet/optional/includes/import_general/c_import_general.inc | 33 |
2 files changed, 27 insertions, 21 deletions
diff --git a/testautomation/global/tools/includes/required/t_files.inc b/testautomation/global/tools/includes/required/t_files.inc index 1b9cd4c028df..d9da7ce5191a 100755 --- a/testautomation/global/tools/includes/required/t_files.inc +++ b/testautomation/global/tools/includes/required/t_files.inc @@ -114,13 +114,28 @@ function hIsNamedDocLoaded( cFileName as string ) as boolean dim cDocumentName as string dim iDocumentNameLength as integer + dim bTemplateDocument as boolean hIsNamedDocLoaded() = false + ' If the requested document is a template, we cannot use its filename to + ' identify the document as it is named "Untitled 1" or "Untitled" in the + ' FileSave dialog and the document properties dialog. The string is locale + ' dependent. So we do a shortcut here, the calling tests fail at a later + ' point if this function does not work properly + + select case( right( cFileName, 4 ) ) + case ".vor", ".dot", ".sti", ".pot", ".std", ".xlt", ".stc", ".ots", "xltm", "xltx" + if ( GVERBOSE ) then printlog( CFN & "Template document filtered" ) + hIsNamedDocLoaded() = true + exit function + end select + if ( hUseAsyncSlot( "FileProperties" ) <> RC_FAILURE ) then kontext active.setpage(tabdokument) + kontext "TabDokument" if ( TabDokument.exists( 2 ) ) then diff --git a/testautomation/spreadsheet/optional/includes/import_general/c_import_general.inc b/testautomation/spreadsheet/optional/includes/import_general/c_import_general.inc index 87c6d899b7bb..6f8392adf93d 100755 --- a/testautomation/spreadsheet/optional/includes/import_general/c_import_general.inc +++ b/testautomation/spreadsheet/optional/includes/import_general/c_import_general.inc @@ -41,6 +41,8 @@ sub tLoadAllDocuments ( gsSourcePath as string ) Dim i as integer Dim x as integer + dim gsSourceDocument( 50 ) as string + printlog "Source path: " & gsSourcePath 'Get the files into a list. Call GetAllFileList(gsSourcePath, "*.*" , gsSourceDocument()) @@ -81,6 +83,7 @@ end function '------------------------------------------------------------------------------- ' testcase tLoadSpreadsheetDocument (SourceFile) + Dim sOnlyFileName as string Dim sOnlyFileExtension as string Dim sTempFileName as String @@ -88,13 +91,13 @@ testcase tLoadSpreadsheetDocument (SourceFile) sTempFileName = SourceFile sOnlyFileName = DateiOhneExt(DateiExtract(SourceFile) - sOnlyFileExtension = GetExtention(sTempFileName) - select case sOnlyFileName - case "so3tmpl", "so4tmpl", "so5tmpl" : - printlog "Test case: " & sOnlyFileName & "." & sOnlyFileExtension - - case else printlog "Test case: " & sOnlyFileName & "." & sOnlyFileExtension + sOnlyFileExtension = GetExtention(sTempFileName) + + select case ( sOnlyFileName ) + case "so3tmpl", "so4tmpl", "so5tmpl" : printlog "Test case: " & sOnlyFileName & "." & sOnlyFileExtension + case else : printlog "Test case: " & sOnlyFileName & "." & sOnlyFileExtension end select + 'Maybe file name is empty if sOnlyFileName > "" then 'Some extensions make no sense to load @@ -106,27 +109,15 @@ testcase tLoadSpreadsheetDocument (SourceFile) Call hCloseDocument else warnlog sOnlyFileName + " document has not been loaded correctly [hIsNamedDocLoaded]!" - if GetDocumentCount > 1 then - Do Until GetDocumentCount = 1 - Call hCloseDocument - Loop - endif + hFileCloseAll() endif else warnlog sOnlyFileName + " document has not been loaded correctly [fCalcFileOpen; IsItLoaded]!" - if GetDocumentCount > 1 then - Do Until GetDocumentCount = 1 - Call hCloseDocument - Loop - endif + hFileCloseAll() endif else printlog "(" + sOnlyFileName + "." + sOnlyFileExtension + ") won't be loaded because of excluded extensions .so and .tmp." - if GetDocumentCount > 1 then - Do Until GetDocumentCount = 1 - Call hCloseDocument - Loop - endif + hFileCloseAll() endif endif endcase |