diff options
Diffstat (limited to 'testautomation/framework/optional')
-rwxr-xr-x | testautomation/framework/optional/f_basic_gridcontrol.bas | 55 | ||||
-rwxr-xr-x | testautomation/framework/optional/includes/basic_eventbinding.inc | 2 | ||||
-rwxr-xr-x | testautomation/framework/optional/includes/basic_gridcontrol.inc | 137 | ||||
-rwxr-xr-x | testautomation/framework/optional/includes/basic_ide.inc | 97 | ||||
-rwxr-xr-x | testautomation/framework/optional/input/gridcontrol.odt | bin | 0 -> 11602 bytes |
5 files changed, 237 insertions, 54 deletions
diff --git a/testautomation/framework/optional/f_basic_gridcontrol.bas b/testautomation/framework/optional/f_basic_gridcontrol.bas new file mode 100755 index 000000000000..06b9a40f7788 --- /dev/null +++ b/testautomation/framework/optional/f_basic_gridcontrol.bas @@ -0,0 +1,55 @@ +'encoding UTF-8 Do not remove or change this line! +'******************************************************************************* +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: gridcontrol.bas,v $ +'* +'* $Revision: 1.3 $ +'* +'* last change: $Author: jsk $ $Date: 2008/06/20 08:07:03 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : test availablity of gridcontrol +'* +'\****************************************************************************** + +sub main + use "framework\optional\includes\basic_gridcontrol.inc" + call hStatusIn ("framework", "f_basic_gridcontrol.bas") + printlog "Load Document with gridcontrol" + call tGridcontrolLoad + hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT ) + call hStatusOut +end sub + +sub LoadIncludeFiles + use "global\system\includes\master.inc" + use "global\system\includes\gvariabl.inc" + gApplication = "WRITER" + call GetUseFiles() +end sub + diff --git a/testautomation/framework/optional/includes/basic_eventbinding.inc b/testautomation/framework/optional/includes/basic_eventbinding.inc index 165b1e9eda00..634021806a8e 100755 --- a/testautomation/framework/optional/includes/basic_eventbinding.inc +++ b/testautomation/framework/optional/includes/basic_eventbinding.inc @@ -231,7 +231,7 @@ testcase tAssignComponentFunction for i = 1 to x sTemp = LibraryTreeList.getItemText(i) 'printlog "("+i+"/"+x+"): '" + sTemp + "'" - if (("DialogComponent.odt"=sTemp) OR ("DIALOGCOMPONENT.ODT"=sTemp)) then + if (instr(stemp,"DialogComponent.odt") OR instr(stemp,"DIALOGCOMPONENT.ODT")) then a = i printlog "Found library ("+i+"/"+x+"): '" + sTemp + "'" endif diff --git a/testautomation/framework/optional/includes/basic_gridcontrol.inc b/testautomation/framework/optional/includes/basic_gridcontrol.inc new file mode 100755 index 000000000000..cf71748873bd --- /dev/null +++ b/testautomation/framework/optional/includes/basic_gridcontrol.inc @@ -0,0 +1,137 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: gridcontrol.inc,v $ +'* +'* $Revision: 1.2 $ +'* +'* last change: $Author: rt $ $Date: 2008/07/10 15:39:30 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : gridcontrol +'* +'\****************************************************************************** + +testcase tGridcontrolLoad + dim sLocation as string + dim i,x,a as integer + dim sTemp as string + dim lFiles(200) as string + dim bTemp as boolean + dim iError, iOK as integer + + sLocation = "framework/optional/include/basic_gridcontrol.inc::" + + hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_LOW ) + + printlog "Open the test document" + call hFileOpen(convertPath(gTestToolPath + "framework/optional/input/gridcontrol.odt")) + printlog "Security dialog might come up" + kontext "SecurityWarning" + if SecurityWarning.exists(5) then + printlog "Allow to run macros" + SecurityWarning.ok + endif + call sleep 1 + + printlog "Start the macro, that performs the test" + printlog "Tools->Macros->Run Macro..." + ToolsMacrosRunMacro + Kontext "ScriptSelector" + if ScriptSelector.exists(10) then + x = LibraryTreeList.getItemCount + printlog "Look for library 'gridcontrol'" + for i = 1 to x + sTemp = LibraryTreeList.getItemText(i) + 'printlog "("+i+"/"+x+"): '" + sTemp + "'" + if (instr(sTemp,"gridcontrol")>0 OR instr(sTemp,"GRIDCONTROL")) then + a = i + printlog "Found library ("+i+"/"+x+"): '" + sTemp + "'" + endif + next i + if 0 <> a then + printlog "Select the library and unfold it" + LibraryTreeList.select(a) + LibraryTreeList.typeKeys("+") + printlog "Go to 'Standard' and unfold" + LibraryTreeList.typeKeys("<down>") + LibraryTreeList.typeKeys("+") + printlog "Go to 'Module1'" + LibraryTreeList.typeKeys("<down>") + + printlog "Select macro name 'VclTestTool'" + x = ScriptList.getItemCount + for i = 1 to x + sTemp = ScriptList.getItemText(i) + 'printlog "("+i+"/"+x+"): '" + sTemp + "'" + if "VclTestTool" = sTemp then + a = i + printlog "Found macro ("+i+"/"+x+"): '" + sTemp + "'" + endif + next i + if (0 <> a) then + printlog "Select the macro" + ScriptList.select(a) + printlog "Start the macro by pressing the button 'run'" + ScriptSelector.ok + printlog "sleep... at least 60 seconds" + call sleep(60) + printlog "If macro fails for whatever reason, a message comes up" + Kontext + if active.exists() then + warnlog "" + active.getText + active.ok + try + EditCopy + warnlog getclipboard() + catch + endcatch + printlog "close basic ide" + call hCloseDocument() + printlog "close document" + call hCloseDocument() + goto endsub + endif + + else + warnlog sLocation + "Macro not found: 'Main'" + endif + else + warnlog sLocation + "Library not found: 'gridcontrol'" + endif + else + warnlog sLocation + "'Run macro dialog' didn't came up" + endif + + printlog "clean up" + printlog "Close the document, else an error about the navigator will be thrown" + if getDocumentcount > 0 then + call hCloseDocument() + endif +endcase + diff --git a/testautomation/framework/optional/includes/basic_ide.inc b/testautomation/framework/optional/includes/basic_ide.inc index c60bf35f00a7..a5802e6da9d4 100755 --- a/testautomation/framework/optional/includes/basic_ide.inc +++ b/testautomation/framework/optional/includes/basic_ide.inc @@ -59,75 +59,37 @@ testcase tBasic_IDE_Toolbar_Module kontext "macrobar" printlog "- compile" - Compile.Click - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif + hClickToolbarButton( Compile ) printlog "- Run Basic" - BasicRun.Click - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif - + hClickToolbarButton( BasicRun ) printlog "- Step Procedure" - ProcedureStep.Click - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif - + hClickToolbarButton( ProcedureStep ) printlog "- Stop Basic" - BasicStop.Click - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif - + hClickToolbarButton( BasicStop ) printlog "- Single Step" - SingleStep.Click - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif - + hClickToolbarButton( SingleStep ) printlog "- Step Back" - StepBack.Click() - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif - + hClickToolbarButton( StepBack ) printlog "- Breakpoint => activate" - Breakpoint.Click - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif + hClickToolbarButton( Breakpoint ) printlog "- Breakpoint => deactivate" - Breakpoint.Click - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif - + hClickToolbarButton( Breakpoint ) printlog "- Add Watch => deactivate" - AddWatch.Click - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif - + hClickToolbarButton( AddWatch ) printlog "- Find Paranthese" kontext "macrobar" - FindParanthese.Click() - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif - + hClickToolbarButton( FindParanthese ) try Controls.TearOff() @@ -161,11 +123,7 @@ testcase tBasic_IDE_Toolbar_Module kontext "macrobar" printlog "- Save Source Test " - SaveSourceTest.Click - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif - + hClickToolbarButton( SaveSourceTest ) kontext "speicherndlg" if ( SpeichernDlg.exists( 1 ) ) then @@ -177,6 +135,7 @@ testcase tBasic_IDE_Toolbar_Module kontext "active" if ( Active.Exists( 1 ) ) then + printlog( "Closing Messagebox with <Yes>") Active.Yes() endif @@ -347,4 +306,36 @@ testcase tBasic_IDE_Toolbar_Dialogs endcase +'******************************************************************************' + +function hClickToolbarButton( oButton as object ) as boolean + + const CFN = "hClickToolbarButton(): " + + 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 + catch + printlog( CFN & "Retrying..." ) + 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" ) + endif +end function diff --git a/testautomation/framework/optional/input/gridcontrol.odt b/testautomation/framework/optional/input/gridcontrol.odt Binary files differnew file mode 100755 index 000000000000..b3e5c6fb40bb --- /dev/null +++ b/testautomation/framework/optional/input/gridcontrol.odt |