diff options
author | Joerg Skottke [jsk] <jsk@openoffice.org> | 2010-04-30 01:52:18 +0200 |
---|---|---|
committer | Joerg Skottke [jsk] <jsk@openoffice.org> | 2010-04-30 01:52:18 +0200 |
commit | e4f34dff000d5e020f0d93280fcb01687f5f4b54 (patch) | |
tree | b55fc841975ed327b8576340ed3fc5635f39af92 /testautomation/framework/optional/includes | |
parent | 5d057b1ca732b3fbde8902de22b3ab979dc9d409 (diff) |
vitomation01: #i111247 - Fix f_basic_modules.bas, remove invalid qaerrorlogs etc.
Diffstat (limited to 'testautomation/framework/optional/includes')
-rwxr-xr-x | testautomation/framework/optional/includes/basic_modulehide.inc | 53 | ||||
-rwxr-xr-x | testautomation/framework/optional/includes/basic_modulenames.inc | 48 |
2 files changed, 48 insertions, 53 deletions
diff --git a/testautomation/framework/optional/includes/basic_modulehide.inc b/testautomation/framework/optional/includes/basic_modulehide.inc index 7702f14fdfb7..8423c67e6b67 100755 --- a/testautomation/framework/optional/includes/basic_modulehide.inc +++ b/testautomation/framework/optional/includes/basic_modulehide.inc @@ -54,42 +54,45 @@ testcase tBasicIdeModuleHide ToolsMacro_uno hCreateModuleForDoc() + printlog( "Insert macro" ) if ( hInsertMacroFromFile( TESTMACRO ) > ERR_NO_LINES_INSERTED ) then printlog( CFN & "Macro has been written successfully" ) else warnlog( CFN & "Failed to insert macro" ) endif + printlog( "Hide the module" ) + if ( hHideModule() ) then - if ( hHideModule() <> RC_SUCCESS ) then - warnlog( "Some unexpected error occurred while trying to hide the module" ) - endif - - ' hTestMacro is expected to fail, so we jump to the catch statement - if ( hInsertMacroFromFile( TESTMACRO ) > ERR_NO_LINES_INSERTED ) then - warnlog( "For some reason the original module is still visible" ) - else - warnlog( "There should not be any editingwindow visible" ) - endif - - if ( hOpenBasicObjectOrganizer( TAB_MODULES ) ) then - - modulliste.typekeys( "<END><RIGHT><DOWN><RIGHT><DOWN>" ) - if ( hClickButton( Bearbeiten ) = RC_TIMEOUT ) then - warnlog( "#i35097# Crash when editing last module" ) - goto endsub + ' hTestMacro is expected to fail, so we jump to the catch statement + if ( hInsertMacroFromFile( TESTMACRO ) <> ERR_NO_LINES_INSERTED ) then + warnlog( "For some reason the original module is still visible" ) + else + printlog( "The edit window is not accessible, good" ) endif - - if ( not hBasicIDERunMacro( TESTMACRO ) ) then - warnlog( "Incorrect macro executed/macro missing" ) + + if ( hOpenBasicObjectOrganizer( TAB_MODULES ) ) then + + modulliste.typekeys( "<END><RIGHT><DOWN><RIGHT><DOWN>" ) + if ( hClickButton( Bearbeiten ) = RC_TIMEOUT ) then + warnlog( "#i35097# Crash when editing last module" ) + goto endsub + endif + + if ( not hBasicIDERunMacro( TESTMACRO ) ) then + warnlog( "Incorrect macro executed/macro missing" ) + endif + + hCloseBasicIDE() + hFileCloseAll() + + else + warnlog( "restarting the office to recover from errors" ) + call exitRestartTheOffice() endif - hCloseBasicIDE() - hFileCloseAll() - else - warnlog( "restarting the office to recover from errors" ) - call exitRestartTheOffice() + warnlog( "Some unexpected error occurred while trying to hide the module" ) endif endcase diff --git a/testautomation/framework/optional/includes/basic_modulenames.inc b/testautomation/framework/optional/includes/basic_modulenames.inc index d59999956724..f874fd93976a 100755 --- a/testautomation/framework/optional/includes/basic_modulenames.inc +++ b/testautomation/framework/optional/includes/basic_modulenames.inc @@ -33,7 +33,10 @@ testcase tBasicIdeModuleNames - const CMODULE = "TModuleNames" + printlog( "Modulenames in BASIC IDE" ) + + const CMODULE_VALID1 = "tValidName" + const CMODULE_VALID2 = "tValidToo" const TEST_MACRO = "TTMacro1" const RC_SUCCESS = 0 @@ -46,7 +49,7 @@ testcase tBasicIdeModuleNames gApplication = "WRITER" hCreateDocument() - hInitBasicIde( CMODULE ) + hInitBasicIde( CMODULE_VALID1 ) if ( hInsertMacroFromFile( TEST_MACRO ) > ERR_NO_LINES_INSERTED ) then cTabName = hGetTabNameFromOrganizer() @@ -54,29 +57,19 @@ testcase tBasicIdeModuleNames Randomize iCurrentName = Int( 24 * RND ) + 1 ' Range from 1 to 24 + printlog( "Trying with invalid modulename" ) cTabName = hCreateInvalidModuleName( iCurrentName ) - - if ( hRenameTab( cTabName ) = RC_FAILURE ) then - hHandleInvalidNameWarning( cTabname ) + hRenameTab( cTabName ) + if ( hHandleInvalidNameWarning( cTabname ) ) then + printlog( "Warning for invalid modulename displayed" ) else - warnlog( "Warning missing" ) + warnlog( "Warning for invalid modulename is missing" ) endif - cTabname = CMODULE - - if ( hRenameTab( cTabname ) <> RC_SUCCESS ) then - if ( hHandleInvalidNameWarning( cTabname ) ) then - warnlog( "Failed to set valid name" ) - endif - endif - - - cTabname = hCreateInvalidModuleName( 0 ) - - if ( hRenameTab( cTabName ) <> RC_SUCCESS ) then - if ( hHandleInvalidNameWarning( cTabname ) ) then - warnlog( "Failed to set valid name" ) - endif + printlog( "Trying with valid modulename" ) + hRenameTab( CMODULE_VALID2 ) + if ( hHandleInvalidNameWarning( CMODULE_VALID2 ) ) then + warnlog( "Failed to set valid modulename" ) endif else @@ -91,7 +84,7 @@ endcase testcase tInvalidModuleNames - printlog( "Try to give BASIC modules invalid names (which should fail)" ) + printlog( "Modulenames in BASIC Organizer" ) const MAX_WAIT = 2 const OK_BUTTON_ONLY = 1 @@ -150,7 +143,7 @@ endcase testcase tValidModuleNames - printlog( "Try using BASIC reserved names (and others) as module names (which should work)" ) + printlog( "Valid modulenames in BASIC Organizer: Names that are BASIC keywords" ) dim iCurrentName as Integer dim sModuleName as String @@ -192,22 +185,21 @@ function hHandleInvalidNameWarning( cTabName as string ) as boolean kontext "Active" if ( Active.exists( MAX_WAIT ) ) then - printlog( "Invalid name message displayed" ) - printlog( Active.getText() ) + printlog( "Invalid name message displayed" & Active.getText() ) hCloseDialog( Active, "ok" ) hHandleInvalidNameWarning() = true kontext "Active" if ( Active.exists( MAX_WAIT ) ) then - warnlog( "Unexpected messagebox displayed: " & Active.getText() ) + printlog( "Unexpected messagebox displayed: " & Active.getText() ) hHandleInvalidNameWarning() = false endif - kontext "basicide" + kontext "BasicIDE" tabbar.typekeys( "<ESCAPE>" , true ) else - warnlog( "Invalid name warning is missing" ) + printlog( "Invalid name warning not displayed" ) hHandleInvalidNameWarning() = false endif |