diff options
Diffstat (limited to 'testautomation')
-rw-r--r--[-rwxr-xr-x] | testautomation/framework/optional/f_basic_gridcontrol.bas | 1 | ||||
-rw-r--r-- | testautomation/framework/optional/includes/basic_gridcontrol.inc | 92 | ||||
-rw-r--r--[-rwxr-xr-x] | testautomation/global/tools/includes/optional/t_macro_tools.inc | 40 |
3 files changed, 82 insertions, 51 deletions
diff --git a/testautomation/framework/optional/f_basic_gridcontrol.bas b/testautomation/framework/optional/f_basic_gridcontrol.bas index 963482253438..dc5f9a392988 100755..100644 --- a/testautomation/framework/optional/f_basic_gridcontrol.bas +++ b/testautomation/framework/optional/f_basic_gridcontrol.bas @@ -51,6 +51,7 @@ sub LoadIncludeFiles use "global\system\includes\gvariabl.inc" use "global\tools\includes\optional\t_treelist_tools.inc" + use "global\tools\includes\optional\t_macro_tools.inc" gApplication = "WRITER" call GetUseFiles() diff --git a/testautomation/framework/optional/includes/basic_gridcontrol.inc b/testautomation/framework/optional/includes/basic_gridcontrol.inc index 54bc9a0e1ae8..963c5e8a97d8 100644 --- a/testautomation/framework/optional/includes/basic_gridcontrol.inc +++ b/testautomation/framework/optional/includes/basic_gridcontrol.inc @@ -33,69 +33,59 @@ testcase tGridcontrolLoad - const MACRO_NAME = "VclTestTool" - const MACRO_NOT_FOUND = 0 + const MACRO_NAME = "Show" const FILE_NAME = "framework/optional/input/gridcontrol.odt" - dim iPos as integer + dim i as integer + dim a as integer printlog( "Open the test document: " & FILE_NAME ) call hFileOpenLocally( gTestToolPath & FILE_NAME ) - printlog( "Open the <Run Macro> dialog" ) - ToolsMacrosRunMacro - - printlog( "Find the document, its library and the test macro, run the macro" ) - Kontext "ScriptSelector" - if ( ScriptSelector.exists( 10 ) ) then + printlog "Start the macro, that performs the test" + hExecMacro( MACRO_NAME ) + + Kontext "GridControlDialog" + if GridControlDialog.exists(5) then + for i=1 to gridcontrolcontrol.getcolumncount + for a=1 to gridcontrolcontrol.getrowcount + printlog " " + i + ":"+a+": '" + gridcontrolcontrol.getitemtype (i,a) + "' '" + gridcontrolcontrol.getitemtext (i,a) + "'" + next a + next i + gridcontrolcontrol.select 5 + + kontext + if active.exists(5) then + printlog active.gettext + active.ok + else + warnlog "No selection Event by .select" + endif - printlog "Start the macro, that performs the test" - Kontext "GridControlDialogStarter" - ' FAILS IF DOCUMENT IS READONLY.... - ShowGridcontrol.typeKeys "<space>" Kontext "GridControlDialog" - if GridControlDialog.exists(5) then - for i=1 to gridcontrolcontrol.getcolumncount - for a=1 to gridcontrolcontrol.getrowcount - printlog " " + i + ":"+a+": '" + gridcontrolcontrol.getitemtype (i,a) + "' '" + gridcontrolcontrol.getitemtext (i,a) + "'" - next a - next i - gridcontrolcontrol.select 5 - - kontext - if active.exists(5) then - printlog active.gettext - active.ok - else - warnlog "No selection Event by .select" - endif - - Kontext "GridControlDialog" - gridcontrolcontrol.typeKeys("<down>") + gridcontrolcontrol.typeKeys("<down>") - kontext - if active.exists(5) then - printlog active.gettext - active.ok - else - warnlog "No selection event by .typeKeys <down>" - endif - Kontext "GridControlDialog" - gridcontrolcontrol.typeKeys("<up>") - kontext - if active.exists(5) then - printlog active.gettext - active.ok - else - warnlog "No selection event by .typeKeys <up>" - endif - - Kontext "GridControlDialog" - GridControlDialog.close + kontext + if active.exists(5) then + printlog active.gettext + active.ok else - warnlog "Gridcontrol Dialog did not come up after pressing button" + warnlog "No selection event by .typeKeys <down>" + endif + Kontext "GridControlDialog" + gridcontrolcontrol.typeKeys("<up>") + kontext + if active.exists(5) then + printlog active.gettext + active.ok + else + warnlog "No selection event by .typeKeys <up>" endif + Kontext "GridControlDialog" + GridControlDialog.close + else + warnlog "Gridcontrol Dialog did not come up after pressing button" endif printlog( "Test exit, cleanup" ) diff --git a/testautomation/global/tools/includes/optional/t_macro_tools.inc b/testautomation/global/tools/includes/optional/t_macro_tools.inc index 6c1fcc478e5a..733b28fa32f4 100755..100644 --- a/testautomation/global/tools/includes/optional/t_macro_tools.inc +++ b/testautomation/global/tools/includes/optional/t_macro_tools.inc @@ -172,4 +172,44 @@ function hBasicIDERunMacro( cIdentifier as string ) as boolean hBasicIDERunMacro() = false endif +end function + +'******************************************************************************* + +function hExecMacro( cMacro as string ) as boolean + + const CFN = "global::tools::includes::optional::t_macro_tools.inc::hExecMacro(): " + + dim iCurrentModule as integer + dim iCurrentMacro as integer + hEXECMacro() = FALSE + + ToolsMacro_uno + + kontext "Makro" + if ( Makro.exists( 2 ) ) then + ' Iterate through the left treelist + for iCurrentModule = hExpandAllNodes( MakroAus ) to 1 step -1 + MakroAus.select( iCurrentModule ) + ' Iterate through the Macros list (right pane) + for iCurrentMacro = 1 to MakroListe.getItemCount() + MakroListe.select( iCurrentMacro ) + ' Try to find the macro + if ( cMacro = MakroListe.getSelText() ) then + ' Run the macro + if ( Ausfuehren.isEnabled() ) then + Ausfuehren.click() + hExecMacro() = TRUE + exit function + else + warnlog( CFN & "Macro found but <Ausfuehren> is not enabled" ) + exit function + endif + endif + next iCurrentMacro + next iCurrentModule + else + warnlog( CFN & "Macro Organizer is not open within 2 seconds" ) + endif + end function
\ No newline at end of file |