summaryrefslogtreecommitdiff
path: root/testautomation/framework/optional/includes/basic_issues.inc
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-02-11 07:51:53 +0000
committerOliver Bolte <obo@openoffice.org>2009-02-11 07:51:53 +0000
commit3ea7bde4ffde5230a319689631415dc6085078dc (patch)
tree3503c2160713f76057bae3ed03e66a0f421b73fe /testautomation/framework/optional/includes/basic_issues.inc
parent9e1d27a380a4d415152e9cd7bf533f19ba79cef0 (diff)
CWS-TOOLING: integrate CWS ab61
2009-01-29 09:39:19 +0100 jsk r267096 : #i97038 2009-01-20 12:35:31 +0100 ab r266568 : #i94994# Applied patch 2009-01-19 17:50:55 +0100 ab r266514 : #i97038# Applied patch 2009-01-13 14:47:20 +0100 ab r266226 : #i96087# Applied patch 2009-01-13 12:24:30 +0100 ab r266207 : #i95200# Applied patch 2008-12-19 16:37:32 +0100 ab r265735 : #i93214# Applied patch 2008-12-19 16:21:38 +0100 ab r265730 : #i57749# Applied patch
Diffstat (limited to 'testautomation/framework/optional/includes/basic_issues.inc')
-rwxr-xr-xtestautomation/framework/optional/includes/basic_issues.inc111
1 files changed, 70 insertions, 41 deletions
diff --git a/testautomation/framework/optional/includes/basic_issues.inc b/testautomation/framework/optional/includes/basic_issues.inc
index a288ea45a513..07162e3a55e8 100755
--- a/testautomation/framework/optional/includes/basic_issues.inc
+++ b/testautomation/framework/optional/includes/basic_issues.inc
@@ -50,9 +50,20 @@ end function
'*******************************************************************************
-function hTestActive( cString as string , iMethod as integer ) as integer
+function hTestActive( cString as string , iMethod as integer , bExact as boolean ) as integer
+
+ ' Return values:
+ ' -1 = Exact match expected, fuzzy match found
+ ' -2 = No match
+ ' -3 = content of messagebox not relevant
+ ' -4 = Messagebox not displayed / Macro not executed
+ ' 1 - 4 = Number of buttons on the dialog
+
+ const CFN = "hTestActive()::"
- dim cMsg as string
+ dim cMsg as string ' The string printed in the message box
+ dim rc as integer ' Returncode for error handling and returnvalue
+ dim buttons as integer ' Number of buttons on the message box
kontext "Active"
if ( Active.exists( 2 ) ) then
@@ -61,15 +72,29 @@ function hTestActive( cString as string , iMethod as integer ) as integer
if ( cString <> "" ) then
if ( instr( active.getText(), cString ) <> 0 ) then
- printlog( "Correct message found: " & cMsg )
+ if ( active.getText() = cString ) then
+ 'printlog( CFN & "Correct message found (exact match): " & cMsg )
+ rc = 0
+ else
+ if ( bExact ) then
+ warnlog( CFN & "Message is no exact match: " & cMsg )
+ rc = -1
+ else
+ 'printlog( CFN & "Correct message found (fuzzy match): " & cMsg )
+ rc = 0
+ endif
+ endif
else
- warnlog( "Messagebox has wrong content: " & cMsg )
+ warnlog( CFN & "Messagebox has wrong content: " & cMsg )
+ rc = -4
endif
else
- printlog( "Messagebox: " & cMsg )
+ 'printlog( CFN & "Messagebox: " & cMsg )
+ rc = -3
endif
- hTestActive() = Active.getButtonCount()
+ buttons = Active.getButtonCount()
+ 'printlog( CFN & "Number of buttons: " & buttons )
select case( iMethod )
case 1 : Active.OK()
case 2 : Active.Cancel()
@@ -77,9 +102,11 @@ function hTestActive( cString as string , iMethod as integer ) as integer
case 4 : Active.No()
end select
else
- warnlog( "Messagebox is missing" )
+ warnlog( CFN & "Messagebox is missing" )
endif
+ if ( rc = 0 ) then hTestActive() = buttons
+
end function
'*******************************************************************************
@@ -90,61 +117,58 @@ testcase t_macros()
call hNewDocument()
hInitBasicIDE( "TestIssues" )
- dim cLocalMacrosFile as string
- cLocalMacrosFile = gTesttoolPath & "framework\optional\input\vba-compat\vba-compat-macros.txt"
-
printlog( "" )
printlog( " ---------- i41695 ------------ " )
hInsertMacroFromFile( "i41695" )
hIDERunMacro()
- hTestActive( "i41695-1", 1 )
- hTestActive( "i41695-2", 1 )
+ hTestActive( "i41695-1", 1 , TRUE )
+ hTestActive( "i41695-2", 1 , TRUE )
printlog( "" )
printlog( " ---------- i83978 ------------ " )
hInsertMacroFromFile( "i83978" )
hIDERunMacro()
- hTestActive( "com.sun.star.container.NoSuchElementException", 1 )
+ hTestActive( "com.sun.star.container.NoSuchElementException", 1 , FALSE )
printlog( "" )
printlog( " ---------- i82830 ------------ " )
hInsertMacroFromFile( "i82830" )
hIDERunMacro()
- hTestActive( "12D687", 1 )
- hTestActive( "4553207", 1 )
+ hTestActive( "12D687" , 1 , TRUE )
+ hTestActive( "4553207", 1 , TRUE )
if ( gISOLang = "en-US" ) then
printlog( "" )
printlog( " ---------- i81674 ------------ " )
hInsertMacroFromFile( "i81674" )
hIDERunMacro()
- hTestActive( "250", 1 )
- hTestActive( "Yes", 1 )
- hTestActive( "True", 1 )
- hTestActive( "On", 1 )
+ hTestActive( "250" , 1 , FALSE )
+ hTestActive( "Yes" , 1 , TRUE )
+ hTestActive( "True", 1 , TRUE )
+ hTestActive( "On" , 1 , TRUE )
endif
printlog( "" )
printlog( " ---------- i80532 ------------ " )
hInsertMacroFromFile( "i80532" )
hIDERunMacro()
- hTestActive( "-10", 1 )
- hTestActive( "1", 1 )
- hTestActive( "-10", 1 )
+ hTestActive( "-10", 1 , FALSE )
+ hTestActive( "1" , 1 , FALSE )
+ hTestActive( "-10", 1 , FALSE )
printlog( "" )
printlog( " ---------- i84040 ------------ " )
hInsertMacroFromFile( "i84040" )
hIDERunMacro()
- hTestActive( "false", 1 )
- hTestActive( "false", 1 )
+ hTestActive( "False", 1 , TRUE )
+ hTestActive( "False", 1 , TRUE )
printlog( "" )
printlog( " ---------- i86265 ------------ " )
hInsertMacroFromFile( "i86265" )
hIDERunMacro()
- hTestActive( "i86265-1", 1 )
- hTestActive( "i86265-2", 1 )
+ hTestActive( "i86265-1", 1 , TRUE )
+ hTestActive( "i86265-2", 1 , TRUE )
printlog( "" )
printlog( " ---------- i92329 ------------ " )
@@ -153,24 +177,29 @@ testcase t_macros()
hTestActive( "Return an Array" , 1 )
printlog( "" )
+ printlog( " ---------- i97038 ------------ " )
+ hInsertMacroFromFile( "i97038" )
+ hIDERunMacro()
+ hTestActive( "1900" , 1 , FALSE )
+ hTestActive( "2" , 1 , FALSE )
+
+ printlog( "" )
printlog( " ---------- MessageBoxes ------------ " )
hInsertMacroFromFile( "MessageBoxes" )
hIDERunMacro()
- if ( hTestActive( "0x" , 1 ) <> 1 ) then warnlog( "Wrong ressource type" )
- if ( hTestActive( "1x" , 1 ) <> 2 ) then warnlog( "Wrong ressource type" )
- if ( hTestActive( "2x" , 2 ) <> 3 ) then warnlog( "Wrong ressource type" )
- if ( hTestActive( "3x" , 2 ) <> 3 ) then warnlog( "Wrong ressource type" )
- if ( hTestActive( "4x" , 4 ) <> 2 ) then warnlog( "Wrong ressource type" )
- if ( hTestActive( "5x" , 2 ) <> 2 ) then warnlog( "Wrong ressource type" )
- if ( hTestActive( "16" , 2 ) <> 3 ) then warnlog( "Wrong ressource type" )
- if ( hTestActive( "32" , 2 ) <> 3 ) then warnlog( "Wrong ressource type" )
- if ( hTestActive( "48" , 2 ) <> 3 ) then warnlog( "Wrong ressource type" )
- if ( hTestActive( "64" , 1 ) <> 1 ) then warnlog( "Wrong ressource type" )
- if ( hTestActive( "128", 2 ) <> 3 ) then warnlog( "Wrong ressource type" )
- if ( hTestActive( "256", 2 ) <> 3 ) then warnlog( "Wrong ressource type" )
- if ( hTestActive( "512", 2 ) <> 3 ) then warnlog( "Wrong ressource type" )
-
-
+ if ( hTestActive( "0x" , 1 , TRUE ) > 1 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "1x" , 1 , TRUE ) > 2 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "2x" , 2 , TRUE ) > 3 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "3x" , 2 , TRUE ) > 3 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "4x" , 4 , TRUE ) > 2 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "5x" , 2 , TRUE ) > 2 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "16" , 2 , TRUE ) > 3 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "32" , 2 , TRUE ) > 3 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "48" , 2 , TRUE ) > 3 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "64" , 1 , TRUE ) > 1 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "128", 2 , TRUE ) > 3 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "256", 2 , TRUE ) > 3 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "512", 2 , TRUE ) > 3 ) then warnlog( "Wrong resource type" )
printlog( "" )
hCloseBasicIDE()