diff options
author | Joerg Skottke [jsk] <jsk@openoffice.org> | 2010-04-27 09:01:23 +0200 |
---|---|---|
committer | Joerg Skottke [jsk] <jsk@openoffice.org> | 2010-04-27 09:01:23 +0200 |
commit | 5809451d5f0689d77302640083145a3071a4c5b2 (patch) | |
tree | 43f31893ee723f957dd4c0f6c6e55bea868c5e14 /testautomation/framework | |
parent | 40a90261b0e97df90ab41ad3596080117476221f (diff) |
npower13_objectmodules: #i111175 - Blind fix for changed nodecount and -position as well as enhanced string matching.
Diffstat (limited to 'testautomation/framework')
4 files changed, 68 insertions, 57 deletions
diff --git a/testautomation/framework/optional/f_basic_vba-compat.bas b/testautomation/framework/optional/f_basic_vba-compat.bas index 363e59c70cb4..a4dc91b70aac 100755 --- a/testautomation/framework/optional/f_basic_vba-compat.bas +++ b/testautomation/framework/optional/f_basic_vba-compat.bas @@ -54,6 +54,7 @@ sub LoadIncludeFiles use "global\tools\includes\optional\t_basic_organizer_tools.inc" use "global\tools\includes\optional\t_treelist_tools.inc" + use "global\tools\includes\optional\t_stringtools.inc" use "framework\optional\includes\basic_vba_compat_tools.inc" diff --git a/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc b/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc index fea6742d5917..6a9f0f3f47a4 100644 --- a/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc +++ b/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc @@ -36,12 +36,23 @@ testcase tBasicVBACompatImportDisabled() printlog( "Test VBA compatibility switch / executable Microsoft(R) Excel(R) Macros" ) printlog( "Test case 2: Import macros but do not set the executable mode" ) - ' This test case is based on the use cases provided in issue #i88690 ' Spec: http://specs.openoffice.org/appwide/options_settings/Option_Dialog.odt + + const NODE_COUNT = 78 + + const DOCUMENT_POSITION_OFFSET = -7 + + const IMPORT_EXCEL_MACROS = TRUE + const EXEC_EXCEL_MACROS = FALSE + + const DOCUMENT_NAME = "vba-test.xls" + const MATCH_NONE = 0 + const MATCH_EXACT = 1 + const MATCH_PARTLY = 2 dim cTestFile as string - cTestFile = gTesttoolPath & "framework/optional/input/vba-compat/vba-test.xls" + cTestFile = gTesttoolPath & "framework/optional/input/vba-compat/" & DOCUMENT_NAME dim cNodeCount as integer @@ -59,12 +70,6 @@ testcase tBasicVBACompatImportDisabled() dim bFound as boolean ' Depending on the mode of macro import we have differtent basic libraries listed - const NODE_COUNT = 78 - - const DOCUMENT_POSITION_OFFSET = -7 - - const IMPORT_EXCEL_MACROS = TRUE - const EXEC_EXCEL_MACROS = FALSE printlog( "Set macro security to low" ) hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_LOW ) @@ -89,9 +94,11 @@ testcase tBasicVBACompatImportDisabled() printlog( "Verify position of the document node" ) MakroAus.select( cNodeCount + DOCUMENT_POSITION_OFFSET ) - if ( MakroAus.getSelText() <> "vba-test.xls" ) then - qaerrorlog( "The document node is not at the expected position" ) - endif + select case( hCompareSubStrings( MakroAus.getSelText(), DOCUMENT_NAME ) ) + case MATCH_NONE : warnlog ( "The document is not listed at the expected position" ) + case MATCH_EXACT : printlog( "The document is at the expected position and writable" ) + case MATCH_PARTLY : printlog( "The document is at the expected position and write protected" ) + end select for iCurrentModule = 2 to 7 @@ -132,7 +139,6 @@ testcase tBasicVBACompatImportDisabled() hSetExcelImportModeDefault() hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT ) - endcase diff --git a/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc b/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc index f5e9c0c4f515..f9db06fb9a5d 100644 --- a/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc +++ b/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc @@ -39,18 +39,34 @@ testcase tBasicVBACompatImportEnabled() ' This test case is based on the use cases provided in issue #i88690 ' Spec: http://specs.openoffice.org/appwide/options_settings/Option_Dialog.odt - - dim cFile as string : cFile = "vba-test.xls" + + ' Depending on the mode of macro import we have differtent basic libraries listed + const NODE_COUNT = 78 + + const DOCUMENT_POSITION_OFFSET = -7 + + const IMPORT_EXCEL_MACROS = TRUE + const EXEC_EXCEL_MACROS = TRUE + + const DOCUMENT_NAME = "vba-test.xls" + const MATCH_NONE = 0 + const MATCH_EXACT = 1 + const MATCH_PARTLY = 2 dim cTestFile as string - cTestFile = gTesttoolPath & "framework/optional/input/vba-compat/" & cFile + cTestFile = gTesttoolPath & "framework/optional/input/vba-compat/" & DOCUMENT_NAME dim cNodeCount as integer - ' note that index 0 and 1 are ommitted intentionally - dim caNodeData( 3 ) as string - caNodeData( 2 ) = "Modul1" - caNodeData( 3 ) = "Modul2" + dim caNodeData( 7 ) as string + caNodeData( 0 ) = DOCUMENT_NAME ' The document, not used + caNodeData( 1 ) = "Standard" ' The default library, not used + caNodeData( 2 ) = "DieseArbeitsmappe" + caNodeData( 3 ) = "Modul1" + caNodeData( 4 ) = "Modul2" + caNodeData( 5 ) = "Tabelle1" + caNodeData( 6 ) = "Tabelle2" + caNodeData( 7 ) = "Tabelle3" dim caScripts( 3 ) as string caScripts( 2 ) = "ConcatFct Ende" @@ -62,14 +78,6 @@ testcase tBasicVBACompatImportEnabled() dim cTempString as string dim bFound as boolean - ' Depending on the mode of macro import we have differtent basic libraries listed - const NODE_COUNT = 74 - - const DOCUMENT_POSITION_OFFSET = -3 - - const IMPORT_EXCEL_MACROS = TRUE - const EXEC_EXCEL_MACROS = TRUE - printlog( "Set macro security to low" ) hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_LOW ) @@ -94,26 +102,13 @@ testcase tBasicVBACompatImportEnabled() printlog( "Verify position of the document node." ) MakroAus.select( cNodeCount + DOCUMENT_POSITION_OFFSET ) - cTempString = MakroAus.getSelText() - if ( cTempString <> cFile ) then - qaerrorlog( "The filename does not match. File may be read-only." ) - if ( instr( cTempString, cFile ) > 1 ) then - printlog( "Filename is contained in the UI string." ) - select case ( getAttr( cTestFile ) ) - case 0 : warnlog( "The file appears to be read-only but it is " & _ - "not write-protected on filesystem level." ) - case 1 : printlog( "The file is read-only on filesystem level. Ok." ) - case else - warnlog( "getAttr() returned unexpected value. 1 or 2 are allowed" ) - printlog( "RC from getAttr() is: " & getAttr( cTestFile ) ) - end select - else - qaerrorlog( "The document node is not at the expected position." ) - qaerrorlog( "Object at this position is: " & MakroAus.getSelText() ) - endif - endif + select case( hCompareSubStrings( MakroAus.getSelText(), DOCUMENT_NAME ) ) + case MATCH_NONE : warnlog ( "The document is not listed at the expected position" ) + case MATCH_EXACT : printlog( "The document is at the expected position and writable" ) + case MATCH_PARTLY : printlog( "The document is at the expected position and write protected" ) + end select - for iCurrentModule = 2 to 3 + for iCurrentModule = 2 to 7 printlog( "Look for: " & caNodeData( iCurrentModule ) ) diff --git a/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc b/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc index f61064e28e0d..394ff08fc7a7 100644 --- a/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc +++ b/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc @@ -38,19 +38,26 @@ testcase tBasicVBACompatImportNothing() ' This test case is based on the use cases provided in issue #i88690 ' Spec: http://specs.openoffice.org/appwide/options_settings/Option_Dialog.odt - - dim cTestFile as string - cTestFile = gTesttoolPath & "framework/optional/input/vba-compat/vba-test.xls" - - dim cNodeCount as integer - - ' Depending on the mode of macro import we have differtent basic libraries listed +' Depending on the mode of macro import we have differtent basic libraries listed const NODE_COUNT = 72 ' Do not import Microsoft(R) Excel(R) macros at all const MACRO_LIST = 0 ' The document library should have no scripts listed const DOCUMENT_POSITION_OFFSET = -1 - + const IMPORT_EXCEL_MACROS = FALSE const EXEC_EXCEL_MACROS = FALSE + + const DOCUMENT_NAME = "vba-test.xls" + const MATCH_NONE = 0 + const MATCH_EXACT = 1 + const MATCH_PARTLY = 2 + + dim cTestFile as string + cTestFile = gTesttoolPath & "framework/optional/input/vba-compat/" & DOCUMENT_NAME + + dim cNodeCount as integer + + + printlog( "Set macro security to low" ) hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_LOW ) @@ -75,9 +82,11 @@ testcase tBasicVBACompatImportNothing() printlog( "Verify position of the document node" ) MakroAus.select( cNodeCount + DOCUMENT_POSITION_OFFSET ) - if ( MakroAus.getSelText() <> "vba-test.xls" ) then - qaerrorlog( "The document node is not at the expected position" ) - endif + select case( hCompareSubStrings( MakroAus.getSelText(), DOCUMENT_NAME ) ) + case MATCH_NONE : warnlog ( "The document is not listed at the expected position" ) + case MATCH_EXACT : printlog( "The document is at the expected position and writable" ) + case MATCH_PARTLY : printlog( "The document is at the expected position and write protected" ) + end select printlog( "Select the last node, this should be the standard Library for the document" ) MakroAus.select( cNodeCount ) |