From a566b1dc6fb25201af4d36b86ff6c4cbd9dd36a6 Mon Sep 17 00:00:00 2001 From: "Joerg Skottke [jsk]" Date: Mon, 18 Oct 2010 12:26:30 +0200 Subject: automationdev300m87: #i115106 - Fix f_basic_gridcontrol.bas --- .../framework/optional/f_basic_gridcontrol.bas | 1 + .../optional/includes/basic_gridcontrol.inc | 92 ++++++++++------------ 2 files changed, 42 insertions(+), 51 deletions(-) mode change 100755 => 100644 testautomation/framework/optional/f_basic_gridcontrol.bas (limited to 'testautomation/framework') diff --git a/testautomation/framework/optional/f_basic_gridcontrol.bas b/testautomation/framework/optional/f_basic_gridcontrol.bas old mode 100755 new mode 100644 index 963482253438..dc5f9a392988 --- 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 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 "" 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("") + gridcontrolcontrol.typeKeys("") - kontext - if active.exists(5) then - printlog active.gettext - active.ok - else - warnlog "No selection event by .typeKeys " - endif - Kontext "GridControlDialog" - gridcontrolcontrol.typeKeys("") - kontext - if active.exists(5) then - printlog active.gettext - active.ok - else - warnlog "No selection event by .typeKeys " - 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 " + endif + Kontext "GridControlDialog" + gridcontrolcontrol.typeKeys("") + kontext + if active.exists(5) then + printlog active.gettext + active.ok + else + warnlog "No selection event by .typeKeys " endif + Kontext "GridControlDialog" + GridControlDialog.close + else + warnlog "Gridcontrol Dialog did not come up after pressing button" endif printlog( "Test exit, cleanup" ) -- cgit