diff options
Diffstat (limited to 'testautomation/framework')
8 files changed, 255 insertions, 60 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 diff --git a/testautomation/framework/required/includes/basic_dialog_export.inc b/testautomation/framework/required/includes/basic_dialog_export.inc index 251efa7ac02a..5999decd2783 100755 --- a/testautomation/framework/required/includes/basic_dialog_export.inc +++ b/testautomation/framework/required/includes/basic_dialog_export.inc @@ -66,7 +66,7 @@ testcase tUpdtDialogExport hDestroyDocument() goto endsub endif - + sleep(1) printlog( "Click the Export button on the DialogBar" ) kontext "DialogBar" Export.click() diff --git a/testautomation/framework/required/includes/basic_dialog_i18n.inc b/testautomation/framework/required/includes/basic_dialog_i18n.inc index 4947b72fa37b..5ac437ea1795 100755 --- a/testautomation/framework/required/includes/basic_dialog_i18n.inc +++ b/testautomation/framework/required/includes/basic_dialog_i18n.inc @@ -54,6 +54,7 @@ testcase tUpdtBasicDialogI18n printlog( "Click Manage Languages on ToolsCollectionBar") kontext "ToolsCollectionBar" + sleep(1) if ( ToolsCollectionBar.exists() ) then ManageLanguage.click() else @@ -106,7 +107,7 @@ testcase tUpdtBasicDialogI18n printlog( "Back on Manage UI Languages Dialog, delete selected language") kontext "ManageUILanguages" Delete.click() - + sleep(1) printlog( "Confirm delete") kontext "active" if ( Active.exists( 1 ) ) then diff --git a/testautomation/framework/required/includes/basic_dialog_i18n_import.inc b/testautomation/framework/required/includes/basic_dialog_i18n_import.inc index 8c26ab0d6bed..eaba271319be 100755 --- a/testautomation/framework/required/includes/basic_dialog_i18n_import.inc +++ b/testautomation/framework/required/includes/basic_dialog_i18n_import.inc @@ -39,12 +39,15 @@ testcase tBasicDialogI18nImport - printlog( "Dialogs that show up when importing Multi locale dialogs into BASIC IDE" ) + printlog( "Dialogs that show up when importing multi locale dialogs into BASIC IDE" ) dim cDialogPath as string cDialogPath = gTesttoolPath & "framework\required\input\basic_ide\Dialog5.xdl" cDialogPath = convertpath( cDialogPath ) + dim iNumberOfLanguages as integer + dim iTry as integer + const LANGUAGE_COUNT = 5 printlog( "Open BASIC-IDE" ) @@ -82,15 +85,23 @@ testcase tBasicDialogI18nImport printlog( "Accept with yes" ) Active.Yes() - + sleep(1) Kontext "TranslationBar" if ( TranslationBar.exists() ) then + + for iTry = 1 to 5 + iNumberOfLanguages = CurrentLanguage.getItemCount() + if ( iNumberOfLanguages = LANGUAGE_COUNT ) then + exit for + endif + wait( 100 ) + next iTry printlog( "Check number of imported languages" ) - if ( CurrentLanguage.getItemCount() <> LANGUAGE_COUNT ) then + if ( iNumberOfLanguages <> LANGUAGE_COUNT ) then warnlog( "Incorrect language count in listbox <CurrentLanguage>" ) printlog( "Expected: " & LANGUAGE_COUNT ) - printlog( "Found...: " & CurrentLanguage.getItemCount() ) + printlog( "Found...: " & iNumberOfLanguages ) endif Kontext "DialogBar" |