diff options
Diffstat (limited to 'testautomation/framework/optional/includes/basic_ide.inc')
-rwxr-xr-x[-rw-r--r--] | testautomation/framework/optional/includes/basic_ide.inc | 430 |
1 files changed, 203 insertions, 227 deletions
diff --git a/testautomation/framework/optional/includes/basic_ide.inc b/testautomation/framework/optional/includes/basic_ide.inc index 799260201257..c8db670e8cc3 100644..100755 --- a/testautomation/framework/optional/includes/basic_ide.inc +++ b/testautomation/framework/optional/includes/basic_ide.inc @@ -33,116 +33,129 @@ testcase tBasic_IDE_Toolbar_Module - qaerrorlog( "Replace this test asap, the approach is unusable" ) + printlog( "BASIC toolbars for modules" ) + + const DIALOG_DELAY = 2 + const RC_FAILURE = -1 + + dim cTargetFile as string + cTargetFile = convertpath( gOfficepath & "user\work\global_test.bas" ) - dim brc as boolean dim cSourceFile as string cSourceFile = gTesttoolpath & "framework\optional\input\resetregistration.txt" cSourceFile = convertpath( cSourceFile ) - - - printlog "open a new writer-doc" gApplication = "WRITER" hCreateDocument() - brc = hOpenBasicOrganizerFromDoc() - brc = hCreateModuleForDoc() - + if ( hInitBasicIDE( "tBasic_IDE_Toolbar_Module" ) ) then - kontext "macrobar" - printlog "- compile" - hClickToolbarButton( Compile ) - - printlog "- Run Basic" - hClickToolbarButton( BasicRun ) - - printlog "- Step Procedure" - hClickToolbarButton( ProcedureStep ) - - printlog "- Stop Basic" - hClickToolbarButton( BasicStop ) + kontext "macrobar" + printlog "- compile" + hClickButton( Compile ) - printlog "- Single Step" - hClickToolbarButton( SingleStep ) + printlog "- Run Basic" + hClickButton( BasicRun ) - printlog "- Step Back" - hClickToolbarButton( StepBack ) + printlog "- Step Procedure" + hClickButton( ProcedureStep ) - printlog "- Breakpoint => activate" - hClickToolbarButton( Breakpoint ) + printlog "- Stop Basic" + hClickButton( BasicStop ) + printlog "- Single Step" + hClickButton( SingleStep ) - printlog "- Breakpoint => deactivate" - hClickToolbarButton( Breakpoint ) + printlog "- Step Back" + hClickButton( StepBack ) - printlog "- Add Watch => deactivate" - hClickToolbarButton( AddWatch ) + printlog "- Breakpoint => activate" + hClickButton( Breakpoint ) - printlog "- Find Paranthese" - kontext "macrobar" - hClickToolbarButton( FindParanthese ) + printlog "- Breakpoint => deactivate" + hClickButton( Breakpoint ) - try - Controls.TearOff() - warnlog "Controls are active in a module window => bug!" - catch - printlog( "Controls are not active->OK" ) - endcatch - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif + printlog "- Add Watch => deactivate" + hClickButton( AddWatch ) - printlog( "- Insert Source Text (" & cSourceFile & ")" ) + printlog "- Find Paranthese" + kontext "macrobar" + hClickButton( FindParanthese ) - InsertSourceText.Click() - kontext "oeffnendlg" - if ( OeffnenDlg.exists( 1 ) ) then - Dateiname.SetText( cSourceFile ) - Oeffnen.click() - else - warnlog( "File Open dialog did not open" ) - endif - - ' possible 'could not read from file' error-message -> this is a bug - kontext "Active" - if ( Active.exists( 1 ) ) then - warnlog( "Unexpected active: " & active.gettext() ) - active.ok() - endif + try + Controls.TearOff() + warnlog "Controls are active in a module window => bug!" + catch + printlog( "Controls are not active->OK" ) + endcatch + if ( WaitSlot <> WSFinished ) then + warnlog( "Slot not finished within 1 second" ) + endif - kontext "macrobar" - printlog "- Save Source Test " + kontext "MacroBar" + printlog( "- Insert Source Text (" & cSourceFile & ")" ) + if ( hClickButton( InsertSourceText ) <> RC_FAILURE ) then + + kontext "oeffnendlg" + if ( OeffnenDlg.exists( DIALOG_DELAY ) ) then + Dateiname.SetText( cSourceFile ) + Oeffnen.click() + WaitSlot( 5000 ) + else + warnlog( "File Open dialog did not open" ) + endif + + ' possible 'could not read from file' error-message -> this is a bug + kontext "Active" + if ( Active.exists( DIALOG_DELAY ) ) then + warnlog( "Unexpected active: " & active.gettext() ) + active.ok() + endif + else + warnlog( "<File Open> dialog is not open, <Insert Source Text> button failed" ) + endif - hClickToolbarButton( SaveSourceTest ) + kontext "macrobar" + printlog "- Save Source Text " + if ( hClickButton( SaveSourceText ) <> RC_FAILURE ) then + + kontext "speicherndlg" + if ( SpeichernDlg.exists( DIALOG_DELAY ) ) then + Dateiname.SetText( cTargetFile ) + Speichern.click() + else + warnlog( "File Save dialog is missing" ) + endif + + kontext "active" + if ( Active.Exists( DIALOG_DELAY ) ) then + printlog( "Closing Messagebox with <Yes>") + Active.Yes() + endif + else + warnlog( "<File Save> dialog did not open, slot <SaveSourceText> did not work" ) + endif - kontext "speicherndlg" - if ( SpeichernDlg.exists( 1 ) ) then - Dateiname.SetText ConvertPath (gOfficepath + "user\work\global_test.bas") - Speichern.click() + hFileCloseAll() else - warnlog( "File Save dialog is missing" ) - endif - - kontext "active" - if ( Active.Exists( 1 ) ) then - printlog( "Closing Messagebox with <Yes>") - Active.Yes() + warnlog( "Unable to init BASIC IDE" ) endif - hDestroyDocument() ' for Basic-IDE - hDestroyDocument() ' the new writer-doc - endcase '******************************************************************************* testcase tBasic_IDE_Toolbar_Dialogs - qaerrorlog( "Replace this test asap, the approach is unusable" ) + printlog( "BASIC toolbar for Dialogs" ) + + const DIALOG_DELAY = 2 + + const TABBAR_MENU_NEW = 1 + const TABBAR_MENU_NEW_DIALOG = 2 dim bIsOpen as boolean dim brc as boolean @@ -159,177 +172,140 @@ testcase tBasic_IDE_Toolbar_Dialogs gApplication = "WRITER" hCreateDocument() - printlog "create a new module " - brc = hOpenBasicOrganizerFromDoc() - brc = hCreateModuleForDoc() + if ( hInitBasicIDE( "tBasic_IDE_Toolbar_Dialogs" ) ) then - kontext "basicide" - Tabbar.OpenContextMenu - hMenuSelectNr ( 1 ) - hMenuSelectNr ( 2 ) - if ( DialogWindow.Exists ( 2 ) ) then - printlog( "Dialog Editor window is open. Good." ) - else - warnlog "No dialog window is shown!" - end if - - try - kontext "MacroBar" - Compile.Click() - warnlog( """Compile"" is enabled" ) - catch - printlog( """Compile"" is disabled" ) - endcatch - - try - kontext "MacroBar" - BasicRun.Click() - warnlog( """Run Basic"" is enabled" ) - catch - printlog( """Run Basic"" is disabled" ) - endcatch - - printlog "- Step Procedure (disabled)" - try - kontext "MacroBar" - ProcedureStep.Click() - warnlog( """Step Procedure"" is enabled" ) - catch - printlog( """Step Procedure"" is disabled" ) - endcatch + kontext "basicide" + Tabbar.OpenContextMenu + hMenuSelectNr ( TABBAR_MENU_NEW ) + hMenuSelectNr ( TABBAR_MENU_NEW_DIALOG ) - try - kontext "MacroBar" - BasicStop.Click() - warnlog( """Stop Basic"" is enabled" ) - catch - printlog( """Stop Basic"" is disabled" ) - endcatch - - try - kontext "MacroBar" - SingleStep.Click() - warnlog( """Single Step"" is enabled" ) - catch - printlog( """Single Step"" is enabled" ) - endcatch - - try - kontext "MacroBar" - StepBack.Click() - warnlog( """Single Step Back"" is enabled" ) - catch - printlog( """Single Step Back"" is enabled" ) - endcatch - - try - kontext "MacroBar" - Breakpoint.Click() - warnlog( """Breakpoint"" is enabled" ) - catch - printlog( """Breakpoint"" is disabled" ) - endcatch - - - try - kontext "MacroBar" - AddWatch.Click() - warnlog( """Add Watch"" is enabled" ) - catch - printlog( """Add Watch"" is disabled" ) - endcatch + if ( DialogWindow.Exists ( DIALOG_DELAY ) ) then + printlog( "Dialog Editor window is open. Good." ) + else + warnlog "No dialog window is shown!" + end if + try + kontext "MacroBar" + Compile.Click() + warnlog( """Compile"" is enabled" ) + catch + printlog( """Compile"" is disabled" ) + endcatch - try - kontext "MacroBar" - FindParanthese.Click() - warnlog( """Find Paranthese"" is enabled" ) - catch - printlog( """Find Paranthese"" is disabled" ) - endcatch + try + kontext "MacroBar" + BasicRun.Click() + warnlog( """Run Basic"" is enabled" ) + catch + printlog( """Run Basic"" is disabled" ) + endcatch + printlog "- Step Procedure (disabled)" + try + kontext "MacroBar" + ProcedureStep.Click() + warnlog( """Step Procedure"" is enabled" ) + catch + printlog( """Step Procedure"" is disabled" ) + endcatch - try - kontext "macrobar" - InsertSourceText.Click() - warnlog( """Insert Source Text"" is enabled" ) + try + kontext "MacroBar" + BasicStop.Click() + warnlog( """Stop Basic"" is enabled" ) + catch + printlog( """Stop Basic"" is disabled" ) + endcatch - kontext "oeffnendlg" - if ( OeffnenDlg.exists( 2 ) ) then - Dateiname.SetText( sBasFile1 ) - Oeffnen.Click() - else - warnlog( "File Open dialog missing" ) - endif - catch - printlog( """Insert Source Text"" is disabled" ) - endcatch + try + kontext "MacroBar" + SingleStep.Click() + warnlog( """Single Step"" is enabled" ) + catch + printlog( """Single Step"" is enabled" ) + endcatch - - printlog "- Save Source Test (disabled)" + try + kontext "MacroBar" + StepBack.Click() + warnlog( """Single Step Back"" is enabled" ) + catch + printlog( """Single Step Back"" is enabled" ) + endcatch - try - kontext "macrobar" - SaveSourceTest.Click() - warnlog( """Save Source Text"" is enabled" ) + try + kontext "MacroBar" + Breakpoint.Click() + warnlog( """Breakpoint"" is enabled" ) + catch + printlog( """Breakpoint"" is disabled" ) + endcatch - kontext "speicherndlg" - if ( SpeichernDlg.exists( 2 ) ) then - Dateiname.SetText( sBasFile2 ) - Speichern.Click() - else - warnlog( "File Save dialog is missing" ) - endif - kontext "active" - if ( Active.Exists( 1 ) ) then - Active.Yes() - endif - catch - printlog( """Save Source Text"" is disabled" ) - endcatch + try + kontext "MacroBar" + AddWatch.Click() + warnlog( """Add Watch"" is enabled" ) + catch + printlog( """Add Watch"" is disabled" ) + endcatch - - bIsOpen = hShowMacroControls() - if ( bIsOpen ) then - ToolsCollectionBar.Close() - end if - Call hDestroyDocument() ' for Basic-IDE - Call hDestroyDocument() ' the new writer-doc + try + kontext "MacroBar" + FindParanthese.Click() + warnlog( """Find Paranthese"" is enabled" ) + catch + printlog( """Find Paranthese"" is disabled" ) + endcatch -endcase -'******************************************************************************' + try + kontext "macrobar" + InsertSourceText.Click() + warnlog( """Insert Source Text"" is enabled" ) + + kontext "oeffnendlg" + if ( OeffnenDlg.exists( DIALOG_DELAY ) ) then + Dateiname.SetText( sBasFile1 ) + Oeffnen.Click() + else + warnlog( "File Open dialog missing" ) + endif + catch + printlog( """Insert Source Text"" is disabled" ) + endcatch -function hClickToolbarButton( oButton as object ) as boolean - const CFN = "hClickToolbarButton(): " + printlog "- Save Source Test (disabled)" - dim iTry as integer - dim brc as boolean : brc = false - - printlog( CFN & "Clicking button on toolbar: " & oButton.name() ) - for iTry = 1 to 5 - try - oButton.click() - brc = true - exit for + kontext "macrobar" + SaveSourceText.Click() + warnlog( """Save Source Text"" is enabled" ) + + kontext "speicherndlg" + if ( SpeichernDlg.exists( DIALOG_DELAY ) ) then + Dateiname.SetText( sBasFile2 ) + Speichern.Click() + else + warnlog( "File Save dialog is missing" ) + endif + + kontext "active" + if ( Active.Exists( DIALOG_DELAY ) ) then + Active.Yes() + endif catch - printlog( CFN & "Retrying..." ) + printlog( """Save Source Text"" is disabled" ) endcatch - - if ( iTry = 5 ) then - exit for - endif - - wait( 500 ) - - next iTry - - if ( WaitSlot( 2000 ) <> WSFinished ) then - warnlog( CFN & "Slot not finished within 1 second" ) + + hCloseBasicIDE() + hDestroyDocument() + else + warnlog( "Unable to open BASIC IDE" ) endif -end function +endcase + |