diff options
author | Joerg Skottke [jsk] <jsk@openoffice.org> | 2010-08-11 08:57:13 +0200 |
---|---|---|
committer | Joerg Skottke [jsk] <jsk@openoffice.org> | 2010-08-11 08:57:13 +0200 |
commit | 04bd67e0deadf9ead7604b1ecb2d8d3982b6e3ae (patch) | |
tree | aba37f781f9be0714bbe71c9aa01c4eb3dac9859 /testautomation/framework/required/includes | |
parent | e1bfef17e53bbb3f6749e1680be352df04e1d177 (diff) | |
parent | fab88b108186950d669113dda22e8bfef489edd9 (diff) |
jl154: Local merge
Diffstat (limited to 'testautomation/framework/required/includes')
8 files changed, 166 insertions, 128 deletions
diff --git a/testautomation/framework/required/includes/script_organizers.inc b/testautomation/framework/required/includes/script_organizers.inc index 6082a3313ce0..b9ed8420134e 100755 --- a/testautomation/framework/required/includes/script_organizers.inc +++ b/testautomation/framework/required/includes/script_organizers.inc @@ -31,80 +31,118 @@ '* '\****************************************************************************** -testcase tUpdtScriptCount - dim sDialog as string +testcase tUpdtScripts printlog( "Resource test for macros and scripts / related dialogs" ) - const SCRIPTING_DIALOGS = 5 + if ( gIsoLang <> "en-US" ) then + printlog( "No testing for languages other than en_US" ) + goto endsub + endif - dim aScriptCount( SCRIPTING_DIALOGS ) + const SCRIPTING_DIALOGS = 5 - aScriptCount( 1 ) = 10 ' JavaScript - aScriptCount( 2 ) = 14 ' BeanShell - - if ( lcase( gPlatform ) = "osx" ) then - aScriptCount( 3 ) = 8 ' Python - aScriptCount( 5 ) = 600 ' Run Macro - else - aScriptCount( 3 ) = 10 ' Python - aScriptCount( 5 ) = 602 ' Run Macro - endif + const DLG_JAVASCRIPT = "JavaScript" + const DLG_BEANSHELL = "BeanShell" + const DLG_PYTHON = "Python" + const DLG_BASIC_ORG = "BasicOrganizer" + const DLG_RUN_MACRO = "RunMacro" - if ( gOOo ) then - aScriptCount( 4 ) = 585 ' Makro Organizer - aScriptCount( 5 ) = aScriptCount( 5 ) - 1 ' Run Macro - else - ' Makro Organizer - aScriptCount( 4 ) = 586 - endif + ' This is the build specific part of the filename including substrings for + ' the productname and language. + dim sProductString as string : sProductString = gProductName & "_" & gISOLang & "_" + + ' define platforms that have different scriptcount + if ( lcase( gPlatGroup ) = "w95" ) then sProductString = sProductString & "win_" + if ( lcase( gPlatform ) = "osx" ) then sProductString = sProductString & "osx_" + + ' replace all blanks + sProductString = hStringReplaceChar( sProductString, " ", "-" ) + + ' This is where reference file is located, the filename is yet incomplete + dim sInputPath as string + sInputPath = gTesttoolPath & "framework/required/input/scripts/" & sProductString + + ' This is where we store the reference file if differences are found. + dim sOutputPath as string + sOutputPath = gOfficePath & "user/work/" & sProductString + + ' These contain the input and output paths (fully qualified) + dim sFileIn as string + dim sFileOut as string + + ' Array that contains the scriptnames for all organizers + dim cScriptNamesList( 1000 ) as string + dim sDialog as string dim iCurrentDialog as integer - dim iCurrentScriptCount as integer - + + dim iDiffCount as integer + hInitSingleDoc() for iCurrentDialog = 1 to SCRIPTING_DIALOGS - printlog( "" ) - select case iCurrentDialog - case 1: sDialog = "JavaScript" - ToolsMacrosOrganizeMacrosJavaScript - kontext "ScriptOrganizer" - iCurrentScriptCount = hExpandAllNodes( ScriptTreeList ) - ScriptOrganizer.cancel() - case 2: sDialog = "BeanShell" - ToolsMacrosOrganizeMacrosBeanShell - kontext "ScriptOrganizer" - iCurrentScriptCount = hExpandAllNodes( ScriptTreeList ) - ScriptOrganizer.cancel() - case 3: sDialog = "Python" - ToolsMacrosOrganizeMacrosPython - kontext "ScriptOrganizer" - iCurrentScriptCount = hExpandAllNodes( ScriptTreeList ) - ScriptOrganizer.cancel() - case 4: sDialog = "Makro Organizer" - ToolsMacro_uno - Kontext "Makro" - hExpandAllNodes( MakroAus ) - iCurrentScriptCount = hGetScriptCount( MakroAus, MakroListe ) - Makro.close() - case 5: sDialog = "Run Macro" - ToolsMacrosRunMacro - kontext "ScriptSelector" - hExpandAllNodes( LibraryTreeList ) - iCurrentScriptCount = hGetScriptCount( LibraryTreeList, ScriptList ) - ScriptSelector.cancel() + ListAllDelete( cScriptNamesList() ) + + ' Build complete filename and identify dialog for logging and case selection + select case ( iCurrentDialog ) + case 1 : sDialog = DLG_JAVASCRIPT + case 2 : sDialog = DLG_BEANSHELL + case 3 : sDialog = DLG_PYTHON + case 4 : sDialog = DLG_BASIC_ORG + case 5 : sDialog = DLG_RUN_MACRO end select - printlog( sDialog ) - - if ( aScriptCount( iCurrentDialog ) <> iCurrentScriptCount ) then - warnlog( "Incorrect number of scripts for this dialog: '" + sDialog + "' expected:" + aScriptCount( iCurrentDialog ) + ", but is:" & iCurrentScriptCount ) - else - printlog( "Number of scripts is ok" ) - endif + printlog( "" ) + sFileIn = convertpath( sInputPath & sDialog & ".txt" ) + sFileOut = convertpath( sOutputPath & sDialog & ".txt" ) + + printlog( "Open <" & sDialog & "> and access the treelist object" ) + + ' Note: hGetAllNodeNames() is a *global* function defined in t_treelist_tools.inc + ' DLG_BASIC_ORG and DLG_RUN_MACRO have - in addition to the treelist - + ' a separate script list. To get those scripts a little more effort is + ' required which is done in the *local* function hGetScriptNames() + + select case ( sDialog ) + case DLG_JAVASCRIPT: ToolsMacrosOrganizeMacrosJavaScript + kontext "ScriptOrganizer" + hGetAllNodeNames( ScriptTreeList, cScriptNamesList() ) + case DLG_BEANSHELL: ToolsMacrosOrganizeMacrosBeanShell + kontext "ScriptOrganizer" + hGetAllNodeNames( ScriptTreeList, cScriptNamesList() ) + case DLG_PYTHON: ToolsMacrosOrganizeMacrosPython + kontext "ScriptOrganizer" + hGetAllNodeNames( ScriptTreeList, cScriptNamesList() ) + case DLG_BASIC_ORG: ToolsMacro_uno + Kontext "Makro" + hGetScriptNames( MakroAus, MakroListe, cScriptNamesList() ) + case DLG_RUN_MACRO: ToolsMacrosRunMacro + kontext "ScriptSelector" + hGetScriptNames( LibraryTreeList, ScriptList, cScriptNamesList() ) + end select + printlog( "Compare to reference list, create new one if differences were found" ) + iDiffCount = hManageComparisionList( sFileIn, sFileOut, cScriptNamesList() ) + + if ( iDiffCount <> 0 ) then warnlog( "The number of scripts has changed, please review." ) + + + printlog( "Close <" & sDialog & ">" ) + select case ( sDialog ) + case DLG_JAVASCRIPT : + ScriptOrganizer.cancel() + case DLG_BEANSHELL : + ScriptOrganizer.cancel() + case DLG_PYTHON : + ScriptOrganizer.cancel() + case DLG_BASIC_ORG : + Makro.close() + case DLG_RUN_MACRO : + ScriptSelector.cancel() + end select + next iCurrentDialog hCloseDocument() @@ -113,15 +151,44 @@ endcase '******************************************************************************* -function hGetScriptCount( oTree as object, oList as object ) as integer +sub hGetScriptNames( oTreeList as object, oScriptList as object, cItemList() as string ) - dim iCurrentTreeItem as integer - dim iScriptCount as integer : iScriptCount = 0 - - for iCurrentTreeItem = 1 to oTree.getItemCount() - oTree.select( iCurrentTreeItem ) - iScriptCount = iScriptCount + oList.getItemCount() - next iCurrentTreeItem - hGetScriptCount() = iScriptCount - -end function + ' oTreeList is the treelist object (left pane) + ' oScriptList is the script list (right pane) + ' cScriptList() is filled with the scriptnames of the form + ' <module>:<script name> like "CommonLang:LoadLanguages" + + dim iCurrentTreeListItem as integer + dim iObjectsInTreelist as integer + + dim cModuleName as string + dim cReferenceString as string + + dim iScriptCount as integer + dim iCurrentScript as integer + dim cScriptList( 1000 ) as string + + ' Get the number of nodes from the modules treelist + iObjectsInTreeList = hExpandAllNodes( oTreeList ) + + ' For each item in the modules treelist get the number of scripts (right pane) + for iCurrentTreeListItem = 1 to iObjectsInTreeList + + ' Get the name of the current treelist node, append it to the list + ' (otherwise it does not appear if it has no scripts) + cModuleName = hGetNodeName( oTreeList, iCurrentTreeListItem ) + hListAppend( cModuleName, cItemList() ) + + ' Get the number of scripts from the right pane, reset the array in advance + ListAllDelete( cScriptList() ) + iScriptCount = hGetListItems( oScriptList, cScriptList() ) + + ' Build the string for the reference list and append it to cScriptList() + for iCurrentScript = 1 to iScriptCount + cReferenceString = cModuleName & ":" & cScriptList( iCurrentScript ) + hListAppend( cReferenceString, cItemList() ) + next iCurrentScript + + next iCurrentTreeListItem + +end sub
\ No newline at end of file diff --git a/testautomation/framework/required/includes/wizard_agenda.inc b/testautomation/framework/required/includes/wizard_agenda.inc index a192be35015e..d423d2fd7c62 100755 --- a/testautomation/framework/required/includes/wizard_agenda.inc +++ b/testautomation/framework/required/includes/wizard_agenda.inc @@ -81,17 +81,16 @@ testcase tUpdtWizardAgenda hWaitForObject( TemplateName, 3000 ) TemplateName.setText( cTemplateName ) hSetTemplateSavePath( cTemplatePath ) - - hFinishWizard( 1 ) + + kontext "AutopilotAgenda" + hClickButton( CreateButton ) - iErr = hHandleSaveError() - if ( iErr = 1 ) then + if ( hHandleSaveError() = 1 ) then kontext "AutopilotAgenda" - hFinishWizard( 1 ) + hClickButton( CreateButton ) endif - brc = hDestroyDocument() - if ( not brc ) then qaerrorlog( "#i59233# The wizard does not display the new template" ) + if ( not hDestroyDocument() ) then qaerrorlog( "#i59233# The wizard does not display the new template" ) hFileCloseAll() hDeleteFile( cTemplatePath ) diff --git a/testautomation/framework/required/includes/wizard_documentconverter.inc b/testautomation/framework/required/includes/wizard_documentconverter.inc index cca037b16680..b99cef0a9c6c 100755 --- a/testautomation/framework/required/includes/wizard_documentconverter.inc +++ b/testautomation/framework/required/includes/wizard_documentconverter.inc @@ -49,18 +49,11 @@ testcase tUpdtWizardDocumentConverter dim iCurrentFile as integer hInitSingleDoc() - - irc = hOpenWizardWithMenu( "DOCCONV" ) - if ( irc <> 0 ) then - warnlog( "Unable to open requested wizard, aborting test" ) - goto endsub - endif - sTargetFile = hGetWorkPath() sLogFile = sTargetFile & "Logfile.odt" - - stargetFile = sTargetFile & "docconv1" & hGetSuffix( "current" ) - + sTargetFile = sTargetFile & "docconv1" & hGetSuffix( "current" ) + + FileWizardDocumentConverter Kontext "DocumentConverter" hWaitForObject( CreateLogfile, 3000 ) @@ -85,7 +78,7 @@ testcase tUpdtWizardDocumentConverter printlog( "Page " & 1 + iDocumentType & " is visible" ) else warnlog( "Cannot access page 2, aborting test" ) - hFinishWizard() + hCloseDialog( DocumentConverter, "Cancel" ) goto endsub endif diff --git a/testautomation/framework/required/includes/wizard_euroconverter.inc b/testautomation/framework/required/includes/wizard_euroconverter.inc index 87b32b5abf08..aeee35c59282 100755 --- a/testautomation/framework/required/includes/wizard_euroconverter.inc +++ b/testautomation/framework/required/includes/wizard_euroconverter.inc @@ -53,12 +53,7 @@ testcase tUpdtWizardEuroconverter hInitSingleDoc() - irc = hOpenWizardWithMenu( "EUROCONV" ) - if ( irc <> 0 ) then - warnlog( "Failed to open the Euroconverter, aborting test" ) - hDestroyDocument() - goto endsub - endif + FileWizardEuroConverter kontext "AutopilotEuroKonverter" call DialogTest( AutopilotEuroKonverter , 1 ) @@ -124,7 +119,7 @@ testcase tUpdtWizardEuroconverter kontext "AutopilotEuroKonverter" call DialogTest( AutopilotEuroKonverter , 2 ) - hFinishWizard( 1 ) + hClickButton( Konvertieren ) hDestroyDocument() hDeleteFile( cTargetDir & TARGET_FILE ) diff --git a/testautomation/framework/required/includes/wizard_fax.inc b/testautomation/framework/required/includes/wizard_fax.inc index bbd75f66a327..07fcc562dddc 100755 --- a/testautomation/framework/required/includes/wizard_fax.inc +++ b/testautomation/framework/required/includes/wizard_fax.inc @@ -35,9 +35,6 @@ testcase tUpdtWizardFax printlog( "Resource test for the fax wizard" ) - dim iErr as integer - dim brc as boolean - dim cTemplateName as string dim cTemplatePath as string @@ -74,14 +71,14 @@ testcase tUpdtWizardFax TemplateName.setText( cTemplateName ) hSetTemplateSavePath( cTemplatePath ) - - hFinishWizard( 1 ) + + kontext "AutopilotFax" + hClickButton( FinishButton ) kontext "StandardBar" hWaitForObject( Speichern, 5000 ) - brc = hDestroyDocument() - if ( not brc ) then qaerrorlog( "#i59233# The wizard does not display the new template" ) + if ( not hDestroyDocument() ) then qaerrorlog( "#i59233# The wizard does not display the new template" ) printlog( "Delete the user-template: " & cTemplatePath ) hDeleteFile( cTemplatePath ) diff --git a/testautomation/framework/required/includes/wizard_firsttime.inc b/testautomation/framework/required/includes/wizard_firsttime.inc index 63c79966b41e..657a68ada3d0 100755 --- a/testautomation/framework/required/includes/wizard_firsttime.inc +++ b/testautomation/framework/required/includes/wizard_firsttime.inc @@ -64,10 +64,6 @@ testcase tUpdtWizardFirsttime NextBtn.click() endif - - - - printlog( "Check the license page" ) kontext "TabFirstStartLicense" if ( TabFirstStartLicense.exists( 2 ) ) then @@ -198,7 +194,7 @@ testcase tUpdtWizardFirsttime LoadQuickstarter.unCheck() printlog( "Closing Tools/Options" ) Kontext "OptionenDlg" - OptionenDlg.cancel() + hCloseDialog( OptionenDlg, "cancel" ) printlog( "Restarting program" ) call ExitRestartTheOffice() else @@ -218,16 +214,12 @@ testcase tUpdtWizardFirsttime endif Kontext "OptionenDlg" - if ( OptionenDlg.exists() ) then - OptionenDlg.cancel() - endif + hCloseDialog( OptionenDlg, "cancel, optional" ) ' due to issue i105248 the Quickstart disabler needs to get called again, because the First Start Wizard resets the veto call hDisableQuickstarterAPI() - do while( getDocumentCount() > 0 ) - call hCloseDocument() - loop + hFileCloseAll() endcase diff --git a/testautomation/framework/required/includes/wizard_letter.inc b/testautomation/framework/required/includes/wizard_letter.inc index 1c0cb05031f0..4f68a04cbd8b 100755 --- a/testautomation/framework/required/includes/wizard_letter.inc +++ b/testautomation/framework/required/includes/wizard_letter.inc @@ -35,10 +35,6 @@ testcase tUpdtWizardLetter printlog( "Resource test for the letter-wizard" ) - dim iErr as integer - dim brc as boolean - dim irc as integer - ' Build the filename we want to save the template as. dim cTemplateName as string cTemplateName = "FWK-Testtool-Template-letterWizard.ott" @@ -158,8 +154,9 @@ testcase tUpdtWizardLetter printlog( " * name the template for further usage" ) TemplateName.setText( cTemplateName ) hSetTemplateSavePath( cTemplatePath ) - - hFinishWizard( 1 ) + + kontext "AutopilotLetter" + hClickButton( FinishButton ) if ( gOOo ) then kontext "UseOfThisTemplate" @@ -171,22 +168,19 @@ testcase tUpdtWizardLetter endif endif - iErr = hHandleSaveError() - if ( iErr = 1 ) then + if ( hHandleSaveError() = 1 ) then kontext "AutopilotLetter" - hFinishWizard( 1 ) + hClickButton( FinishButton ) endif - brc = hDestroyDocument() - if ( not brc ) then qaerrorlog( "#i59233# The wizard does not display the new template" ) + if ( not hDestroyDocument() ) then qaerrorlog( "#i59233# The wizard does not display the new template" ) else warnlog( "Autopilot Letter not open/exceeded timeout" ) endif hDeleteFile( cTemplatePath ) - irc = hDeleteUserTemplates() - if ( irc <> 0 ) then + if ( hDeleteUserTemplates() <> 0 ) then printlog( "Unexpectedly deleted user template(s), please check") endif diff --git a/testautomation/framework/required/includes/wizard_presentation.inc b/testautomation/framework/required/includes/wizard_presentation.inc index 68143b3cdc3c..53e2e0d3a50b 100755 --- a/testautomation/framework/required/includes/wizard_presentation.inc +++ b/testautomation/framework/required/includes/wizard_presentation.inc @@ -57,8 +57,9 @@ testcase tUpdtWizardPresentation printlog( "Page 3" ) kontext "AutopilotPraesentation3" call DialogTest( AutopilotPraesentation3 ) - - hFinishWizard( 1 ) + + kontext "AutopilotPraesentation3" + hCloseDialog( AutopilotPraesentation3, "ok" ) else warnlog( "Presentation wizard not open/exceeded timeout" ) endif |