diff options
author | Andrew Rist <arist@apache.org> | 2012-01-13 23:57:08 +0000 |
---|---|---|
committer | Andrew Rist <arist@apache.org> | 2012-01-13 23:57:08 +0000 |
commit | 6c9c473005be1f412ad1f845a36df62f1dd0454b (patch) | |
tree | a4daff8c5ac92dab1d99896b499393d1354befb1 /testautomation | |
parent | 7c969ea7d337ffce798d37f9e05a7a9b930feed0 (diff) |
revert and fix header updates in .inc files
Diffstat (limited to 'testautomation')
102 files changed, 6447 insertions, 538 deletions
diff --git a/testautomation/chart2/optional/includes/loadsave/ch2_losa.inc b/testautomation/chart2/optional/includes/loadsave/ch2_losa.inc index 432583dba316..295ebe9d47ac 100644 --- a/testautomation/chart2/optional/includes/loadsave/ch2_losa.inc +++ b/testautomation/chart2/optional/includes/loadsave/ch2_losa.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,45 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Load file of one Spreadsheet format and save to another +'* +'\****************************************************************************** + +sub subLoSaFromTo + + dim sSourcePath as string + dim lsInputFileList ( 500 ) as string + dim iFilesInList as integer + dim sCurrentFileInList as string + dim iMainIndex as integer + + dim cRelativePath as string + cRelativePath = "chart2\optional\input\" & gsDirectoryInSourcePath &"\" + + '///<u><b>Load/Save files with charts</b></u> + printLog Chr(13) + "--------- Save with filter: " & gsFileFormat & " ----------" + sSourcePath = convertPath ( gtesttoolpath & cRelativePath ) -***** + '///+<ul><li>Determine list of files to test (All files in 'chart2\loadsave\input\<gsDirectoryInSourcePath>\')</li> + GetAllFileList( sSourcePath , "*." & gsDirectoryInSourcePath , lsInputFileList() ) + iFilesInList = ListCount( lsInputFileList() ) + '///+<li>Run testcase 'tLoadSaveFromTo' for each file in list</li></ul> + for iMainIndex = 2 to iFilesInList + + sCurrentFileInList = lsInputFileList( iMainIndex ) + printlog "* * * * * * *" + printlog "Loop " & ( iMainIndex - 1 ) & " of " & ( iFilesInList - 1 ) + printlog "Test document: " & sCurrentFileInList + call tLoadSaveFromTo ( sCurrentFileInList ) + + next iMainIndex + +end sub + +'******************************************************************************* function hLoSaEscape() as boolean diff --git a/testautomation/chart2/required/includes/ch2_menu.inc b/testautomation/chart2/required/includes/ch2_menu.inc index 678e1b3d617f..4bb8427bbf5d 100644 --- a/testautomation/chart2/required/includes/ch2_menu.inc +++ b/testautomation/chart2/required/includes/ch2_menu.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************************ +' +'************************************************************** +'* +'* short description : Resource Test for chart2 main menus +'* +'************************************************************************************************** '* ' #1 tMainMenu 'Checking the count of menu entries in each menu '* diff --git a/testautomation/chart2/tools/ch_tools_axes.inc b/testautomation/chart2/tools/ch_tools_axes.inc index d7c7175c38ff..b65773d50fb5 100644 --- a/testautomation/chart2/tools/ch_tools_axes.inc +++ b/testautomation/chart2/tools/ch_tools_axes.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************************ +' +'************************************************************** +'* +'* short description : Library for automation of the 'Insert::Axes...' dialog +'* +'************************************************************************************************** '* ' #1 fInvokeAxesDialog ' #1 fCloseAxesDialogOK diff --git a/testautomation/chart2/tools/ch_tools_chart_type.inc b/testautomation/chart2/tools/ch_tools_chart_type.inc index 793eefcfbbec..e972d627930b 100644 --- a/testautomation/chart2/tools/ch_tools_chart_type.inc +++ b/testautomation/chart2/tools/ch_tools_chart_type.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************************ +' +'************************************************************** +'* +'* short description : Tool library for chart type dialog +'* +'************************************************************************************************** '* ' #1 fInvokeChartTypeDialog ' #1 fCloseChartTypeDialogOK diff --git a/testautomation/chart2/tools/ch_tools_data_labels.inc b/testautomation/chart2/tools/ch_tools_data_labels.inc index 89784f198675..f96dacab8f7d 100644 --- a/testautomation/chart2/tools/ch_tools_data_labels.inc +++ b/testautomation/chart2/tools/ch_tools_data_labels.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************************ +' +'************************************************************** +'* +'* short description : Tool library for Data Labels dialog +'* +'************************************************************************************************** '* ' #1 fInvokeDataLabelsDialog ' #1 fCloseDataLabelsDialogOK diff --git a/testautomation/chart2/tools/ch_tools_grids.inc b/testautomation/chart2/tools/ch_tools_grids.inc index a1e28ef1fd6d..9da3a5430384 100644 --- a/testautomation/chart2/tools/ch_tools_grids.inc +++ b/testautomation/chart2/tools/ch_tools_grids.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************************ +' +'************************************************************** +'* +'* short description : Tool library for Grids dialog +'* +'************************************************************************************************** '* ' #1 fInvokeGridsDialog ' #1 fCloseGridsDialogOK diff --git a/testautomation/chart2/tools/ch_tools_legend.inc b/testautomation/chart2/tools/ch_tools_legend.inc index 5c666d8df0d8..a4f1307a8a43 100644 --- a/testautomation/chart2/tools/ch_tools_legend.inc +++ b/testautomation/chart2/tools/ch_tools_legend.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************************ +' +'************************************************************** +'* +'* short description : Tool library for Legend dialog +'* +'************************************************************************************************** '* ' #1 fInvokeLegendDialog ' #1 fCloseLegendDialogOK diff --git a/testautomation/chart2/tools/ch_tools_select.inc b/testautomation/chart2/tools/ch_tools_select.inc index 358e557f475c..c534e660896a 100644 --- a/testautomation/chart2/tools/ch_tools_select.inc +++ b/testautomation/chart2/tools/ch_tools_select.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************************ +' +'************************************************************** +'* +'* short description : selecting charts +'* +'************************************************************************************************** '* ' #1 fSelectChartByNumber ' #1 fCalcSelectSheet diff --git a/testautomation/chart2/tools/ch_tools_statistics.inc b/testautomation/chart2/tools/ch_tools_statistics.inc index c84c50d32eb1..6849b1f6ccb6 100644 --- a/testautomation/chart2/tools/ch_tools_statistics.inc +++ b/testautomation/chart2/tools/ch_tools_statistics.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************************ +' +'************************************************************** +'* +'* short description : Tool library for Statistics dialog +'* +'************************************************************************************************** '* ' #1 fInvokeTrendlinesDialog ' #1 fInvokeInsertYErrorBarsDialog diff --git a/testautomation/chart2/tools/ch_tools_tab_borders_lines.inc b/testautomation/chart2/tools/ch_tools_tab_borders_lines.inc index 91cd1a0e769c..e9fcfa2d3a13 100644 --- a/testautomation/chart2/tools/ch_tools_tab_borders_lines.inc +++ b/testautomation/chart2/tools/ch_tools_tab_borders_lines.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************************ +' +'************************************************************** +'* +'* short description : Tool library for Borders and Lines tab-page +'* +'************************************************************************************************** '* ' #1 fInvokeTabLine ' #1 fCloseTabLineOK diff --git a/testautomation/chart2/tools/ch_tools_tab_pages.inc b/testautomation/chart2/tools/ch_tools_tab_pages.inc index 1baaf1526311..3b049d0f296b 100644 --- a/testautomation/chart2/tools/ch_tools_tab_pages.inc +++ b/testautomation/chart2/tools/ch_tools_tab_pages.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************************ +' +'************************************************************** +'* +'* short description : Tool library for Borders and Lines tab-page +'* +'************************************************************************************************** '* ' #1 fInvokeTabPage ' #1 fCloseTabLineOK diff --git a/testautomation/chart2/tools/ch_tools_titles.inc b/testautomation/chart2/tools/ch_tools_titles.inc index 0f0a10ab1cb4..d7d7b0875d32 100644 --- a/testautomation/chart2/tools/ch_tools_titles.inc +++ b/testautomation/chart2/tools/ch_tools_titles.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************************ +' +'************************************************************** +'* +'* short description : Tool library for Titles dialog +'* +'************************************************************************************************** '* ' #1 fInvokeTitlesDialog ' #1 fCloseTitlesDialogOK diff --git a/testautomation/dbaccess/tools/controltools.inc b/testautomation/dbaccess/tools/controltools.inc index 83c7b944f256..36d209a8c0b9 100644 --- a/testautomation/dbaccess/tools/controltools.inc +++ b/testautomation/dbaccess/tools/controltools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************* +' +'************************************************************** +'* +'* short description : Helper Routines for Form and Control Tests +'* +'*************************************************************************************** '* ' #1 fSwitchAutopilotOff ' #1 fSetControlProperty diff --git a/testautomation/dbaccess/tools/dbcreatetools.inc b/testautomation/dbaccess/tools/dbcreatetools.inc index 0da6bb377020..65c35c09cbbd 100644 --- a/testautomation/dbaccess/tools/dbcreatetools.inc +++ b/testautomation/dbaccess/tools/dbcreatetools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************* +' +'************************************************************** +'* +'* short description : Library with function for creating all possible databases +'* +'*************************************************************************************** '* ' #1 fCreateMySQL_ODBC_Datasource ' #1 fCreateMySQL_JDBC_Datasource diff --git a/testautomation/dbaccess/tools/dbinit.inc b/testautomation/dbaccess/tools/dbinit.inc index 4533195988b4..e5db9c3b3e33 100644 --- a/testautomation/dbaccess/tools/dbinit.inc +++ b/testautomation/dbaccess/tools/dbinit.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************* +' +'************************************************************** +'* +'* short description : Helper Routines for Base tests. +'* +'*************************************************************************************** '* ' #1 null '* diff --git a/testautomation/dbaccess/tools/dbtools.inc b/testautomation/dbaccess/tools/dbtools.inc index 0fbfd2b1f782..8fa86c5d9413 100644 --- a/testautomation/dbaccess/tools/dbtools.inc +++ b/testautomation/dbaccess/tools/dbtools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************* +' +'************************************************************** +'* +'* short description : Helper Routines for Base tests. +'* +'*************************************************************************************** '* ' #1 fSelectDatasourceInBeamer ' #1 fConnectToDatasourceInBeamer diff --git a/testautomation/dbaccess/tools/formtools.inc b/testautomation/dbaccess/tools/formtools.inc index a66e353d1f18..08c49084e9b3 100644 --- a/testautomation/dbaccess/tools/formtools.inc +++ b/testautomation/dbaccess/tools/formtools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************* +' +'************************************************************** +'* +'* short description : Helper Routines for Base tests. +'* +'*************************************************************************************** '* '* #1 fOpenNewFormDesign '* #1 fCloseForm diff --git a/testautomation/dbaccess/tools/querytools.inc b/testautomation/dbaccess/tools/querytools.inc index ac3a8a9097f3..04dae556d3d7 100644 --- a/testautomation/dbaccess/tools/querytools.inc +++ b/testautomation/dbaccess/tools/querytools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************* +' +'************************************************************** +'* +'* short description : Helper Routines for Base tests. +'* +'*************************************************************************************** '* ' #1 fFindQuery ' #1 fOpenNewQueryDesign diff --git a/testautomation/dbaccess/tools/reporttools.inc b/testautomation/dbaccess/tools/reporttools.inc index d0f2d620b342..d19913612552 100644 --- a/testautomation/dbaccess/tools/reporttools.inc +++ b/testautomation/dbaccess/tools/reporttools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************* +' +'************************************************************** +'* +'* short description : Report Helper Routines for Base tests. +'* +'*************************************************************************************** '* '* #1 fOpenNewReoprtDesign '* #1 fCloseReportDesign diff --git a/testautomation/framework/optional/includes/basic_documents.inc b/testautomation/framework/optional/includes/basic_documents.inc index 8bb400dee0b8..6cf89aa41c7a 100644 --- a/testautomation/framework/optional/includes/basic_documents.inc +++ b/testautomation/framework/optional/includes/basic_documents.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,130 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : BASIC organizers and documents +'* +'\****************************************************************************** + +private const IDOCS = 5 + +testcase tBasicDocuments + + const CFN = "tBasicDocuments::" + + dim sFileWriter as string + dim sFileCalc as string + dim iDocumentCount as integer + dim cNodeListA( 10 ) as string + dim cNodeListB( 10 ) as string + dim iSecLevel as integer + dim iHitCount as integer + + ' NOTE: hCreateBasicWorkFiles() creates files of the naming scheme + ' basic.odt, ...odc etc. All these files will show up with just "basic" + ' in the Macro Organizer + const DOC_NAME = "basic" + + printlog( "Set macro security level to medium" ) + iSecLevel = hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_MEDIUM ) + + printlog( "Open one single unchanged Writer document" ) + hInitSingleDoc() + + kontext "DocumentWriter" + DocumentWriter.typeKeys( "tBasicDocuments - initial document - discard after test" ) + + gApplication = "WRITER" + printlog( "Create a Writer workfilename (build path and filename)" ) + hCreateBasicWorkFiles() + sFileWriter = hGetBasicWorkFile( "current" ) + + gApplication = "CALC" + printlog( "Create a Calc workfilename (build path and filename)" ) + hCreateBasicWorkFiles() + sFileCalc = hGetBasicWorkFile( "current" ) + + printlog( "Open the writer file" ) + hFileOpen( sFileWriter ) + if ( not hAllowMacroExecution() ) then + warnlog( "Missing Macro execution dialog. Please check the file/security settings" ) + endif + + printlog( "Open the Calc file" ) + hFileOpen( sFileCalc ) + if ( not hAllowMacroExecution() ) then + warnlog( "Missing Macro execution dialog. Please check the file/security settings" ) + endif + + printlog( "Open the BASIC organizer" ) + ToolsMacro_uno + WaitSlot() + + printlog( "Retreive the names of all nodes from the treelist" ) + kontext "Makro" + hGetVisibleNodeNames( MakroAus , cNodeListA() ) + + printlog( "Verify that both documents are listed - one Writer, one Calc with identical names" ) + iHitCount = hCountMatchesInList( cNodeListA() , DOC_NAME ) + if ( iHitCount <> 2 ) then + warnlog( "There should be two documents with the name " & DOC_NAME & "listed." ) + endif + + printlog( "Click Manage..." ) + hClickButton( verwalten ) + + printlog( "Get the nodes list from the object organizer tabs - first tab" ) + hSelectBasicObjectOrganizerTab( 1 ) + ListAllDelete( cNodeListB() ) + hGetVisibleNodeNames( ModulListe , cNodeListB() ) + + printlog( "Verify that both documents are listed on both relevant tabpages" ) + iHitCount = hCountMatchesInList( cNodeListA() , DOC_NAME ) + if ( iHitCount <> 2 ) then + warnlog( "There should be two documents with the name " & DOC_NAME & "listed." ) + endif + + printlog( "Switch to second tab" ) + hSelectBasicObjectOrganizerTab( 2 ) + ListAllDelete( cNodeListB() ) + hGetVisibleNodeNames( ModuleList , cNodeListB() ) + if ( listcount( cNodeListB() ) <> 5 ) then + warnlog( CFN & "#i49239# Incorrect object count in treelist" ) + hListPrint( cNodeListB() , "List of objects found in treelist" ) + endif + + printlog( "Verify" ) + iHitCount = hCountMatchesInList( cNodeListB() , DOC_NAME ) + if ( iHitCount <> 2 ) then + warnlog( "There should be two documents with the name " & DOC_NAME & "listed." ) + endif + + printlog( "Third tab (should not list the document" ) + hSelectBasicObjectOrganizerTab( 3 ) + hTestLibraryListBox( cNodeListA() ) + + printlog( CFN & "Closing dialogs..." ) + hCloseDialog( TabBibliotheken, "cancel" ) + + printlog( "Cleanup: Close macro organizer" ) + Kontext "Makro" + hCloseDialog( Makro, "cancel" ) + + printlog( "Cleanup: Close all files" ) + hFileCloseAll() + + printlog( "Cleanup: Remove workfiles" ) + hDeleteFile( sFileWriter ) + hDeleteFile( sFileCalc ) + + printlog( "Rest macro security level" ) + hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT ) + +endcase -***** +'******************************************************************************* function hTestLibraryListBox( cNodeList() ) as boolean diff --git a/testautomation/framework/optional/includes/basic_ide.inc b/testautomation/framework/optional/includes/basic_ide.inc index f17bed803b4f..f52ed90c9f0e 100644 --- a/testautomation/framework/optional/includes/basic_ide.inc +++ b/testautomation/framework/optional/includes/basic_ide.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,129 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Macro Dialogs opened from Basic-IDE +'* +'\****************************************************************************** + +testcase tBasic_IDE_Toolbar_Module + + 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 cSourceFile as string + cSourceFile = gTesttoolpath & "framework\optional\input\resetregistration.txt" + cSourceFile = convertpath( cSourceFile ) + + printlog "open a new writer-doc" + gApplication = "WRITER" + hCreateDocument() + + if ( hInitBasicIDE( "tBasic_IDE_Toolbar_Module" ) ) then + + kontext "macrobar" + printlog "- compile" + hClickButton( Compile ) + + printlog "- Run Basic" + hClickButton( BasicRun ) + + printlog "- Step Procedure" + hClickButton( ProcedureStep ) + + printlog "- Stop Basic" + hClickButton( BasicStop ) + + printlog "- Single Step" + hClickButton( SingleStep ) + + printlog "- Step Back" + hClickButton( StepBack ) + + printlog "- Breakpoint => activate" + hClickButton( Breakpoint ) + + + printlog "- Breakpoint => deactivate" + hClickButton( Breakpoint ) + + printlog "- Add Watch => deactivate" + hClickButton( AddWatch ) + + printlog "- Find Paranthese" + + kontext "macrobar" + hClickButton( FindParanthese ) + + 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( "- 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 + + 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 + + hFileCloseAll() + else + warnlog( "Unable to init BASIC IDE" ) + endif + +endcase -***** +'******************************************************************************* testcase tBasic_IDE_Toolbar_Dialogs diff --git a/testautomation/framework/optional/includes/basic_issues.inc b/testautomation/framework/optional/includes/basic_issues.inc index 3e4f8207893b..16bff3a9d1c3 100644 --- a/testautomation/framework/optional/includes/basic_issues.inc +++ b/testautomation/framework/optional/includes/basic_issues.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,25 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Regression tests for especially annoying BASIC issues +'* +'\****************************************************************************** + +function hIDERunMacro() -***** + kontext "MacroBar" + if ( MacroBar.exists() ) then + BasicRun.click() + else + warnlog( "MacroBar not accessible" ) + endif + +end function + +'******************************************************************************* function hTestActive( cString as string , iMethod as integer , bExact as boolean ) as integer diff --git a/testautomation/framework/optional/includes/basic_macros.inc b/testautomation/framework/optional/includes/basic_macros.inc index 17507d43960c..48343b7bae33 100644 --- a/testautomation/framework/optional/includes/basic_macros.inc +++ b/testautomation/framework/optional/includes/basic_macros.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,58 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +' ** +' ** short description : check macro-dialogs / BASIC-IDE ( 1. part ) +' ** +'\****************************************************************************** + + +testcase tMakro_In_All_Apps + + printlog( "Attach a macro to all application types" ) + + dim iApp as Integer + + const CMACRO = "AppMakro" + const DIALOG_TIMEOUT = 2 + + for iApp = 1 to 7 + + printlog( hNumericDoctype( iApp ) ) + + printlog( "Open a new document" ) + hCreateDocument() + + if ( hInitBasicIde( CMACRO ) ) then + printlog "Close the BASIC-IDE" + hCloseBasicIde() + + printlog( "Close the navigator (Master-doc)" ) + kontext "Navigator" + hCloseDialog( Navigator, "close,optional" ) + + printlog( "Close the document" ) + hUseAsyncSlot( "FileClose" ) + + printlog( "Close the messagebox (document changed)" ) + kontext "messagebox" + if ( MessageBox.Exists( DIALOG_TIMEOUT ) ) then + printlog( "MessageBox: " & MessageBox.getText() ) + hCloseDialog( Messagebox, "no" ) + else + warnlog( "No warning for changed document" ) + end if + else + warnlog( "Could not open the BASIC Macro Organizer, aborting" ) + endif + + next iApp + +endcase -***** +'******************************************************************************* testcase tMakro_Dialog diff --git a/testautomation/framework/optional/includes/basic_modulenames.inc b/testautomation/framework/optional/includes/basic_modulenames.inc index 4151f4dc46a4..75956b6d8395 100644 --- a/testautomation/framework/optional/includes/basic_modulenames.inc +++ b/testautomation/framework/optional/includes/basic_modulenames.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,63 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Test modulenames on the tabbar +'* +'\****************************************************************************** + +testcase tBasicIdeModuleNames + + printlog( "Modulenames in BASIC IDE" ) + + const CMODULE_VALID1 = "tValidName" + const CMODULE_VALID2 = "tValidToo" + const TEST_MACRO = "TTMacro1" + + const RC_SUCCESS = 0 + const RC_FAILURE = 1 + const ERR_NO_LINES_INSERTED = 0 + + dim iCurrentName as integer + dim cTabName as string + + gApplication = "WRITER" + hCreateDocument() + + hInitBasicIde( CMODULE_VALID1 ) + if ( hInsertMacroFromFile( TEST_MACRO ) > ERR_NO_LINES_INSERTED ) then + + cTabName = hGetTabNameFromOrganizer() + + Randomize + iCurrentName = Int( 24 * RND ) + 1 ' Range from 1 to 24 + + printlog( "Trying with invalid modulename" ) + cTabName = hCreateInvalidModuleName( iCurrentName ) + hRenameTab( cTabName ) + if ( hHandleInvalidNameWarning( cTabname ) ) then + printlog( "Warning for invalid modulename displayed" ) + else + warnlog( "Warning for invalid modulename is missing" ) + endif + + printlog( "Trying with valid modulename" ) + hRenameTab( CMODULE_VALID2 ) + if ( hHandleInvalidNameWarning( CMODULE_VALID2 ) ) then + warnlog( "Failed to set valid modulename" ) + endif + + else + warnlog( "Failed to insert macro" ) + endif + + hFileCloseAll() -***** +endcase + +'******************************************************************************* testcase tInvalidModuleNames diff --git a/testautomation/framework/optional/includes/basic_usertemplate.inc b/testautomation/framework/optional/includes/basic_usertemplate.inc index 586e8f958ce5..1a1758345692 100644 --- a/testautomation/framework/optional/includes/basic_usertemplate.inc +++ b/testautomation/framework/optional/includes/basic_usertemplate.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,187 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : My Macros/standard execution with user defined template +'* +'\****************************************************************************** + +testcase tMacroUsertemplate + + + ' requires: Default template path, default security level (medium) + + ' Details: + ' This test checks for some really weird behavior. A macro is created + ' for the standard lib in My Macros - this means the macro is stored with + ' the application, not the document. + ' When creating a document based on a user-created template the macro + ' will not execute, instead a com.sun.star... errormessage is displayed + + dim irc as integer ' returncode + + dim cMacroName as string ' Temp variable to store the name of current macro + + const DOC_IDENTIFIER = "A test document for tMacroUserTemplate" + + dim sPathOut as string ' output path for workfile + const FILEOUT = "tMacroUserTemplate" + const FILTER = "writer8_template" + + dim iCurrentNode as integer + + sPathOut = convertpath( gOfficePath & "user\template\" ) + hDeleteFile( sPathOut & FILEOUT & ".ott" ) + + hInitSingleDoc() + kontext "DocumentWriter" + DocumentWriter.typeKeys( DOC_IDENTIFIER ) + + printlog( "Create a new document" ) + hCreateDocument() + + printlog( "Open the macro organizer" ) + ToolsMacro_uno + + printlog( "Search for the module" ) + kontext "Makro" + iCurrentNode = hSelectNodeByName( MakroAus, "Module1" ) + if ( iCurrentNode = 0 ) then + warnlog( "#i73521# - The expected node could not be found. Aborting test" ) + kontext "Makro" + hCloseDialog( Makro, "close" ) + hDestroyDocument() + goto endsub + endif + + printlog( "Find the macro we are going to replace" ) + if ( MakroListe.getItemCount() > 0 ) then + cMacroName = MakroListe.getSelText() + if ( lcase( cMacroName ) <> "main" ) then + warnlog( "Test abort: Incorrect macro is selected: " & cMacroName ) + printlog( "This should have been the <Main> Macro" ) + kontext "Makro" + hCloseDialog( Makro, "cancel" ) + hDestroyDocument() + goto endsub + endif + else + warnlog( "There is no macro listed for the current module, the test cannot continue" ) + kontext "Makro" + hCloseDialog( Makro, "close" ) + hDestroyDocument() + goto endsub + endif + + printlog( "Edit" ) + Bearbeiten.click() + + printlog( "Insert test macro" ) + hInsertMacro( 3 ) + + printlog( "Close BASIC IDE" ) + hCloseBasicIde() + + printlog( "Close Document" ) + hDestroyDocument() + + printlog( "Open new document" ) + hCreateDocument + + printlog( "Open Macro Organizer" ) + ToolsMacrosRunMacro + + printlog( "Find the Macro again" ) + cMacroName = hExecScript_tMacroUserTemplate() ' local function, see below + if ( lcase( cMacroName ) <> "main" ) then + warnlog( "Test abort: Incorrect macro is selected: " & cMacroName ) + printlog( "This should have been the <Main> Macro" ) + ScriptSelector.cancel() + hDestroyDocument() + goto endsub + endif + + printlog( "Run the macro" ) + ScriptSelector.ok() + + printlog( "Check for macro" ) + kontext "Active" + if ( active.exists( 3 ) ) then + printlog( "Messagebox: " & active.getText() ) + active.ok() + else + warnlog( "The Macro has not been executed" ) + endif + + printlog( "Close the document" ) + hDestroyDocument() + + printlog( "Open a new document" ) + hCreateDocument() + + printlog( "" ) + printlog( "Save as template" ) + hFileSaveAsWithFilterKill( sPathOut & FILEOUT, FILTER ) + + printlog( "Close the document" ) + hDestroyDocument() + + printlog( "" ) + printlog( "File New from Template" ) + FileNewFromTemplate + + printlog( "Find the template" ) + irc = hFindTemplate( FILEOUT ) + hSelectDocumentObject( irc, 1 ) + + printlog( "" ) + printlog( "Open the <Run Macro> dialog" ) + ToolsMacrosRunMacro + + printlog( "Try to find the macro" ) + cMacroName = hExecScript_tMacroUserTemplate() ' local function, see below + if ( lcase( cMacroName ) <> "main" ) then + warnlog( "Test abort: Incorrect macro is selected: " & cMacroName ) + printlog( "This should have been the <Main> Macro" ) + ScriptSelector.cancel() + hDestroyDocument() + goto endsub + endif + + printlog( "Run" ) + ScriptSelector.ok() + + printlog( "Verify macro execution" ) + kontext "Active" + if ( active.exists( 3 ) ) then + + if ( instr( active.getText() , "com.sun" ) <> 0 ) then + warnlog( "#i58527# - unable to run macro with user-template loaded" ) + endif + + if ( active.getText() = "TTMacro3" ) then + printlog( "The macro was executed" ) + else + printlog( "Unknown dialog: " & hRemoveLineBreaks( active.getText() ) ) + endif + + active.ok() + else + warnlog( "Macro not executed / no warning" ) + endif + + printlog( "Close all open documents" ) + hFileCloseAll() + + printlog( "Delete test template" ) + hDeleteFile( sPathOut & FILEOUT & ".ott" ) + + +endcase -***** +'******************************************************************************* function hExecScript_tMacroUserTemplate() as string diff --git a/testautomation/framework/optional/includes/basic_vba-compat_xlsm-xlsb.inc b/testautomation/framework/optional/includes/basic_vba-compat_xlsm-xlsb.inc index 65ea24339edd..b4578fad63b2 100644 --- a/testautomation/framework/optional/includes/basic_vba-compat_xlsm-xlsb.inc +++ b/testautomation/framework/optional/includes/basic_vba-compat_xlsm-xlsb.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,108 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +* +'* short description : Test VBA compatibility switches +'* +'\****************************************************************************** + +testcase tBasicVBACompatXLSM_XLSB() + + printlog( "Functionality of macros in XLSM/XLSB files" ) + ' Based on issue #i111007 + + const IMPORT_EXCEL_MACROS = TRUE + const EXEC_EXCEL_MACROS = TRUE + + const FILE_COUNT = 2 + const MODULE_COUNT = 7 + + const MODULE_NOT_FOUND = 0 + const MAX_DELAY = 3 + const RC_TIMEOUT = -1 + + const THE_MODULE_THAT_BEHAVES_DIFFERENTLY = 6 + + const RELATIVE_PATH = "framework/optional/input/vba-compat/" + + ' We have two files to load, on e .xlsm and one .xlsb + dim cFileList( FILE_COUNT ) as string + cFileList( 1 ) = "vba-project.xlsm" + cFileList( 2 ) = "vba-project.xlsb" + + ' both documents import the same modules + dim cTestModuleList( MODULE_COUNT ) + cTestModuleList( 1 ) = "MyChartModule" + cTestModuleList( 2 ) = "MyCodeModule" + cTestModuleList( 3 ) = "MyPrivateClassModule" + cTestModuleList( 4 ) = "MyPublicClassModule" + cTestModuleList( 5 ) = "MySheetModule" + cTestModuleList( 6 ) = "MyUserForm" + cTestModuleList( 7 ) = "MyWorkbookModule" + + dim cTestFile as string + dim iCurrentFile as integer + dim iCurrentModule as integer + + printlog( "Set macro security to low" ) + hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_LOW ) + + printlog( "Open Tools/Options" ) + hSetExcelBasicImportMode( IMPORT_EXCEL_MACROS, EXEC_EXCEL_MACROS ) + + for iCurrentFile = 1 to FILE_COUNT + + cTestFile = gTesttoolPath & RELATIVE_PATH & cFileList( iCurrentFile ) + + printlog( "Loading document: " & cTestFile ) + hFileOpen( cTestFile ) + + for iCurrentModule = 1 to MODULE_COUNT + + printlog( "" ) + printlog( "Tryng to execute macro: " & cTestModuleList( iCurrentModule ) ) + ToolsMacro_uno + + kontext "Makro" + if ( Makro.exists( MAX_DELAY ) ) then + + if ( hSelectNodeByName( MakroAus, cTestModuleList( iCurrentModule ) ) <> MODULE_NOT_FOUND ) then + + printlog( "Execute the default macro <Test> for the current module" ) + + if ( hClickButton( Ausfuehren ) <> RC_TIMEOUT ) then + if ( iCurrentModule = THE_MODULE_THAT_BEHAVES_DIFFERENTLY ) then + ' Fuzzy matching message string + hTestMacroType2( cTestModuleList( iCurrentModule ) ) + else + ' Exact matching message string + hTestMacroType1( cTestModuleList( iCurrentModule ) ) + endif + else + warnlog( "No executable macro found for the current module / <Run> button is disabled" ) + endif + else + warnlog( "the expected macro module could not be found" ) + endif + else + warnlog( "BASIC Macro organizer did not open" ) + endif + + next iCurrentModule -***** + printlog( "Close the document" ) + hFileCloseAll() + + next iCurrentFile + + hSetExcelImportModeDefault() + hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT ) + +endcase + +'******************************************************************************* function hTestMacroType1( cMessage as string ) as boolean diff --git a/testautomation/framework/optional/includes/basic_vba_compat_tools.inc b/testautomation/framework/optional/includes/basic_vba_compat_tools.inc index 286027293d08..a344d8a3153c 100644 --- a/testautomation/framework/optional/includes/basic_vba_compat_tools.inc +++ b/testautomation/framework/optional/includes/basic_vba_compat_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,37 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Small helpers for Excel BASIC import modes +'* +'\****************************************************************************** + +function hSetExcelBasicImportMode( bImport as boolean, bEnable as boolean ) + + printlog( "Changing Excel VBA import modes" ) + + ToolsOptions + hToolsOptions( "LoadSave", "VBAProperties" ) + + if ( bImport ) then + ExcelBasicLaden.check() + if ( bEnable ) then + ExecutableCode.check() + else + ExecutableCode.uncheck() + endif + else + ExcelBasicLaden.uncheck() + endif + + Kontext "OptionenDlg" + OptionenDlg.ok() + +end function -***** +'******************************************************************************* function hSetExcelImportModeDefault() diff --git a/testautomation/framework/optional/includes/f_usage_tracking.inc b/testautomation/framework/optional/includes/f_usage_tracking.inc index 494b62385876..a97e72f8dc55 100644 --- a/testautomation/framework/optional/includes/f_usage_tracking.inc +++ b/testautomation/framework/optional/includes/f_usage_tracking.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,16 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Usage tracking +'* +'\****************************************************************************** -***** +private const LOGFILE = "user\temp\Feedback\Current.csv" + +'******************************************************************************* testcase tUsageTracking1 diff --git a/testautomation/framework/optional/includes/filedlg_document_properties.inc b/testautomation/framework/optional/includes/filedlg_document_properties.inc index 6eb193f46387..da4e2ad0e768 100644 --- a/testautomation/framework/optional/includes/filedlg_document_properties.inc +++ b/testautomation/framework/optional/includes/filedlg_document_properties.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,87 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -***** +' +'************************************************************** +'* +'* short description : Access document properties +'* +'\****************************************************************************** + +testcase tFiledlgDocumentProperties() + + + dim cFileName as string + cFileName = "DigitalSignature" & hGetSuffix( "current" ) + + dim cFilePath as string + cFilePath = gTesttoolPath & "framework\optional\input\security" + cFilePath = convertpath( cFilePath ) + + dim cFileURL as string : cFileURL = cFilePath & gPathSigne & cFileName + + dim iFileSize as long + dim cFileSize as string + dim iFileSizeInfo as long + dim cSignatureCreator as string + + dim cTestExpression as string + + dim cSelectAll as string + dim cCopy as string + + dim brc as boolean + + printlog( "Using filename: " & cFileName ) + printlog( "Using filepath: " & cFilePath ) + + if ( FileExists( cFileURL ) ) then + iFileSize = FileLen( cFileURL ) + printlog( "Testfile size is: " & iFileSize & " Bytes" ) + else + warnlog( "The workfile does not exist. aborting test" ) + goto endsub + endif + + hFileOpen( cFileURL ) + + FileProperties + + brc = hDocumentInfoSelectTab( "General" ) + if ( not brc ) then + warnlog( "Unable to switch to the requested tabpage, trying to recover" ) + kontext "TabDokument" + TabDokument.cancel() + hDestroyDocument() + endif + + cTestExpression = hGetStringFromStaticTextField( FileLocationInfo ) + if ( cTestExpression = cFilePath ) then + printlog( "Path is correct" ) + else + warnlog( "The path string is incorrect: " & cTestExpression ) + endif + + kontext "TabDokument" + cFileSize = hGetStringFromStaticTextField( FileSizeInfo ) + iFileSizeInfo = hConvertStringToLong( cFileSize ) + if ( iFileSize <> iFileSizeInfo ) then + warnlog( "Filesize does not match, please check" ) + printlog( "Found...: " & iFileSizeInfo ) + printlog( "Expected: " & iFileSize ) + else + printlog( "Filesize is correct" ) + endif + + kontext "TabDokument" + TabDokument.cancel() + + hDestroyDocument() + + +endcase + +'******************************************************************************* function hDocumentInfoSelectTab( cTabPage as string ) as boolean diff --git a/testautomation/framework/optional/includes/filedlg_tools.inc b/testautomation/framework/optional/includes/filedlg_tools.inc index 4b2a294094ca..29c4bc666e87 100644 --- a/testautomation/framework/optional/includes/filedlg_tools.inc +++ b/testautomation/framework/optional/includes/filedlg_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,86 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : check the internal file dialog ( 1. part ) +'* +'\*************************************************************************** + +sub CheckDirectoryName( dirname as string ) + + ' Try to create a folder twice and make sure a warning comes up that the + ' folder already exists + + dim i as integer + dim FULLPATH as string + FULLPATH = gOfficePath + "user\work\" + dirname + "\" + + printlog( " - Create the folder and verify it's existence" ) + + try + + for i=1 to 2 + + printlog( " - creating folder for the " + i + ". time" ) + + Kontext "OeffnenDlg" + printlog( " - press 'new folder' button" ) + NeuerOrdner.Click() + + Kontext "NeuerOrdner" + if ( NeuerOrdner.exists( 2 ) ) then + printlog( " - name the folder" ) + OrdnerName.SetText( dirname ) + printlog( " - press OK") + NeuerOrdner.OK() + else + warnlog( "New Folder dialog not displayed" ) + endif + + ' Take care of the File Exists Dialog + printlog( " - check for 'File Exists'-Dialog" ) + Kontext "Active" + If Active.Exists() then + Active.OK() + + 'if the file exists during first run of the test: just go on + if i = 1 then + warnlog( "File exists. Did you clean the output-dir?" ) + end if + + 'if the active exists, we will return to the 'new folder' dialog + 'it must be closed as well + Kontext "NeuerOrdner" + NeuerOrdner.Cancel() + else + 'this should only be displayed on second run + if i = 2 then + warnlog( "No message that the folder '" + dirname + "' exists!" ) + end if + end if + + next i + + printlog( " - verify the existence of the new directory" ) + if App.Dir ( ConvertPath ( FULLPATH ), 16 ) = "" then + Warnlog( "The directory'" + dirname + "' wasn't created!" ) + else + printlog( " - delete it") + App.RmDir ( ConvertPath ( FULLPATH ) ) + end if + + + catch + + warnlog( "Could not create the directory. Bugid: #108256# or #106510# ?" ) + + endcatch + +end sub -***** +'******************************************************************************* sub CreateInvalidDirectory( dirname as string ) diff --git a/testautomation/framework/optional/includes/ole_1.inc b/testautomation/framework/optional/includes/ole_1.inc index d6ce3f220170..f6532779aac3 100644 --- a/testautomation/framework/optional/includes/ole_1.inc +++ b/testautomation/framework/optional/includes/ole_1.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,146 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : global-level-1-test -> insert all OLE-Objects out of OLE-dialog into all doc-types +'* +'\****************************************************************************** + +testcase tOLEWriter + + Dim i% : Dim k% + Dim sText$ + + gApplication = "WRITER" + + Call hNewDocument + + PrintLog "- Writer : Chart without table" + hUseAsyncSlot( "InsertObjectChart" ) + + Kontext "DocumentChart" + if ( DocumentChart.Exists( 5 ) ) then + FormatChartType + Kontext "ChartType" + if ( ChartType.Exists( 5 ) ) then + ChartType.Cancel + else + warnlog "Chart Type dialog did bot occour." + end if + Kontext "DocumentChart" + DocumentChart.TypeKeys "<ESCAPE>" + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<DELETE>" + else + warnlog "Chart has not been inserted." + end if + + PrintLog "- Writer : Chart out of a table only with numbers" + hUseAsyncSlot( "InsertTableWriter" ) + + Kontext "TabelleEinfuegenWriter" + if ( TabelleEinfuegenWriter.exists( 1 ) ) then + Spalten.SetText "3" + Zeilen.SetText "10" + TabelleEinfuegenWriter.OK + TabelleEinfuegenWriter.notExists( 2 ) + else + warnlog( "Dialog <TabelleEinfuegenWriter> did not open" ) + endif + + Kontext "DocumentWriter" + for i%=1 to 10 + for k%=1 to 3 + sText$ = (i%+k%)*k% + DocumentWriter.TypeKeys sText$ + DocumentWriter.TypeKeys "<Right>" + next k% + DocumentWriter.TypeKeys "<Down>" + DocumentWriter.TypeKeys "<Left>", 3 + next i% + + hUseAsyncSlot( "InsertObjectChart" ) + hStepThroughChartWizard() + + Kontext "DocumentChart" + DocumentChart.typeKeys "<ESCAPE>" + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<Delete>" + Sleep 1 + DocumentWriter.TypeKeys "<Down>", 20 + DocumentWriter.TypeKeys "<Return>", 2 + + PrintLog "- Writer : Chart out of a table only with chars" + hUseAsyncSlot( "InsertTableWriter" ) + + Kontext "TabelleEinfuegenWriter" + if ( TabelleEinfuegenWriter.exists( 1 ) ) then + Spalten.SetText "3" + Zeilen.SetText "10" + TabelleEinfuegenWriter.OK + TabelleEinfuegenWriter.notExists( 2 ) + else + warnlog( "Dialog <TabelleEinfuegenWriter> did not open" ) + endif + + Kontext "DocumentWriter" + for i%=1 to 10 + for k%=1 to 3 + sText$ = (i%+k%)*k% + DocumentWriter.TypeKeys "Hallo" + sText$ + DocumentWriter.TypeKeys "<Right>" + next k% + DocumentWriter.TypeKeys "<Down>" + DocumentWriter.TypeKeys "<Left>", 3 + next i% + + hUseAsyncSlot( "InsertObjectChart" ) + hStepThroughChartWizard() + + Kontext "DocumentChart" + DocumentChart.typeKeys "<ESCAPE>" + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<Delete>" + Sleep 1 + DocumentWriter.TypeKeys "<Down>", 20 + DocumentWriter.TypeKeys "<Return>", 2 + + PrintLog "- Writer : Math" + + hUseAsyncSlot( "InsertObjectFormulaWriter" ) + gMouseClick ( 1, 1) + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<Delete>" + + PrintLog "- Writer : floating frame" + hUseAsyncSlot( "InsertFloatingFrame" ) + + printlog( "Properties dialog for floating frame should open" ) + Kontext "TabEigenschaften" + if ( TabEigenschaften.exists( 1 ) and TabEigenschaften.isVisible() ) then + + printlog( "Name the floating frame, close the dialog" ) + FrameName.SetText "Hallo" + Inhalt.SetText ConvertPath ( gTesttoolPath+"global\input\graf_inp\borabora.jpg" ) + + TabEigenschaften.OK + TabEigenSchaften.notExists( 2 ) + + endif + + printlog( "Close the writer document" ) + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<Delete>" + Sleep 1 + + hCloseDocument + +endcase -***** +'******************************************************************************* testcase tOLECalc diff --git a/testautomation/framework/optional/includes/ole_3.inc b/testautomation/framework/optional/includes/ole_3.inc index 479fa4a5086f..4c602567b775 100644 --- a/testautomation/framework/optional/includes/ole_3.inc +++ b/testautomation/framework/optional/includes/ole_3.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,62 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : +'* +'\****************************************************************************** + +testcase tDraw_As_OLE_Object() + + call ClosePresentationfloat() + call hInsertOLEObject( true, gOLEDraw, "DRAW" ) + 'call hInsertOLEObject( false, gOLEDraw, "DRAW" ) + +endcase + +testcase tCalc_as_OLE_Object() + + call ClosePresentationfloat() + call hInsertOLEObject( true, gOLECalc, "CALC" ) + 'call hInsertOLEObject( false, gOLECalc, "CALC" ) + +endcase + +testcase tImpress_As_OLE_Object() + + call ClosePresentationfloat() + call hInsertOLEObject( true, gOLEImpress, "IMPRESS" ) + 'call hInsertOLEObject( false, gOLEImpress, "IMPRESS" ) + +endcase -***** +testcase tWriter_As_OLE_Object() + + call ClosePresentationfloat() + call hInsertOLEObject( true, gOLEWriter, "WRITER" ) + 'call hInsertOLEObject( false, gOLEWriter, "WRITER" ) + +endcase + +testcase tMath_As_OLE_Object() + + call ClosePresentationfloat() + call hInsertOLEObject( true, gOLEMath, "MATH" ) + 'call hInsertOLEObject( false, gOLEMath, "MATH" ) + +endcase + +testcase tChart_As_OLE_Object() + + call ClosePresentationfloat() + call hInsertOLEObject( true, gOLEChart, "CHART" ) + 'call hInsertOLEObject( false, gOLEChart, "CHART" ) + +endcase + +'******************************************************************************* function hInsertOLEObject( bRemoveFocus as boolean, cOLEObject as string, cOleType as string ) as beoolean diff --git a/testautomation/framework/optional/includes/ole_tools.inc b/testautomation/framework/optional/includes/ole_tools.inc index 7425018cd9a5..dbdad5e9cd45 100644 --- a/testautomation/framework/optional/includes/ole_tools.inc +++ b/testautomation/framework/optional/includes/ole_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,22 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : global-level-1-test -> insert all OLE-Objects out of OLE-dialog into all doc-types +'* +'\****************************************************************************** -***** +sub hReopenDoc + 'Only for bughandling if closing an OLE object fails + Warnlog "Cannot release Chart Object -> #107005#?" + hCloseDocument() + 'if Active.Exists ( 1 ) then Active.TypeKeys "<RIGHT><ENTER>" + hNewDocument() +end sub + +'******************************************************************************* sub hOleSelektieren ( xStart%, yStart%, xEnde%, yEnde% ) WL_TB_ZF_Auswahl diff --git a/testautomation/framework/optional/includes/options_lan1.inc b/testautomation/framework/optional/includes/options_lan1.inc index a82cd9411cfa..d2403c9e2595 100644 --- a/testautomation/framework/optional/includes/options_lan1.inc +++ b/testautomation/framework/optional/includes/options_lan1.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,36 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : general option test (test for language-group) +'* +'\****************************************************************************** + +sub opt_lan1 + Dim bOld as Boolean + + bOld = ActiveDeactivateAsianSupport ( FALSE ) + + Call tLanguageSettingsLanguages + Call tLanguageSettingsWritingAids + + printlog "++ activate the asian support in StarOffice ++" + ActiveDeactivateAsianSupport ( TRUE ) + Call tLanguageSettingsJapaneseFind + Call tLanguageSettingsAsianLayout + + printlog "++ reset asian support in StarOffice to default ++" + if bOld = TRUE then + ActiveDeactivateAsianSupport ( TRUE ) + else + ActiveDeactivateAsianSupport ( FALSE ) + end if + +end sub -***** +'******************************************************************************* testcase tLanguageSettingsLanguages diff --git a/testautomation/framework/optional/includes/options_ooo_java.inc b/testautomation/framework/optional/includes/options_ooo_java.inc index 3fde9a9cbde2..0ece50b381d1 100644 --- a/testautomation/framework/optional/includes/options_ooo_java.inc +++ b/testautomation/framework/optional/includes/options_ooo_java.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,77 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Tools->Options: OpenOffice.org Java +'* +'\****************************************************************************** + +testcase tOOoJava + dim bJavaState as boolean + + ToolsOptions + hToolsOptions( "StarOffice", "Java" ) + + printlog( "Verify that Java is enabled and configured" ) + if ( usejava.isChecked() = false ) then + warnlog( "Java should be enabled by default, checking and restarting" ) + bJavaState = hChangeJavaState( true ) + if ( bJavaState = false ) then + warnlog( "Java is still not enabled, aborting test." ) + kontext "OptionenDlg" + OptionenDlg.cancel() + goto endsub + endif + else + printlog( " Java is enabled. Good." ) + endif + + ' Needs a delay, it might take some time until the listbox gets populated + sleep( 3 ) + + ' There should be a java-runtime installed. If not -> leave test + printlog( "Make sure at least one Java runtime is installed" ) + if ( javalist.getitemcount() = 0 ) then + warnlog( "No java listed in listbox, the test will stop" ) + kontext "OptionenDlg" + OptionenDlg.cancel() + goto endsub + else + printlog( " Java is installed, good." ) + endif + + printlog( "Quickly test that all controls are active" ) + if ( add.isEnabled() ) then + printlog( " 'Add...' is enabled" ) + else + warnlog( "The 'Add...' button is disabled" ) + endif + + if ( parameters.isEnabled() ) then + printlog( " 'Parameters...' is enabled" ) + else + warnlog( "The 'Parameters...' button is disabled" ) + endif + + if ( classpath.isEnabled() ) then + printlog( " 'Class Path...' is enabled" ) + else + warnlog( "The 'Class Path...' button is disabled" ) + endif + + if ( JavaList.isEnabled() ) then + printlog( " 'JavaList' is enabled" ) + else + warnlog( "The 'JavaList' button is disabled" ) + endif + + kontext "OptionenDlg" + OptionenDlg.ok +endcase -***** +'******************************************************************************* function hChangeJavaState( bEnable as boolean ) as boolean ' this little fella switches Java support on and off including a restart of diff --git a/testautomation/framework/optional/includes/options_ooo_security.inc b/testautomation/framework/optional/includes/options_ooo_security.inc index 2411a3b0c340..57f93b38df10 100644 --- a/testautomation/framework/optional/includes/options_ooo_security.inc +++ b/testautomation/framework/optional/includes/options_ooo_security.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,45 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Tools->Options: OpenOffice.org Security +'* +'\****************************************************************************** + +testcase tOOoSecurity + dim _file as string + + if ( getDocumentCount() < 1 ) then call hNewDocument() + _file = gTesttoolPath & "framework\optional\input\options\ooo_security_defaults.ref" + checkSecurityPage( _file ) -***** + if ( getDocumentCount() < 1 ) then call hNewDocument() + _file = gTesttoolPath & "framework\optional\input\options\ooo_security_changed.ref" + changeSecurityPage( _file ) + + if ( getDocumentCount() < 1 ) then call hNewDocument() + checkSecurityPage( _file ) + + if ( getDocumentCount() < 1 ) then call hNewDocument() + _file = gTesttoolPath & "framework\optional\input\options\ooo_security_defaults.ref" + changeSecurityPage( _file ) + + if ( getDocumentCount() < 1 ) then call hNewDocument() + checkSecurityPage( _file ) + + kontext "ExtrasOptionenDlg" + if ( ExtrasOptionenDlg.exists() ) then + ExtrasOptionenDlg.ok() + else + warnlog( "options dialog not available" + endif + if ( getDocumentCount() > 0 ) then call hCloseDocument() + +endcase + +'******************************************************************************* sub checkSecurityPage( _file as string ) _file = convertpath( _file ) diff --git a/testautomation/framework/optional/includes/options_ooo_view.inc b/testautomation/framework/optional/includes/options_ooo_view.inc index 6fdda875180c..1136a0c044ea 100644 --- a/testautomation/framework/optional/includes/options_ooo_view.inc +++ b/testautomation/framework/optional/includes/options_ooo_view.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,40 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Tools->Options: OpenOffice.org View +'* +'\****************************************************************************** + +testcase tOOoView + + + dim sFile as string + + printlog "Check if the defaults are correct" + sFile = gTesttoolPath + "framework\optional\input\options\ooo_view_defaults.ref" + call checkPage( sFile , false ) -***** + printlog "Change all settings to something different to the default" + sFile = gTesttoolPath + "framework\optional\input\options\ooo_view_changed.ref" + call changePage( sFile , true, 1 ) + + printlog "Verify that all changes persist after a restart" + sFile = gTesttoolPath + "framework\optional\input\options\ooo_view_changed.ref" + call checkPage( sFile , true, 1 ) + + printlog "Re-apply the defaults to all controls and restart the application" + sFile = gTesttoolPath + "framework\optional\input\options\ooo_view_defaults.ref" + call changePage( sFile , false ) + + printlog "Verify that all settings have indeed been reset to defaults" + call checkPage( sFile , false ) + +endcase + +'******************************************************************************* sub checkPage( sFile as string , bDisabled as boolean, optional iMiddleMouseButtonControl as integer) dim iMiddleMouseButton as integer diff --git a/testautomation/framework/optional/includes/security_macrosecurity.inc b/testautomation/framework/optional/includes/security_macrosecurity.inc index 5200fea3ebd2..652df1a0acea 100644 --- a/testautomation/framework/optional/includes/security_macrosecurity.inc +++ b/testautomation/framework/optional/includes/security_macrosecurity.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,29 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Macros with all security-levels +'* +'\****************************************************************************** + +sub tMacroSecurityLevelsControlModule + + dim iApplication as integer + + for iApplication = 1 to 6 -***** + printlog( "" ) + printlog( hNumericDocType( iApplication ) ) + call tMacroSecurityLevels( "current" ) + call tMacroSecurityLevels( "645" ) + + next iApplication + +end sub + +'******************************************************************************* testcase tMacroSecurityLevels( cFileFormat ) diff --git a/testautomation/framework/required/includes/first.inc b/testautomation/framework/required/includes/first.inc index e2ac49207ced..4fc5e0c0b6ae 100644 --- a/testautomation/framework/required/includes/first.inc +++ b/testautomation/framework/required/includes/first.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,157 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : First test of basic functionality +'* +'\****************************************************************************** + +testcase tAllNew + + printlog( "Open all available document types" ) + + Dim lsList (20) as string + + if ( gUseSysDlg ) then + warnlog("Only check, if the documents will be opened; no " & _ + "check for the defaultfilter (system file-dialog)!") + end if + + printlog "" + try + gApplication = "WRITER" + printlog " - " & gApplication + + hNewDocument() + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "This is a Writer-document!" + if gUseSysDlg = FALSE then + if fDocumentCheck (gWriterFilter) = FALSE then + warnlog("The filter name (saving) is not correct! " & _ + "Please check if a Writer document will be opened!") + end if + end if + hCloseDocument() + catch + Exceptlog + ResetApplication + endcatch + + try + gApplication = "CALC" + printlog " - " & gApplication + + hNewDocument + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "This is a Calc-document!" + + if gUseSysDlg = FALSE then + if fDocumentCheck (gCalcFilter) = FALSE then + warnlog("The filter name (saving) is not correct! " & _ + "Please check if a Calc document will be opened!") + end if + end if + hCloseDocument + catch + Exceptlog + ResetApplication + endcatch + + try + gApplication = "IMPRESS" + printlog " - " & gApplication + + hNewDocument() + sleep(3) + InsertDuplicateSlide + sleep(2) + if gUseSysDlg = FALSE then + if fDocumentCheck (gImpressFilter) = FALSE then + warnlog("The filter name (saving) is not correct! " & _ + "Please check if an Impress document will be opened!") + end if + end if + hCloseDocument() + catch + Exceptlog + ResetApplication + endcatch + + try + gApplication = "DRAW" + printlog " - " & gApplication + hNewDocument() + InsertSlide + if gUseSysDlg = FALSE then + if fDocumentCheck (gDrawFilter) = FALSE then + warnlog("The filter name (saving) is not correct! Please check if a Draw document will be opened!") + end if + end if + hCloseDocument() + catch + Exceptlog + ResetApplication + endcatch + try + gApplication = "HTML" + printlog " - " & gApplication + hNewDocument() + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "This is a HTML-Document!" + if gUseSysDlg = FALSE then + if (fDocumentCheck (gHTMLFilter) = FALSE) then + warnlog("The filter name (saving) is not correct! Please check if a HTML document will be opened! -> #i30867") + end if + end if + hCloseDocument() + catch + Exceptlog + ResetApplication + endcatch + + try + gApplication = "MATH" + printlog " - " & gApplication + hNewDocument() + Call SchreibenInMathDok("a over b") + if gUseSysDlg = FALSE then + if fDocumentCheck (gMathFilter) = FALSE then + warnlog("The filter name (saving) is not correct! Please check if a Math document will be opened!") + end if + end if + hCloseDocument + catch + Exceptlog + ResetApplication + endcatch + + + try + gApplication = "MASTERDOCUMENT" + printlog " - " & gApplication + hNewDocument() + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "This is a master document!" + if gUseSysDlg = FALSE then + if fDocumentCheck (gMasterDocFilter) = FALSE then + warnlog("The filter name (saving) is not correct! Please check if a Master document will be opened!") + end if + end if + Kontext "Navigator" + if Navigator.Exists(5) then + Navigator.Close + end if + hCloseDocument() + catch + Exceptlog + ResetApplication + endcatch +endcase -***** +'******************************************************************************* testcase tJava diff --git a/testautomation/framework/required/includes/help_browser.inc b/testautomation/framework/required/includes/help_browser.inc index 9619234dc8ee..82d86b527c7f 100644 --- a/testautomation/framework/required/includes/help_browser.inc +++ b/testautomation/framework/required/includes/help_browser.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,54 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : global update/resource test +'* +'\****************************************************************************** + +testcase tHelp_DialogTest + + printlog( "Resource test for the Help Browser" ) + + dim brc as boolean + + brc = hOpenHelp() + if ( not brc ) then + warnlog( "Help not open, aborting test" ) + kontext "Active" + if ( Active.exists( 2 ) ) then + printlog( "Msgbox: " & Active.getText() ) + Active.ok() + endif + goto endsub + endif + + hSelectHelpTab( "content" ) + hSelectHelpTab( "index" ) + hSelectHelpTab( "find" ) + hSelectHelpTab( "bookmarks" ) + + + brc = hSelectHelpTab( "content" ) + call DialogTest( ContentPage ) + + brc = hSelectHelpTab( "index" ) + call DialogTest( IndexPage ) + + brc = hSelectHelpTab( "find" ) + call DialogTest( FindPage ) + + brc = hSelectHelpTab( "bookmarks" ) + call DialogTest( BookmarksPage ) + + Kontext "StarOfficeHelp" + hCloseHelp() -***** +endcase + +'******************************************************************************* testcase tHelp_ToolBar diff --git a/testautomation/framework/required/includes/printer_administration.inc b/testautomation/framework/required/includes/printer_administration.inc index b9ee42770250..2a3a81857e0c 100644 --- a/testautomation/framework/required/includes/printer_administration.inc +++ b/testautomation/framework/required/includes/printer_administration.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,104 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : updatetest for the printer configuration +'* +'\****************************************************************************** + +testcase t_updt_spadmin -***** + printlog( "Resource test for SPAdmin (Printer administration tool) for Unix(like) OS" ) + + if ( gtSysName = "eComStation" ) then + printlog( "No SpAdmin for eComStation" ) + goto endsub + endif + + if ( lcase(gPlatform) = "osx") then + printlog( "No SPAdmin on MacOS X" ) + goto endsub + endif + + if ( gPlatGroup = "w95" ) then + printlog( "No SPAdmin on Windows" ) + goto endsub + endif + + const CPRINTER = "tt-testprinter" + dim irc as integer + dim brc as boolean + + hShutdownOffice() + + brc = hOpenSpAdmin() + if ( brc ) then + + brc = hWaitForSpAdmin() + if ( not brc ) then + warnlog( "SpAdmin is not open, the test cannot continue" ) + goto endsub + endif + + irc = hDelPrinter( CPRINTER ) + select case irc + case 0 : printlog( "Maybe printer was left over by prior run?" ) + case 3 : printlog( "OK, printer does not exist" ) + end select + + brc = hWaitForSpAdmin() + if ( not brc ) then + warnlog( "SpAdmin is not open, the test cannot continue" ) + goto endsub + endif + + call TestNewPrinter( CPRINTER ) + + ' wait for the spadmin to open, on failure we end the test + brc = hWaitForSpAdmin() + if ( not brc ) then + warnlog( "SpAdmin is not open, the test cannot continue" ) + goto endsub + endif + + call TestProperties( CPRINTER ) + + ' wait for the spadmin to open, on failure we end the test + brc = hWaitForSpAdmin() + if ( not brc ) then + warnlog( "SpAdmin is not open, the test cannot continue" ) + goto endsub + endif + + call TestRename( CPRINTER ) + + ' wait for the spadmin to open, on failure we end the test + brc = hWaitForSpAdmin() + if ( not brc ) then + warnlog( "SpAdmin is not open, the test cannot continue" ) + goto endsub + endif + + ' wait for the spadmin to open, on failure we end the test + brc = hWaitForSpAdmin() + if ( not brc ) then + warnlog( "SpAdmin is not open, the test cannot continue" ) + goto endsub + endif + + + irc = hDelPrinter( CPRINTER ) + if ( irc <> 0 ) then + warnlog( "We created a Fax printer but it could not be deleted" ) + endif + + endif + +endcase + +'******************************************************************************* sub TestNewPrinter( cPrinter as string ) diff --git a/testautomation/framework/required/includes/script_organizers.inc b/testautomation/framework/required/includes/script_organizers.inc index 4c4ed7bb5ff6..fdc294f20521 100644 --- a/testautomation/framework/required/includes/script_organizers.inc +++ b/testautomation/framework/required/includes/script_organizers.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,141 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Verify names of macros and scripts +'* +'\****************************************************************************** + +testcase tUpdtScripts + + printlog( "Resource test for macros and scripts / related dialogs" ) + + if ( gIsoLang <> "en-US" ) then + printlog( "No testing for languages other than en_US" ) + goto endsub + endif + + const SCRIPTING_DIALOGS = 5 + + const DLG_JAVASCRIPT = "JavaScript" + const DLG_BEANSHELL = "BeanShell" + const DLG_PYTHON = "Python" + const DLG_BASIC_ORG = "BasicOrganizer" + const DLG_RUN_MACRO = "RunMacro" + + ' This is the build specific part of the filename including substrings for + ' the productname and language. + dim sProductString as string : sProductString = gProductName & "_" & gISOLang & "_" + + ' define platforms that have different scriptcount + if ( lcase( gPlatGroup ) = "w95" ) then sProductString = sProductString & "win_" + if ( lcase( gPlatform ) = "osx" ) then sProductString = sProductString & "osx_" + + ' replace all blanks + sProductString = hStringReplaceChar( sProductString, " ", "-" ) + + ' This is where reference file is located, the filename is yet incomplete + dim sInputPath as string + sInputPath = gTesttoolPath & "framework/required/input/scripts/" & sProductString + + ' This is where we store the reference file if differences are found. + dim sOutputPath as string + sOutputPath = gOfficePath & "user/work/" & sProductString + + ' These contain the input and output paths (fully qualified) + dim sFileIn as string + dim sFileOut as string + + ' Array that contains the scriptnames for all organizers + dim cScriptNamesList( 1000 ) as string + + dim sDialog as string + dim iCurrentDialog as integer + + dim iDiffCount as integer + dim max_diffcount as integer + + hInitSingleDoc() + + for iCurrentDialog = 1 to SCRIPTING_DIALOGS + + ListAllDelete( cScriptNamesList() ) + + ' Build complete filename and identify dialog for logging and case selection + select case ( iCurrentDialog ) + case 1 : sDialog = DLG_JAVASCRIPT + case 2 : sDialog = DLG_BEANSHELL + case 3 : sDialog = DLG_PYTHON + case 4 : sDialog = DLG_BASIC_ORG + case 5 : sDialog = DLG_RUN_MACRO + end select + + printlog( "" ) + sFileIn = convertpath( sInputPath & sDialog & ".txt" ) + sFileOut = convertpath( sOutputPath & sDialog & ".txt" ) + + printlog( "Open <" & sDialog & "> and access the treelist object" ) + + ' Note: hGetAllNodeNames() is a *global* function defined in t_treelist_tools.inc + ' DLG_BASIC_ORG and DLG_RUN_MACRO have - in addition to the treelist - + ' a separate script list. To get those scripts a little more effort is + ' required which is done in the *local* function hGetScriptNames() + + select case ( sDialog ) + case DLG_JAVASCRIPT: ToolsMacrosOrganizeMacrosJavaScript + kontext "ScriptOrganizer" + hGetAllNodeNames( ScriptTreeList, cScriptNamesList() ) + max_diffcount = 0 + case DLG_BEANSHELL: ToolsMacrosOrganizeMacrosBeanShell + kontext "ScriptOrganizer" + hGetAllNodeNames( ScriptTreeList, cScriptNamesList() ) + max_diffcount = 0 + case DLG_PYTHON: ToolsMacrosOrganizeMacrosPython + kontext "ScriptOrganizer" + hGetAllNodeNames( ScriptTreeList, cScriptNamesList() ) + max_diffcount = 0 + case DLG_BASIC_ORG: ToolsMacro_uno + Kontext "Makro" + hGetScriptNames( MakroAus, MakroListe, cScriptNamesList() ) + max_diffcount = 6 + case DLG_RUN_MACRO: ToolsMacrosRunMacro + kontext "ScriptSelector" + hGetScriptNames( LibraryTreeList, ScriptList, cScriptNamesList() ) + max_diffcount = 6 + end select + + printlog( "Compare to reference list, create new one if differences were found" ) + iDiffCount = abs( hManageComparisionList( sFileIn, sFileOut, cScriptNamesList() ) ) + + ' Usually we should have 0 differences in the list. However, as we do not have + ' a unique way of installing the office (Root-Installation, archives and + ' others) we need a little tolerance here. If a number of bundled extensions + ' are installed, we have more scripts. + if ( iDiffCount > max_diffcount ) then warnlog( "The number of scripts has changed, please review." ) + + printlog( "Close <" & sDialog & ">" ) + select case ( sDialog ) + case DLG_JAVASCRIPT : + ScriptOrganizer.cancel() + case DLG_BEANSHELL : + ScriptOrganizer.cancel() + case DLG_PYTHON : + ScriptOrganizer.cancel() + case DLG_BASIC_ORG : + Makro.close() + case DLG_RUN_MACRO : + ScriptSelector.cancel() + end select + + next iCurrentDialog + + hCloseDocument() + +endcase -***** +'******************************************************************************* sub hGetScriptNames( oTreeList as object, oScriptList as object, cItemList() as string ) diff --git a/testautomation/framework/required/includes/tools_customize.inc b/testautomation/framework/required/includes/tools_customize.inc index 93d0fb819ba8..3111026d2e0e 100644 --- a/testautomation/framework/required/includes/tools_customize.inc +++ b/testautomation/framework/required/includes/tools_customize.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,35 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Update Test for the Tools Customize Dialog +'* +'\****************************************************************************** + +testcase tUpdtCustomize( cApp as string ) + + printlog( "Tools/Customize dialog" ) + + if ( hCreateDocument() ) then + if ( hToolsCustomizeOpen() ) then + hUpdtToolsCustomizeKeyboard() + hUpdtToolsCustomizeMenu() + hUpdtToolsCustomizeToolbars() + hUpdtToolsCustomizeEvents() + hCloseDialog( TabCustomizeEvents, "cancel" ) + else + warnlog( "Tools/Customize dialog did not open" ) + endif + hDestroyDocument + else + warnlog( "Failed to create initial document" ) + endif + +endcase -***** +'******************************************************************************* function hUpdtToolsCustomizeMenu() diff --git a/testautomation/framework/required/includes/topten.inc b/testautomation/framework/required/includes/topten.inc index 5be2e385305e..9c7502b7de77 100644 --- a/testautomation/framework/required/includes/topten.inc +++ b/testautomation/framework/required/includes/topten.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,42 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Smoke test (load/save/clipboard) +'* +'\*********************************************************************** + +sub topten + + ' we need the binary filters (.sxw etc.) for this test but beginning with + ' OOo 3.3 these are optional + if ( hCheckForBinfilters() ) then + gApplication = "WRITER" + call Top_ten_test + + gApplication = "CALC" + call Top_ten_test + + gApplication = "IMPRESS" + call Top_ten_test + + gApplication = "DRAW" + call Top_ten_test -***** + gApplication = "MATH" + call Top_ten_test + + gApplication = "HTML" + call Top_ten_test + + gApplication = "MASTERDOCUMENT" + call Top_ten_test + endif +end sub + +'******************************************************************************* testcase Top_ten_test diff --git a/testautomation/framework/required/includes/window_functions.inc b/testautomation/framework/required/includes/window_functions.inc index 63060ef890c2..2334712357fe 100755 --- a/testautomation/framework/required/includes/window_functions.inc +++ b/testautomation/framework/required/includes/window_functions.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,121 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Window/Titlebar functionality +'* +'\****************************************************************************** + +testcase tWindowFunctions + + printlog( "Update test for window functions" ) + + printlog( "Create initial document" ) + gApplication = "WRITER" + hInitSingleDoc() + hInitWriteDocIdentifier( "F_updt_windowfuncs.bas" ) + + printlog( "New document" ) + hNewDocument() + if ( getDocumentCount <> 2 ) then + warnlog( "Two open documents were expected, found " & getDocumentCount ) + endif + + kontext "DocumentWriter" + printlog( "Close document" ) + DocumentWriter.close() + + if ( getDocumentCount <> 1 ) then + warnlog( "One open document was expected, found " & getDocumentCount ) + endif + + printlog( "New document" ) + hNewDocument() + if ( getDocumentCount <> 2) then + warnlog( "Two open documents were expected, found " & getDocumentCount ) + endif + + printlog( "Enter some text into the second writer document" ) + kontext "DocumentWriter" + DocumentWriter.TypeKeys( "test" ) + DocumentWriter.close() + + kontext "active" + if ( Active.exists() ) then + printlog( "Close messagebox with Cancel (leaves the document open)" ) + Active.Cancel() + else + warnlog( "No warning that data will be lost on close of this document" ) + endif + + kontext "DocumentWriter" + if ( getDocumentCount = 2 ) then + printlog( "Two documents open. Good." ) + else + warnlog( "Incorrect document count. Expected two, found " & getDocumentCount ) + endif + + kontext "DocumentWriter" + printlog( "Close the document" ) + FileClose() -***** + kontext "Active" + if ( Active.exists() ) then + printlog( "Do not save the document" ) + Active.No() + else + warnlog( "Warning: No data loss warning" ) + endif + + kontext "DocumentWriter" + if ( getDocumentCount = 1 ) then + printlog( "One document open. Good." ) + else + warnlog( "Incorrect document count. Expected one, found " & getDocumentCount ) + endif + + Kontext "DocumentWriter" + printlog( "Minimize window" ) + DocumentWriter.Minimize() + Wait( 2000 ) + + kontext "DocumentWriter" + if ( DocumentWriter.IsMin() ) then + printlog( "Window is minimized" ) + else + warnlog( "Window not minimized" ) + endif + + kontext "DocumentWriter" + printlog( "Restore window" ) + DocumentWriter.Restore() + Wait( 2000 ) + + if ( DocumentWriter.IsRestore() ) then + printlog( "Window is Restored" ) + else + warnlog( " * Window not Restored" ) + endif + + kontext "DocumentWriter" + printlog( "Maximize window" ) + DocumentWriter.Maximize() + Wait( 2000 ) + + kontext "DocumentWriter" + if ( DocumentWriter.IsMax() ) then + printlog( "Window is maximized" ) + else + warnlog( " * Window not maximized" ) + endif + + hDestroyDocument() + +endcase + +'******************************************************************************* sub sAllWindowTitle diff --git a/testautomation/framework/required/includes/wizard_mailmerge.inc b/testautomation/framework/required/includes/wizard_mailmerge.inc index a35e3fe2dcca..edf74a264240 100644 --- a/testautomation/framework/required/includes/wizard_mailmerge.inc +++ b/testautomation/framework/required/includes/wizard_mailmerge.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,180 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Update test for the mailmerge wizard +'* +'\****************************************************************************** + +private CSV_DATABASE as string + +testcase tUpdtWizardMailMerge + + printlog( "Resource test for the mailmerge wizard" ) + + dim brc as boolean + dim irc as integer + + qaerrorlog( "#i54524# - MM-Wizard modifies datasource -> CVS merge conflict" ) + + CSV_DATABASE = hGetWorkPath() & "myDatabase" + hDeleteFile( CSV_DATABASE ) + hRemoveDatabaseConnections() + + + hInitSingleDoc() + + printlog( "Open the Mailmerge-Wizard" ) + ToolsMailMergeWizard + + Kontext "MailMergeWizard" + brc = hUpdtMMWpage1() + if ( not brc ) then + warnlog( "MailMergeWizard is not visible, aborting test" ) + goto endsub + endif + + Kontext "MailMergeWizard" + hClickButton( NextButton ) + hUpdtMMWPage2() + + Kontext "MailMergeWizard" + hClickButton( NextButton ) + hUpdtMMWpage3() + + Kontext "MailMergeWizard" + hClickButton( NextButton ) + hUpdtMMWPage4() + + Kontext "MailMergeWizard" + hClickButton( NextButton ) + hUpdtMMWPage5() + + Kontext "MailMergeWizard" + hClickButton( NextButton ) + hUpdtMMWPage6() + + Kontext "MailMergeWizard" + hClickButton( NextButton ) + hUpdtMMWPage7() + + Kontext "MailMergeWizard" + hClickNextButton() + hUpdtMMWPage8() + + printlog( "close the wizard" ) + Kontext "MailMergeWizard" + hCloseDialog( MailMergeWizard, "cancel" ) + + hRemoveDatabaseConnections() + hCloseDocument() + hCloseDocument() + + +endcase + +'********************************************************************** + +function hUpdtMMWpage1() as boolean + + + + const CFN = "hUpdtMMWpage1::" + + Kontext "TabMailMergeSourceDocument" + if ( not TabMailMergeSourceDocument.exists() ) then + warnlog( CFN & "Page 1 could not be accessed" ) + hUpdtMMWPage1() = false + exit function + endif + + Kontext "TabMailMergeSourceDocument" + if ( BrowseDocument.exists( 1 ) ) then + if ( BrowseDocument.isEnabled ) then + BrowseDocument.click() + + Kontext "OeffnenDlg" + if ( OeffnenDlg.exists( 1 ) ) then + printlog( CFN & "BrowseDocument::File Open Dialog" ) + call dialogtest( OeffnenDlg ) + OeffnenDlg.cancel() + else + warnlog( CFN & "BrowseDocument::FileOpen not open" ) + endif + else + warnlog( CFN & "BrowseDocument::Button is disabled" ) + endif + else + warnlog( CFN & "BrowseDocument::Button does not exist" ) + endif + + Kontext "TabMailMergeSourceDocument" + if ( BrowseTemplate.exists( 2 ) ) then + if ( BrowseTemplate.isEnabled ) then + BrowseTemplate.click() + + Kontext "Neu" + if ( Neu.exists( 1 ) ) then + printlog( CFN & "BrowseTemplate::New Dialog" ) + call dialogtest( Neu ) + Neu.cancel() + else + warnlog( CFN & "BrowseTemplate::FileOpen not open" ) + endif + else + warnlog( CFN & "BrowseTemplate::Button is disabled" ) + endif + else + warnlog( CFN & "BrowseTemplate::Button does not exist" ) + endif + + kontext "TabMailMergeSourceDocument" + if ( CreateANewDocument.exists( 2 ) ) then + if ( CreateANewDocument.isEnabled ) then + printlog( CFN & "Check Create new Document" ) + CreateANewDocument.check() + else + warnlog( CFN & "CheckBbox is disabled" ) + endif + else + warnlog( CFN & "CheckBox does not exist" ) + endif -***** + hUpdtMMWPage1() = true + +end function + +'********************************************************************** + +function hUpdtMMWpage2() + + + const CFN = "hUpdtMMWpage2::" + + Kontext "TabMailMergeDocumentType" + if ( not TabMailMergeDocumentType.exists( 2 ) ) then + warnlog( CFN & "Page 2 could not be accessed" ) + exit function + endif + + call dialogtest( TabMailMergeDocumentType ) + + printlog( CFN & "Select to create a letter" ) + if ( Letter.exists() ) then + if ( Letter.isEnabled() ) then + Letter.check() + else + warnlog( CFN & "Cannot check Letter-Checkbox" ) + endif + else + warnlog( CFN & "Letter Checkbox does not exist" ) + endif + +end function + +'******************************************************************************* function hUpdtMMWpage3() diff --git a/testautomation/framework/tools/includes/CJK_tools.inc b/testautomation/framework/tools/includes/CJK_tools.inc index 783f270b1ffb..c387c0275d8d 100644 --- a/testautomation/framework/tools/includes/CJK_tools.inc +++ b/testautomation/framework/tools/includes/CJK_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,40 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Tools for CJK feature test in Writer +'* +'\*********************************************************************** + +function CheckAsianLanguageSupport( sSupport as String ) as String -****' + ToolsOptions + Call hToolsOptions("LANGUAGESETTINGS","LANGUAGES") + + if ( aktivieren.exists() ) then + if ( aktivieren.isEnabled() ) then + if ( lcase( sSupport ) = "on" ) then + printlog( "Enabling Asian Language Support" ) + Aktivieren.Check + else + printlog( "Disabling Asian Language Support" ) + Aktivieren.uncheck() + endif + else + warnlog( "Activate Asian Language Support checkbox is disabled" ) + endif + else + warnlog( "Activate Asian Language Support checkbox is missing" ) + endif + + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK() + +end function + +'******************************************************************************' function fStartupNavigator(navigatorItem as String , subItemNum as Integer) Dim j as Integer diff --git a/testautomation/framework/tools/includes/customize_tools.inc b/testautomation/framework/tools/includes/customize_tools.inc index 206e4cc4ce55..6b0e3b46a11d 100644 --- a/testautomation/framework/tools/includes/customize_tools.inc +++ b/testautomation/framework/tools/includes/customize_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,22 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Tools to ease the use of the ToolsCustomize-Dialog +'* +'\****************************************************************************** -***** +function hToolsCustomizeOpen() as boolean + + printlog( "Open Tools/Customize dialog" ) + ToolsCustomize + hToolsCustomizeOpen() = hToolsCustomizeSelectTab( "Events" ) + +end function + +'******************************************************************************* function hToolsCustomizeSelectTab( cTab as string ) as boolean diff --git a/testautomation/framework/tools/includes/fileoperations.inc b/testautomation/framework/tools/includes/fileoperations.inc index a2ece1201f84..648fe235f70a 100644 --- a/testautomation/framework/tools/includes/fileoperations.inc +++ b/testautomation/framework/tools/includes/fileoperations.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,113 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : check the internal file dialog ( extended tests ) +'* +'\****************************************************************************** + +function hSaveLoadDelSuccess( cFile as string ) as integer + + '///<h3>Successfully save, close, load, close and delete a file</h3> + '///<i>Uses</i>: framework\tools\t_stringtools.inc<br><br> + '///<u>Input</u>: + '///<ol> + '///+<li>Filename incl. extension (string)</li> + '///</ol> + '///<u>Returns</u>: + '///<ol> + '///+<li>Errorcode (integer)</li> + '///<ul> + '///+<li>0 = all ok</li> + '///+<li>1 = Saving failed</li> + '///+<li>2 = Closing the file failed</li> + '///+<li>3 = Reloading failed</li> + '///+<li>4 = Closing the file failed</li> + '///+<li>5 = Deleting failed</li> + '///+<li>-1 = Post operation error</li> + '///</ul> + '///</ol> + '///<u>Description</u>: + '///<ul> + + dim brc as boolean + dim cFileExt as string : cFileExt = cFile & hGetSuffix( "current" ) + + const CFN = "hSaveLoadDelSuccess::" + + printlog( "" ) + printlog( CFN & "Enter with option: " & cFile & "/" & cFileExt ) + + '///+<li>Close the navigator if it exists</li> + kontext "Navigator" + hCloseDialog( Navigator, "close,optional" ) + + '///+<li>Save the current file, overwriting existing</li> + brc = hSaveFileExpectSuccess( cFile , TRUE ) ' save and overwrite + if ( brc ) then -***** + '///+<li>Close the file</li> + brc = hDestroyDocument() + if ( brc ) then + + '///+<li>Reload the file</li> + brc = hLoadFileExpectSuccess( cFileExt ) + if ( brc ) then + + '///+<li>Close the document</li> + brc = hDestroyDocument() + if ( brc ) then + + '///+<li>Delete the file via FileOpen</li> + brc = hDeleteFileViaFileOpen( cFileExt ) + if ( brc ) then + printlog( CFN & "Save, close, load, close, delete ok" ) + hSaveLoadDelSuccess() = 0 + else + warnlog( CFN & "Failed to delete file" ) + hSaveLoadDelSuccess() = 5 + endif + + else + warnlog( CFN & "Failed to close file" ) + hSaveLoadDelSuccess() = 4 + endif + + else + warnlog( CFN & "Failed to load file" ) + hSaveLoadDelSuccess() = 3 + endif + + + else + warnlog( CFN & "Closing file failed" ) + hSaveLoadDelSuccess() = 2 + endif + + else + warnlog( CFN & "Saving failed" ) + hSaveLoadDelSuccess() = 1 + endif + + '///+<li>Close possible Messagebox (#i33946#)</li> + kontext "active" + if ( active.exists( 1 ) ) then + printlog( CFN & "Unexpected message: " & active.getText() ) + qaerrorlog( "#i33946# - message when deleting last document in folder" ) + active.ok() + hSaveLoadDelSuccess() = 6 + endif + + '///+<li>Close document</li> + brc = hDestroyDocument() + + '///</ul> + +end function + +'******************************************************************************* function hLoadFileExpectSuccess( fpath as string ) as boolean diff --git a/testautomation/framework/tools/includes/formcontrols.inc b/testautomation/framework/tools/includes/formcontrols.inc index a680be989e79..205b4768c6fc 100644 --- a/testautomation/framework/tools/includes/formcontrols.inc +++ b/testautomation/framework/tools/includes/formcontrols.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,16 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +' ** +' ** short description : Tools to draw and select form controls in basic-ide +' ** +'\****************************************************************************** -***** +private const ICONTROLCOUNT = 22 + +'******************************************************************************* function hGetControlParams( cParam as string ) as integer diff --git a/testautomation/framework/tools/includes/help_tools.inc b/testautomation/framework/tools/includes/help_tools.inc index 3273a1c9eca9..cbcd24741607 100644 --- a/testautomation/framework/tools/includes/help_tools.inc +++ b/testautomation/framework/tools/includes/help_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,31 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Replacements for routines in t_lists.inc adds some +'* +'\****************************************************************************** + +function hOpenHelp() as boolean + + printlog( "Open Help Browser" ) -***** + HelpContents + + kontext "StarOfficeHelp" + if ( StarOfficeHelp.exists( 5 ) ) then + hOpenHelp() = TRUE + else + warnlog( "Unable to open help browser" ) + hOpenHelp() = FALSE + endif + + +end function + +'******************************************************************************* function hCloseHelp() as boolean diff --git a/testautomation/framework/tools/includes/options_tools.inc b/testautomation/framework/tools/includes/options_tools.inc index ae63ca79d6dd..4fb582cfccbe 100644 --- a/testautomation/framework/tools/includes/options_tools.inc +++ b/testautomation/framework/tools/includes/options_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,61 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : tools for options tests +'* +'\****************************************************************************** + +sub GetPathList ( ls1 () as String, ls2 () as String, ls3 () as String ) + + Dim lsInterim ( 50 ) as String + Dim i as Integer + Dim sList as String + Dim bNewCreate as Boolean + '///routine to get the correct comparison list for path-options + '///+ if the list does not exist => CreatePathList + '///+ you can find the lists for all languages in separate files + '///+[TesttoolPath]\framework\options\input\paths_[LanguageCode].txt + ls1 (0) = 0 : ls2 (0) = 0 : ls3 (0) = 0 + sList = gTesttoolPath + "framework\optional\input\options\paths_" + iSprache + ".txt" + sList = convertpath( sList ) + + if App.Dir ( sList ) = "" then + bNewCreate = TRUE + CreatePathList + else + bNewCreate = FALSE + end if + + if bAsianLan = TRUE then + + select case iSystemSprache + case 01, 33, 34, 39, 46, 49 + ListRead ( lsInterim (), sList, "utf8" ) + case else -***** + if bNewCreate = FALSE then + CreatePathList + endif + + ListRead ( lsInterim (), sList, "utf8" ) + end select + + else + ListRead ( lsInterim (), sList , "utf8" ) + end if + + for i = 1 to ListCount ( lsInterim () ) + ListAppend ( ls1 (), Left ( lsInterim (i), Instr ( lsInterim (i), ";" ) - 1 ) ) + ListAppend ( ls2 (), Mid ( lsInterim (i), Len ( lsInterim (i) ) - 2, 1 ) ) + ListAppend ( ls3 (), Right ( lsInterim (i), 1 ) ) + next i + +end sub + +'******************************************************************************* sub CreatePathList diff --git a/testautomation/framework/tools/includes/pbrowser_tools.inc b/testautomation/framework/tools/includes/pbrowser_tools.inc index 43e33c93d9da..e9e870186c04 100644 --- a/testautomation/framework/tools/includes/pbrowser_tools.inc +++ b/testautomation/framework/tools/includes/pbrowser_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,42 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Tools for working with the property browser for formcontrols +'* +'\****************************************************************************** + +function hOpenPropertyBrowser() as boolean + + '///<h3>Open the BASIC property browser</h3> + + const CFN = "framework::tools::includes::pbrowser_tools.inc::hOpenPropertyBrowser(): " -***** + kontext "ControlPropertiesTabControl" + if ( ControlPropertiesTabControl.exists() ) then + printlog( "Property Browser is already open, no action taken" ) + hOpenPropertyBrowser() = true + else + if ( hUseAsyncSlot( "ContextProperties" ) <> -1 ) then + kontext "ControlPropertiesTabControl" + if ( ControlPropertiesTabControl.exists( 2 ) ) then + ControlPropertiesTabControl.setPage( TabGeneralControl ) + hOpenPropertyBrowser() = true + else + warnlog( CFN & "Dialog <ControlPropertiesTabControl> is not available" ) + hOpenPropertyBrowser() = false + endif + else + warnlog( CFN & "Could not execute <ContextProperties> slot" ) + hOpenPropertyBrowser() = false + endif + endif + +end function + +'******************************************************************************* function hClosePropertyBrowser() as boolean diff --git a/testautomation/framework/tools/includes/private_environment.inc b/testautomation/framework/tools/includes/private_environment.inc index 37b9adb39b70..dff2a7bcf8a3 100644 --- a/testautomation/framework/tools/includes/private_environment.inc +++ b/testautomation/framework/tools/includes/private_environment.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,82 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Tools to ease working with private environment +'* +'\****************************************************************************** + +function hGetPrivateHttpServer( _proxy as string, _port as string ) as boolean + + + '///<h3>Retrieve the name and port for a private http server</h3><br> + + '///<u>Function parameters:</u><br> + '///<ol> + + '///+<li>Fully qualified server name incl. domain (string)</li> + '///<ul> + '///+<li>The string comes without a protocol part (no http://)</li> + '///</ul> + + '///+<li>Server port (string)</li> + '///<ul> + '///+<li>Please remember limits for integer data type</li> + '///</ul> + + '///</ol> + + + '///<u>Returns:</u><br> + + '///<ol> + '///+<li>Error condition (boolean)</li> + '///<ul> + '///+<li>"TRUE": Data was retrieved successfully</li> + '///+<li>"FALSE": Any error </li> + '///</ul> + '///</ol> + + use "global\tools\includes\optional\t_key_tools.inc" -***** + const CFN = "hGetPrivateHttpServer::" + dim cFile as string + dim cDataSet( 100 ) as string + dim iErr as integer + + '///<u>Description:</u> + '///<ul> + '///+<li>Get the source file</li> + cFile = hGetPrivateInputFile( false ) + printlog( CFN & "Using input file: " & cFile ) + + '///+<li>Retrieve the information from the datafile</li> + iErr = hGetDataFileSection( cFile, cDataSet(), "http_proxy", "", "" ) + if ( iErr = 0 ) then + hGetPrivateHttpServer() = false + exit function + endif + + '///+<li>Extract the proxy name</li> + _proxy = hGetValueForKeyAsString( cDataSet(), "name" ) + + '///+<li>Append the domain</li> + _proxy = _proxy & hGetValueForKeyAsString( cDataSet(), "domain" ) + + '///+<li>Get the port</li> + _port = hGetValueForKeyAsString( cDataSet() , "port" ) + + '///+<li>Print a log</li> + printlog( CFN & _proxy & ":" & _port ) + '///</ul> + + hGetPrivateHttpServer() = true + +end function + +'******************************************************************************* function hGetPrivateFtpServer( _proxy as string, _port as string ) as boolean diff --git a/testautomation/framework/tools/includes/scriptorganizer_tools.inc b/testautomation/framework/tools/includes/scriptorganizer_tools.inc index 60edfe213bbf..2e569bf3ea00 100644 --- a/testautomation/framework/tools/includes/scriptorganizer_tools.inc +++ b/testautomation/framework/tools/includes/scriptorganizer_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,71 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Test scripting-organizers / document-attached scripts +'* +'\****************************************************************************** + +function hCreateScriptingObject( cName as string ) as boolean + + '///<h3>Create a new scripting object for the current module</h3> + '///<i>Starting point: Script organizer is open, module selected</i><br> + '///<u>Input</u>: + '///<ol> + '///+<li>Name of the module (string)</li> + '///<ul> + '///+<li>Any name the organizer can accept</li> + '///</ul> + '///</ol> + '///<u>Returns</u>: + '///<ol> + '///+<li>Errorcondition</li> + '///<ul> + '///+<li>TRUE on success</li> + '///+<li>FALSE on failure or invalid user input</li> + '///</ul> + '///</ol> + '///<u>Description</u>: + '///<ul> + + + const CFN = "hNewScriptingObject::" + + '///+<li>Verify that the "Create..." button is enabled</li> + if ( PBCreate.isEnabled() ) then + + '///+<li>Click "Create..." to open the naming dialog</li> + hClickButton( PBCreate ) + + '///+<li>Name the new script</li> + Kontext "ScriptNameDlg" + if ( ScriptNameDlg.exists( 2 ) ) then + + EFObjectName.setText( cName ) + ScriptNameDlg.OK() + hCreateScriptingObject() = true + + endif -***** + else + printlog( CFN & "Button is disabled" ) + hCreateScriptingObject() = false + endif + + '///+<li>Verify that we are back on the script organizer</li> + kontext "ScriptOrganizer" + if ( not ScriptOrganizer.exists( 2 ) ) then + warnlog( CFN & "Could not return to ScriptOrganizer" ) + hCreateScriptingObject() = false + endif + + '///</ul> + +end function + +'******************************************************************************* function hRenameScriptingObject( cName as string ) as boolean diff --git a/testautomation/framework/tools/includes/spadmin_tools.inc b/testautomation/framework/tools/includes/spadmin_tools.inc index a361315bcf6e..f3ca99b74703 100644 --- a/testautomation/framework/tools/includes/spadmin_tools.inc +++ b/testautomation/framework/tools/includes/spadmin_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,65 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : helper functions for SPAdmin +'* +'\****************************************************************************** + +function hGetPrinterPosition( cName as string, bWarn as boolean ) as integer + + '///<h3>Find a printer queue in the SpAdmin list</h3> + ' IN: + ' cName = Name of the queue to look for + ' bWarn = if TRUE we warn if the queue does not exist + + const CFN = "hGetPrinterPosition::" + + if ( cName = "" ) then + warnlog( CFN & "Invalid Parameter passed to function: Empty String" ) + hGetPrinterPosition() = -1 + exit function + endif + + dim iCurrentQueue as integer + dim bFound as boolean + dim iPrinterCount as integer + iPrintercount = LBPrinters.getItemCount() -***** + Kontext "SpAdmin" + bFound = false + + for iCurrentQueue = 1 to iPrinterCount + + wait( 200 ) + + LBPrinters.select( iCurrentQueue ) + if ( LBPrinters.getseltext() = cName ) then + bFound = true + exit for + endif + + next iCurrentQueue + + ' warn if queue was not found and we requested a warning + if ( not bFound and bWarn ) then + iCurrentQueue = 0 + printlog( CFN & "The specified printer queue could not be found" ) + endif + + ' print a message that the printer queue exists + if ( bFound ) then + printlog( CFN & "Printer Queue was found at pos " & iCurrentQueue ) + endif + + Kontext "SpAdmin" + hGetPrinterPosition() = iCurrentQueue + +end function + +'******************************************************************************* function hDelPrinter( cPrinterName as string ) as integer diff --git a/testautomation/framework/tools/includes/template_tools.inc b/testautomation/framework/tools/includes/template_tools.inc index c625313cb545..b56ca58de3b1 100644 --- a/testautomation/framework/tools/includes/template_tools.inc +++ b/testautomation/framework/tools/includes/template_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,108 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Helper functions to ease usage of templates +'* +'\****************************************************************************** + +function hFindTemplate( sTemplateName as string ) as integer + + '///<H3>Find a template by name in FileNewFromTemplate</H3> + '///<i>Starting point: Templates and Documents dialog</i><br> + '///<u>Input</u>: + '///<ol> + '///+<li> Name of the template to search for (string)</li> + '///</ol> + '///<u>Returns</u>: + '///<ol> + '///+<li> Index of the Template in the containing folder (integer)</li> + '///<ul> + '///+<li>1 ... n : Index of the template (Position in folder)</li> + '///+<li>0 : No template found by given name</li> + '///</ul> + '///</ol> + '///<u>Description</u>: + '///<ul> + const CFN = "hFindTemplate::" + + dim brc as boolean + brc = false + dim irc as integer + irc = 0 + + dim iObjectFolder as integer + dim iObjectFolders as integer + + dim iItemCount as integer + dim iCurrentItem as integer + dim cCurrentItem as string + + '///+<li>select the templates from the category list</li> + hSelectCategory( "TEMPLATES" ) + + '///+<li>run through every item in the list to find the template.</li> + ' NOTE: If the name of the template is not unique, the function will find + ' the first occurrence + ' NOTE: As we do not know the name of "My Templates" (it is localized) we + ' need to search all folders.. + iObjectFolders = FileList.getItemCount() + + '///<ul> + for iObjectFolder = 1 to iObjectFolders + + '///+<li>Select the (next) folder</li> + hSelectFileFolder( iObjectFolder , true ) -***** + '///+<li>Retrieve the number of items within the folder</li> + iItemCount = FileList.getItemCount() + + '///+<li>For each item in the folder do:</li> + '///<ul> + for iCurrentItem = 1 to iItemCount + + '///+<li>Select the (next) item</li> + FileList.select( iCurrentItem ) + + '///+<li>Get the name of the item</li> + cCurrentItem = FileList.getSelText() + + '///+<li>If this is the item we are searching for, exit</li> + if ( cCurrentItem = sTemplateName ) then + irc = iCurrentItem : if ( irc = 0 ) then irc = 1 ' strange hack + brc = true + exit for + endif + + next iCurrentItem + '///</ul> + + '///+<li>Exit the outer loop</li> + if ( brc ) then + exit for + endif + + '///+<li>Click "Up one level"</li> + UpOneLevel.click() + + next iObjectFolder + '///</ul> + + if ( brc ) then + printlog( CFN & "Template found: " & cCurrentItem ) + else + printlog( CFN & "Template could not be found." ) + endif + + '///+<li>Return the index of the requested template</li> + hFindTemplate() = irc + '///</ul> + +end function + +'******************************************************************************* function hSelectCategory( cCategory as string ) as boolean diff --git a/testautomation/framework/tools/includes/toolbar_tools.inc b/testautomation/framework/tools/includes/toolbar_tools.inc index 977ed6c4c4ed..80d92b4423d1 100644 --- a/testautomation/framework/tools/includes/toolbar_tools.inc +++ b/testautomation/framework/tools/includes/toolbar_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,67 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : global update test (Standardbar) +'* +'\*************************************************************************** + +function hAccessStandardBar() as boolean + + '///<h3>Verify that the Standard Bar exists</h3> + '///<i>This function works for all gApplications</i><br> + '///<u>Input</u>: + '///<ol> + '///+<li>Nothing</li> + '///</ol> + '///<u>Returns</u>: + '///<ol> + '///+<li>Errorcondition (boolean)</li> + '///<ul> + '///+<li>TRUE if StandardBar exists</li> + '///+<li>FALSE if standardBar does not exist</li> + '///</ul> + '///</ol> + '///<u>Description</u>: + '///<ul> + const CFN = "hAccessStandardBar::" + dim brc as boolean + + printlog( CFN & "Enter" ) + + '///+<li>Open a new document</li> + hCreateDocument() + + '///+<li>Try to access the standardbar (query .exists())</li> + kontext "StandardBar" + if ( StandardBar.exists() ) then + if ( standardbar.isVisible() ) then + printlog( CFN & "StandardBar is visible. Good." ) + brc = true + else + warnlog( "The StandardBar is not visible in " & gApplication ) + brc = false + endif + else + warnlog( "The StandardBar does not exist in " & gApplication ) + brc = false + endif -***** + '///+<li>Close the navigator</li> + kontext "Navigator" + hCloseDialog( Navigator, "close,optional" ) + + '///+<li>Close the document</li> + hDestroyDocument() + hAccessStandardBar() = brc + printlog( CFN & "Exit" ) + '///</ul> + +end function + +'******************************************************************************* function hResetStandardBar() as boolean diff --git a/testautomation/framework/tools/includes/wizards.inc b/testautomation/framework/tools/includes/wizards.inc index 8ace19ea4c65..937f63c094e8 100644 --- a/testautomation/framework/tools/includes/wizards.inc +++ b/testautomation/framework/tools/includes/wizards.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,101 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : helper functions for the wizards +'* +'\****************************************************************************** + +function hWaitForWizard() as integer + + const CFN = "hWaitForWizard::" + const MAXTRIES = 10 + + '///<h3>Wait for any wizard to open</h3> + '///<i>Uses: framework/tools/input/menuentries.txt</i><br> + '///<i>NOTE: Not all wizards are known to this function yet.</i><br> + '///<u>Input</u>: + '///<ol> + '///+<li>Nothing</li> + '///</ol> + '///<u>Returns</u>: + '///<ol> + '///+<li>Unique ID of the open wizard</li> + '///<ul> + '///+<li>0: In case of any error</li> + '///+<li>1-n: The unique ID of the currently open wizard (integer)</li> + '///+</ul> + '///</ol> + '///<u>Description</u>: + '///<ul> + + dim iOpen as integer + dim iWait as integer -***** + '///+<li>Determine the open wizard by trying wizard.exists()</li> + for iWait = 1 to MAXTRIES + + iOpen = 0 + + kontext "AutopilotLetter" + if ( AutopilotLetter.exists() ) then + printlog( CFN & "Autopilot Letter is open" ) + iOpen = hGetWizardParams( "LETTER" , "ID" ) + exit for + endif + + kontext "AutopilotFax" + if ( AutopilotFax.exists() ) then + printlog( CFN & "Autopilot Fax is open" ) + iOpen = hGetWizardParams( "FAX" , "ID" ) + exit for + endif + + kontext "AutopilotAgenda" + if ( AutopilotAgenda.exists() ) then + printlog( CFN & "Autopilot Agenda is open" ) + iOpen = hGetWizardParams( "AGENDA" , "ID" ) + exit for + endif + + Kontext "MailMergeWizard" + if ( MailMergeWizard.exists() ) then + printlog( CFN & "Mailmerge Wizard is open" ) + iOpen = hGetWizardParams( "MAILMERGE" , "ID" ) + exit for + endif + + Kontext "AutopilotPraesentation1" + if ( AutopilotPraesentation1.exists() ) then + printlog( CFN & "Presentation Wizard is open" ) + iOpen = hGetWizardParams( "IMPRESS" , "ID" ) + exit for + endif + + Kontext "AutoPilotEuroKonverter" + if ( AutoPilotEuroKonverter.exists() ) then + printlog( CFN & "Euro Converter is open" ) + iOpen = hGetWizardParams( "EUROCONV" , "ID" ) + exit for + endif + + Kontext "DocumentConverter" + if ( DocumentConverter.exists( 1 ) ) then + printlog( CFN & "Document Converter is open" ) + iOpen = hGetWizardParams( "DOCCONV" , "ID" ) + exit for + endif + + next iWait + + hWaitForWizard() = iOpen + '///</ul> + +end function + +'******************************************************************************* function hSetTemplateSavePath( cFile as string ) as integer diff --git a/testautomation/global/required/includes/g_findbar.inc b/testautomation/global/required/includes/g_findbar.inc index f237d286c48c..b6537ae70d9e 100644 --- a/testautomation/global/required/includes/g_findbar.inc +++ b/testautomation/global/required/includes/g_findbar.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,120 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Update test for the findbar +'* +'\*********************************************************************** + +testcase tUpdtFindBar() + + ' This test is incomplete. It needs to be integrated into all update tests + ' and it needs to be added to the toolbar management functions + + printlog( "Update test for the findbar" ) + + const TEST_STRING = "VCL Testtool" + + select case( gApplication ) + case "IMPRESS", "DRAW", "DATABASE" + kontext "FindBar" + if ( FindBar.exists() ) then + warnlog( "The FindBar should not be visible by default" ) + endif + end select + + hNewDocument() + + kontext "FindBar" + if ( FindBar.exists() ) then + + printlog( "FindBar has " & FindBar.getItemCount() & " items" ) + + printlog( "Insert text into search field" ) + FindText.setText( TEST_STRING ) + + printlog( "Click <Find next> (down arrow)" ) + DownSearch.click() + + kontext "Active" + if ( Active.exists( 1 ) ) then + printlog( "Expected message: " & Active.getText() + call DialogTest( Active ) + + kontext "Active" + Active.ok() + else + warnlog( "Messagebox missing <No matches found>" ) + endif + + printlog( "Click <Find last> (up arrow)" ) + kontext "FindBar" + UpSearch.click() + + kontext "Active" + if ( Active.exists( 1 ) ) then + printlog( "Expected message: " & Active.getText() + call DialogTest( Active ) + + kontext "Active" + Active.ok() + else + warnlog( "Messagebox missing <No matches found>" ) + endif + + qaerrorlog( "#i111984 - exclude <SearchDialog> button from testing" ) + goto skip_SearchDialog + + printlog( "Search dialog button may not be visible by default" ) + kontext "FindBar" + if ( SearchDialog.exists() ) then + if ( SearchDialog.isVisible() ) then + SearchDialog.click() + warnlog( "Button <Search Dialog> is visible, it should be hidden by default" ) + else + printlog( "Button <Search Dialog> is hidden, good" ) + endif + else + warnlog( "<Search Dialog> button should not be visible" ) + endif + + printlog( "Add <Search Dialog> button to toolbar" ) + hToggleSearchDialog() + + kontext "FindBar" + SearchDialog.click() + + kontext "FindAndReplace" + if ( FindAndReplace.exists( 1 ) ) then + call DialogTest( FindAndReplace ) + + kontext "FindAndReplace" + if ( SearchFor.getSelText() = TEST_STRING ) then + printlog( "Test string has been inserted into <SearchFor> Listbox. Good." ) + else + warnlog( "Search string should have been copied from findbar to search dialog" ) + endif + FindAndReplace.close() + else + warnlog( "Dialog <Search And Replace> is missing" ) + endif + + printlog( "Remove <Search Dialog> button from toolbar" ) + hToggleSearchDialog() + + skip_SearchDialog: + + else + warnlog( "FindBar is not visible" ) + endif + + hCloseDocument() + +endcase -***** +'******************************************************************************* function hToggleSearchDialog() diff --git a/testautomation/global/required/includes/g_printing.inc b/testautomation/global/required/includes/g_printing.inc index 2ec0ebbac9e2..022b5e882b90 100644 --- a/testautomation/global/required/includes/g_printing.inc +++ b/testautomation/global/required/includes/g_printing.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,16 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Resource test for the printing dialog +'* +'\****************************************************************************** -***** +private const MSG1 = "Incorrect default setting: " + +'******************************************************************************* sub g_printing() diff --git a/testautomation/global/tools/includes/optional/t_accels.inc b/testautomation/global/tools/includes/optional/t_accels.inc index c750067e92ef..7a985c2f86f9 100644 --- a/testautomation/global/tools/includes/optional/t_accels.inc +++ b/testautomation/global/tools/includes/optional/t_accels.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -***** +' +'************************************************************** +'* +'* short description : handle accelerators +'* +'******************************************************************************* '** ' #1 hGetAccel ' function to retrieve a language specific accelerator '** diff --git a/testautomation/global/tools/includes/optional/t_basic_ide_tools.inc b/testautomation/global/tools/includes/optional/t_basic_ide_tools.inc index bdc4ab586a29..a7f68d4f3035 100644 --- a/testautomation/global/tools/includes/optional/t_basic_ide_tools.inc +++ b/testautomation/global/tools/includes/optional/t_basic_ide_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,73 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +' ** +' ** short description : tools for the property-browser test +' ** +'\****************************************************************************** + +function hShowMacroControls() as boolean + + '///<h3>Tear off the ToolsCollectionBar from the MacroBar</h3> + '///<i>Starting point: Basic dialog editor is open and has the focus</i> + '///<ul> + const CFN = "hShowMacroControls::" -***** + const MAX_WAIT = 5 + const SHORT_WAIT = 1 + + const VERTICALLY_CENTERED = 50 + const HORIZONTALLY_CENTERED = 50 + + if ( GVERBOSE ) then printlog( CFN & "Enter" ) + + '///+<li>Test whether the ToolsCollectionBar is already open. If yes, exit directly</li> + kontext "ToolsCollectionBar" + if ( ToolsCollectionBar.exists( SHORT_WAIT ) ) then + printlog( CFN & "ToolsCollectionBar is already open." ) + hShowMacroControls() = true + exit function + endif + + '///+<li>Verify that the Dialog Bar is available</li> + Kontext "DialogBar" + if ( DialogBar.exists( MAX_WAIT ) ) then + + '///+<li>Verify that the controls-button is enabled</li> + try + '///+<li>Click on the controls-button to open the ToolsCollectionBar</li> + controls.click() + + '///+<li>Tear off the ToolsCollectionBar from the DialogBar</li> + controls.tearOff() + + '///+<li>Verify that the ToolsCollectionBar is visible and can be accessed</li> + kontext "ToolsCollectionBar" + if ( ToolsCollectionBar.exists( MAX_WAIT ) ) then + + '///+<li>Move it to the upper left corner at pos 50/50</li> + ToolsCollectionBar.Move ( HORIZONTALLY_CENTERED , VERTICALLY_CENTERED ) + printlog( CFN & "ToolsCollectionBar is open and has been placed" ) + hShowMacroControls() = true + else + printlog( CFN & "ToolsCollectionBar is not available. Aborting." ) + hShowMacroControls() = false + endif + catch + printlog( CFN & "The Controls-Button is not enabled. Aborting." ) + hShowMacroControls() = false + endcatch + else + printlog( CFN & "The Dialog Bar is not available. Aborting." ) + hShowMacroControls() = false + endif + '///</ul> + +end function + +'******************************************************************************* function hGetBasicWorkFile( cMajorID as string ) as string diff --git a/testautomation/global/tools/includes/optional/t_basic_organizer_tools.inc b/testautomation/global/tools/includes/optional/t_basic_organizer_tools.inc index ff392128c4bc..934ba399bef2 100644 --- a/testautomation/global/tools/includes/optional/t_basic_organizer_tools.inc +++ b/testautomation/global/tools/includes/optional/t_basic_organizer_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,49 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +' ** +' ** short description : tools for tools/macro test +' ** +'\****************************************************************************** + +function hSelectTheLastModule( bEditEnabled as Boolean ) as string + + '///<h3>Select the last (editable) module in the macro seletor treelist</li> + + use "global\tools\includes\optional\t_treelist_tools.inc" + + const CFN = "hSelectTheLastModule()::" + + dim bCloseDialog as boolean : bCloseDialog = FALSE + dim iNodeCount as integer + dim iCurrentNode as integer + + hSelectTheLastModule() = "" + + kontext "Makro" + if ( not Makro.exists() ) then ToolsMacro_uno : bCloseDialog = TRUE + + kontext "Makro" + iNodeCount = hSelectTheLastNode( MakroAus ) + + if ( bEditEnabled ) then + for iCurrentNode = iNodeCount to 1 step -1 + if ( Bearbeiten.isEnabled() ) then + printlog( CFN & "Editable module found at pos: " & iCurrentNode ) + exit for + endif + next iCurrentNode + else + printlog( CFN & "Module selected at pos: " & iNodeCount ) + endif + + if ( iCurrentNode > 1 ) then hSelectTheLastModule = MakroAus.getSelText() + +end function -***** +'******************************************************************************* function hCreateModuleForDoc( optional cName as string ) as boolean diff --git a/testautomation/global/tools/includes/optional/t_control_objects.inc b/testautomation/global/tools/includes/optional/t_control_objects.inc index b2928ea63ac0..e0c94ca308ae 100644 --- a/testautomation/global/tools/includes/optional/t_control_objects.inc +++ b/testautomation/global/tools/includes/optional/t_control_objects.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,16 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Functions to manipulate controls by accessing them as objects +'* +'\****************************************************************************** -***** +private const MSG1 = "Incorrect default setting: " + +'******************************************************************************* function cb_test( oControl as object, def_state as string, issueid as string ) as boolean diff --git a/testautomation/global/tools/includes/optional/t_docfuncs.inc b/testautomation/global/tools/includes/optional/t_docfuncs.inc index 01441679ec69..2e1f1b0ab1ee 100644 --- a/testautomation/global/tools/includes/optional/t_docfuncs.inc +++ b/testautomation/global/tools/includes/optional/t_docfuncs.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,65 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : misc functions to handle documents +'* +'\****************************************************************************** + +function hUseImpressAutopilot( bEnable as boolean ) as boolean + + '///<h3>Enable/disable the Impress Autopilot in Tools/Options</h3> + '///<i>Starting point: Any plain document</i> + '///<ul> + const CFN = "global::tools::includes::optional::t_docfuncs.inc::hUseImpressAutopilot::" + + if ( GVERBOSE ) then printlog( CFN & "Enter" ) + + '///+<li>Create a new IMPRESS document</li> + gApplication = "IMPRESS" + hCreateDocument() + + '///+<li>Open Tools/Options, go to Presentataion/General page</li> + ToolsOptions + hToolsOptions( gApplication , "General" ) + + '///+<li>Check or uncheck to start with autopilot</li> + Kontext "TabSonstigesDraw" + if ( mitAutopilotStarten.exists( 2 ) ) then + + if ( bEnable ) then + mitAutopilotStarten.check() + if ( GVERBOSE ) then printlog( CFN & "Enable Impress Autopilot" ) + else + mitAutopilotStarten.uncheck() + if ( GVERBOSE ) then printlog( CFN & "Disable Impress Autopilot" ) + endif -***** + '///+<li>Return Status of Checkbox (checked=TRUE)</li> + hUseImpressAutopilot() = mitAutopilotStarten.isChecked() + + else + + warnlog( CFN & "Cannot find Autopilot Checkbox" ) + + endif + + '///+<li>Close Tools/Options</li> + Kontext "OptionenDlg" + hCloseDialog( OptionenDlg, "ok" ) + + '///+<li>Close IMPRESS document</li> + hDestroyDocument() + + '///+<li>Returncode is undefined</li> + if ( GVERBOSE ) then printlog( CFN & "Exit" ) + '///</ul> + +end function + +'******************************************************************************* function hNumericDocType( doctype as integer ) as string diff --git a/testautomation/global/tools/includes/optional/t_extension_manager_tools.inc b/testautomation/global/tools/includes/optional/t_extension_manager_tools.inc index 7413eabed501..738f28ff16e9 100644 --- a/testautomation/global/tools/includes/optional/t_extension_manager_tools.inc +++ b/testautomation/global/tools/includes/optional/t_extension_manager_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,278 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Tools to ease working with the extension manager +'* +'\****************************************************************************** + +function hExtensionAddGUI( _path as string, _flags as string ) as integer + + '///<h3>Install an extension using the OpenOffice.org Extension Manager UI</h3> + '///<p>This function is intended for use with the new Extension Manager UI + '///+ and replaces an older function with the same name. Please note that + '///+ the interface has changed significantly. <br>This has become necessary + '///+ because the Extension Manager can turn up with a really huge number + '///+ of different dialogs, warnings, errormessages etc. <br> + '///+ As this function is designed to handle the most common installation + '///+ scenarios it needs quite a number of differnt options.<br> + '///+ Please have a look at the usage sample:<br><br></p> + '///+ <p align="center"><i>hExtensionAddGUI( sMyExtension, + '///+ "InstallForAll,BrokenDeps,DenyUpdate" )</i<p><br> + + + '///<u>Input:</u><br> + '///<ol> + '///+<li>Path to extension (String)</li> + '///<ul> + '///+<li>The path has to be fully qualified</li> + '///+<li>The path may be platform specific</li> + '///</ul> + + '///+<li>Flags (String), defaults underlined</li> + '///<ul> + '///+<li>The string is non optional but may be empty. Allowed flags are:</li> + '///<ul> + '///+<li>InstallForAll | <u>InstallForUser</u><br>Used when running office with administrator rights</li> + '///+<li>AllowUpdate | DenyUpdate | <u>NoUpdate</u><br>Reinstall already installed extension/update</li> + '///+<li>AcceptLicense | DenyLicense | <u>NoLicense</u><br>How to handle possible license dialog</li> + '///+<li>BrokenDeps<br>Close exactly one broken dependencies warning</li> + '///+<li>UseSlot<br>Use the File Open slot to load the extension (faster)</li> + '///</ul> + '///+<li>It is recommended to use the comma as delimiter between flags</li> + '///</ul> + '///</ol> + + '///<u>Return Value:</u><br> + '///<ol> + '///+<li>Installation status (Integer)</li> + '///<ul> + '///+<li>> 0 = Installation completed with no errors, number of installed extensions</li> + '///+<li>-1 = The requested extension does not exist</li> + '///+<li>-2 = The Add-button could not be accessed</li> + '///+<li>-3 = The Extension Manager did not open</li> + '///+<li>-4 = Unknown messagebox before the file Open dialog exists</li> + '///+<li>-5 = Broken dependency warning displayed</li> + '///+<li>-6 = The File Open dialog did not pop up</li> + '///+<li>-7 = Unknown and unhandled messagebox. function exit</li> + '///</ul> + '///</ol> + + dim flags as string : flags = lcase( _flags ) + dim path as string : path = convertpath( _path ) + dim bLogs as boolean : bLogs = FALSE + + const CFN = "hExtensionAddGUI()::" -***** + '///<u>Description</u> + '///<ul> + + ' set defaults if string is empty + if ( flags = "" ) then flags = "installforuser,noupdate,nolicense" + if ( instr( flags , "verbose" ) <> 0 ) then bLogs = TRUE + + if ( bLogs ) then printlog( CFN & "Flags: " & flags ) + + '///+<li>Verify that the requested extension exists (filesystem level)</li> + if ( not FileExists( path ) ) then + printlog( CFN & "Requested extension does not exist" ) + printlog( CFN & path ) + hExtensionAddGUI() = -1 + exit function + endif + + + if ( bLogs ) then + printlog( "" ) + printlog( "********** Installing extension begin **********" ) + endif + + '///+<li>Open the Extension Manager - optionally using the slot (CWS oxtsysint01)</li> + if ( instr( flags , "useslot" ) <> 0 ) then + hFileOpen( path ) + else + ToolsPackageManager + kontext "PackageManager" + + if ( PackageManager.exists( 2 ) ) then + + '///+<li>Verify that the "Add.." button is available</li> + if ( add.exists() and add.isEnabled() ) then + + '///+<li>Click the "Add..." button</li> + add.click() + else + printlog( CFN & "Add button is missing or disabled" ) + hExtensionAddGUI() = -2 + exit function + endif + + '///+<li>Test for the dreaded "The office workdirectory does not exist" warning, close it</li> + kontext "Active" + if ( Active.exists( 1 ) ) then + if ( Active.getButtonCount() = 1 ) then + if ( bLogs ) then printlog( Active.getText() ) + active.ok() + else + printlog( CFN & "Unexpected/unknown messagebox" ) + printlog( Active.getText() ) + hExtensionAddGUI() = -4 + exit function + endif + endif + + '///+<li>Enter the extension name into the file picker, open the file</lI> + kontext "OeffnenDlg" + if ( OeffnenDlg.exists( 2 ) ) then + DateiName.setText( path ) + Oeffnen.click() + else + printlog( CFN & "The File Open dialog did not open" ) + hExtensionAddGUI() = -6 + exit function + endif + + else + printlog( CFN & "Extension Manager is not open" ) + hExtensionAddGUI() = -3 + exit function + endif + endif + + '///+<li>Test for the installation target dialog that comes up as soon as the + '///+ user has administrator rights or works on a userspace installation. + '///+ Handle the dialog as specified by the function flags</li> + if ( instr( flags, "installfor" ) <> 0 ) then + kontext "Active" + if ( Active.exists( 1 ) ) then + if ( Active.getButtonCount() = 3 ) then + + if ( bLogs ) then + printlog( CFN & "Installation target dialog found" ) + printlog( Active.getText() ) + endif + + if ( instr( flags , "installforall" ) <> 0 ) then + printlog( CFN & "Installing for all users" ) + Active.no() + else + printlog( CFN & "Installing for user only" ) + Active.yes() + endif + else + if ( bLogs ) then + printlog( CFN & "Unexpected/unknown dialog" ) + printlog( Active.getText() ) + endif + endif + else + if ( bLogs ) then printlog( CFN & "Skipping handling of installation target" ) + endif + else + if ( bLogs ) then printlog( CFN & "Not handling userspace installations" ) + endif + + '///+<li>Test for the broken dependencies exception, close it with ok.</li> + if ( instr( flags , "brokendeps" ) <> 0 ) then + if ( bLogs ) then printlog( CFN & "Testing for dependencies messagebox" ) + kontext "UnsatisfiedDependencies" + if ( UnsatisfiedDependencies.exists( 1 ) ) then + printlog( CFN & "Closing Unsatisfied Dependencies dialog." ) + UnsatisfiedDependencies.ok() + hExtensionAddGUI() = -5 + else + printlog( CFN & "No unsatisfied dependencies dialog" ) + endif + else + if ( bLogs ) then printlog( CFN & "Skipping handling of broken dependencies dialog" ) + endif + + '///+<li>Test for the extension update dialog which pops up if an extension + '///+ is already installed. Handle as specified by flags</li> + if ( instr( flags, "update" ) ) then + if ( bLogs ) then printlog( CFN & "Testing for version message/update" ) + kontext "Active" + if ( Active.exists( 1 ) ) then + + if ( bLogs ) then + printlog( CFN & "Found update dialog" ) + printlog( Active.getText() ) + endif + + if ( Active.getButtonCount() = 2 ) then + if ( instr( flags, "denyupdate" ) <> 0 ) then + printlog( CFN & "Denying update" ) + Active.cancel() + else + printlog( CFN & "Allowing update" ) + Active.ok() + endif + else + printlog( CFN & "Unexpected/unknown dialog displayed" ) + printlog( Active.getText() ) + hExtensionAddGUI() = -7 + exit function + endif + else + if ( instr( flags , "noupdate" ) <> 0 ) then + printlog( CFN & "No update dialog present. Good" ) + else + printlog( CFN & "Update messagebox is missing" ) + endif + endif + else + if ( bLogs ) then printlog( CFN & "Skipping handling of update dialog" ) + endif + + '///+<li>Test for the Software License Agreement dialog. Handle as specified by + '///+ flags</li> + if ( instr( flags, "license" ) <> 0 ) then + if ( bLogs ) then printlog( CFN & "Testing software license dialog" ) + kontext "ExtensionSoftwareLicenseAgreement" + if ( ExtensionSoftwareLicenseAgreement.exists( 5 ) ) then + if ( bLogs ) then printlog( CFN & "Software license dialog found" ) + if ( instr( flags , "denylicense" ) <> 0 ) then + printlog( CFN & "Cancelling software license dialog" ) + ExtensionSoftwareLicenseAgreement.cancel() + else + printlog( CFN & "Accepting software license" ) + do while ( not accept.isEnabled() ) + ScrollDown.click() + WaitSlot() + loop + accept.click() + endif + else + if ( instr( flags , "nolicense" ) <> 0 ) then + printlog( CFN & "No license dialog displayed. Good." ) + else + warnlog( CFN & "Expected license dialog is missing" ) + endif + endif + else + if ( bLogs ) then printlog( CFN & "Skipping handling of license dialog" ) + endif + + '///+<li>Retrieve the number of installed extensions</li> + kontext "PackageManager" + wait( 500 ) + hExtensionAddGUI() = BrowsePackages.getItemCount() + + '///+<li>Close the Extension Manager</li> + hCloseDialog( PackageManager , "close" ) + + if ( bLogs ) then + printlog( "********** Installing extension end **********" ) + printlog( "" ) + endif + '///</ul> + +end function + + +'******************************************************************************* function hExtensionRemoveGUI( cExtensionName as string ) as integer diff --git a/testautomation/global/tools/includes/optional/t_filetools.inc b/testautomation/global/tools/includes/optional/t_filetools.inc index 1824ac782969..52e200e44c4e 100644 --- a/testautomation/global/tools/includes/optional/t_filetools.inc +++ b/testautomation/global/tools/includes/optional/t_filetools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,155 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Functions that work with files like deleting, loading... +'* +'\****************************************************************************** + +function hHandleActivesOnLoad( iTries as integer , iAdd as integer ) as boolean + + '///<h3>Handle any dialogs that might pop up when loading a file</h3> + '///<i>Beware: This function gives only limited control over the dialogs closed, + '///+ it just closes anything it can.</i><br> + '///<i>Please refer to the inline documentation for further details</i><br> + '///<u>Input</u>: + '///<ol> + '///+<li>Number of dialogs to be closed (integer)</li> + '///<ul> + '///+<li>Number of dialogs not limited though more than 3 is not useful</li> + '///</ul> + '///+<li>Additional dialogs (integer).</li> + '///<ul> + '///+<li>Number of dialogs to handle in case of unexpected behavior. If unsure set it to 2</li> + '///</ul> + '///</ol> + '///<u>Returns</u>: + '///<ol> + '///+<li>Errorcondition (boolean)</li> + '///<ul> + '///+<li>TRUE: The expected number of dialogs were closed</li> + '///+<li>FALSE: On any other condition</li> + '///</ul> + '///</ol> + '///<u>Description</u>: + '///<ul> + '///+<li>OK to create a new document based on a template</li> + '///+<li>YES to update links</li> + '///+<li>YES to execute macros</li> + '///</ul> + + use "global/tools/includes/optional/t_stringtools.inc" + + const CFN = "hHandleActivesOnLoad::" + + dim iTry as integer + dim iActives as integer + dim cMessage as string + dim bSkip as boolean + + if ( GVERBOSE ) then printlog( CFN & "Enter" ) + + ' not good but apparently required - else hDestroyDocument will handle the + ' dialogs and warn about them. + + ' think positive: preset the returnvalue with "true" + hHandleActivesOnLoad() = true + + for iTry = 1 to iTries + iAdd + + ' handle three possible dialogs: + ' 1. The warning that the user should create a new document based + ' on this Sample/Template (the document is write protected) + ' 2. The question to update links to the internet. Note: If you + ' use proxies, they must be set correctly otherwise the result + ' is undefined. + ' 3. Some weird usage information dialog which is an active with just + ' one OK button. -***** + ' Although this works quite well, there is a flaw that we will not + ' get information about an "active" dialog that cannot be closed by + ' .yes() or .ok(). If this happens, we probably run into an error + kontext "Active" + try + if ( active.exists( 1 ) ) then + + iActives = iActives + 1 + cMessage = hRemoveLineBreaks( active.getText() ) + printlog( CFN & "MSG (" & iActives & "): " & cMessage ) + printlog( CFN & "Ressource type is: " & Active.getRT() ) + printlog( CFN & "Buttoncount is: " & Active.getButtonCount() ) + bSkip = false + + ' ok to create a new document + try + active.cancel() + printlog( CFN & "MSG (" & iActives & "): closed with Cancel" ) + bSkip = true + catch + printlog( CFN & "Missed - this dialog has no Cancel button (create new document)" ) + active.ok() + endcatch + + if ( not bSkip ) then + if ( Active.getRT() = 304 ) then + if ( Active.getButtonCount() = 1 ) then + active.ok() + printlog( CFN & "MSG (" & iActives & "): closed with OK" ) + bSkip = true + endif + else + endif + endif + + if ( not bSkip ) then + ' no to update links + try + active.no() + printlog( CFN & "MSG (" & iActives & "): closed with NO" ) + catch + printlog( CFN & "Missed - this dialog has no NO button (update links)" ) + endcatch + endif + + endif + catch + kontext "Active" + if ( Active.exists( 1 ) ) then + if ( Active.getButtonCount() = 2 ) then + printlog( CFN & "<Update links dialog> or <File corruption warning>" ) + active.yes() + hFileWait( FALSE ) + kontext "Active" + if ( Active.exists( 2 ) ) then + qaerrorlog( "#105670# - File corruption warning, the template is broken" ) + qaerrorlog( CFN & "Trying to recover." ) + Active.ok() + hHandleActivesOnLoad() = FALSE + exit function + endif + endif + endif + + qaerrorlog( "Problem while trying to handle messageboxes" ) + hHandleActivesOnLoad() = false + endcatch + + next iTry + + ' now see how many dialogs were allowed and how many have been closed + ' this does not change the return value of the function + if ( iActives > iTries ) then + printlog( CFN & "Exit: The test closed more dialogs than expected" ) + hHandleActivesOnLoad() = false + else + if ( GVERBOSE ) then printlog( CFN & "Exit" ) + endif + +end function + +'******************************************************************************* function hHandleInitialDialogs() as integer diff --git a/testautomation/global/tools/includes/optional/t_key_tools.inc b/testautomation/global/tools/includes/optional/t_key_tools.inc index c2ccb4c1df86..22612c373b10 100644 --- a/testautomation/global/tools/includes/optional/t_key_tools.inc +++ b/testautomation/global/tools/includes/optional/t_key_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -***** +' +'************************************************************** +'* +'* short description : tools for evaluation of key=value datalists +'* +'******************************************************************************* ' ** ' #1 hGetDataPairAsString ' retrieve key=value from a list ' #1 hGetValueForPairAsString ' retrieve value from a key=value as string diff --git a/testautomation/global/tools/includes/optional/t_listfuncs.inc b/testautomation/global/tools/includes/optional/t_listfuncs.inc index 1127242cf95d..7095bfe83742 100644 --- a/testautomation/global/tools/includes/optional/t_listfuncs.inc +++ b/testautomation/global/tools/includes/optional/t_listfuncs.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,51 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Replacements for routines in t_lists.inc adds some +'* +'\****************************************************************************** + +function hListDelete( aList() as string, iItemToDelete as integer ) as boolean + + '///<h3>Delete one item from a list specified by index</h3> + '///<i>Prerequisite: Array compatible with those from t_lists.inc</i><br> + '///<i>About listfunctions: All listfunctions rely on a special type of + '///+ array. This can be string arrays and - in some cases - numeric + '///+ arrays. What makes the arrays unique is that the first item which + '///+ has the index 0 contains the number of items in the list to be used, + '///+ anything that is stored beyond this number is ignored. This has three + '///+ consequences: 1) all listfunctions that alter an array must update + '///+ the index stored in array(0) and 2) it is possible that the index + '///+ point beyond ubound of the array which will most likely cause a + '///+ runtime error. 3) Means that arrays may only have an upper boundary + '///+ declared, all loops must start with index array(1) and must end with + '///+ index array(val( array(0))</i><br> + + const CFN = "hListDelete::" + const INDEX_CORRECTION = 1 + dim iCurrentItem as integer ' Increment-Variable + + if ( GVERBOSE ) then + printlog( CFN & "Removing: " & aList( iItemToDelete ) & " at pos " & iItemToDelete ) + endif + + ' Move all items down by one in the list beginning with the item after + ' iItemToDelete + for iCurrentItem = ( iItemToDelete + INDEX_CORRECTION ) to ListCount( aList() ) + aList( iCurrentItem - INDEX_CORRECTION ) = aList( iCurrentItem ) + next iCurrentItem + + ' Delete the last entry, it is no longer used and it is duplicate to the item + ' at iListSizeOld-1 (iListSizeNew) + aList( iCurrentItem ) = "" + aList( 0 ) = iCurrentItem - INDEX_CORRECTION + +end function -***** +'******************************************************************************* function hListAppend( sNewString as string, aTargetList() as string ) as integer diff --git a/testautomation/global/tools/includes/optional/t_macro_tools.inc b/testautomation/global/tools/includes/optional/t_macro_tools.inc index d48f5f62fe0b..cc8768de5299 100644 --- a/testautomation/global/tools/includes/optional/t_macro_tools.inc +++ b/testautomation/global/tools/includes/optional/t_macro_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,77 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +' ** +' ** short description : Helper functions for Macro tests +' ** +'\****************************************************************************** + +function hInsertMacroFromFile( cMacroId as string, optional cSource as string ) as integer + + '///<h3>Paste a macro (taken from a file) to the basic IDE</h3> + '///<i>uses: framework/tools/input/macros.txt</i><br> + '///<i>Starting point: Basic IDE</i><br> + '///<u>Note</u>: Overwrites any existing macros in the current module<br> + '///<u>Input</u>: + '///<ol> + '///+<li>Name (ID) of the macro to be inserted (string)</li> + '///<ul> + '///+<li>Allowed is any string that corresponds to a section in the source file</li> + '///</ul> + '///</ol> + '///<u>Returns</u>: + '///<ol> + '///+<li>Number of lines inserted (integer)</li> + '///<ul> + '///+<li>0: Error, no lines inserted</li> + '///+<li>> 0: Number of lines</li> + '///</ul> + '///</ol> + '///<u>Description</u>: + '///<ul> + + const CFN = "hInsertMacroFromFile::" + const RETVAL_FAILURE = 0 + const MAX_LINES_IN_MACRO_FILE = 10000 + + '///+<li>Find the path to the source file</li> + dim cFile as string + dim aInstructionList( MAX_LINES_IN_MACRO_FILE ) as string + dim iInstructionCount as integer + dim iCurrentInstruction as integer + + if ( IsMissing( cSource ) ) then cFile = gTesttoolPath & "global/input/macros.txt" + + '///+<li>retrieve the macro from the file with ID as section</li> + iInstructionCount = hGetDataFileSection( cFile, aInstructionList(), cMacroId, "", "" ) + + '///+<li>Delete all content from the BASIC IDE edit window</li> + '///+<li>Insert the code into the IDE line by line</li> + kontext "BasicIDE" + if ( EditWindow.exists() ) then + if ( hDeleteMacro() ) then + for iCurrentInstruction = 1 to iInstructionCount + EditWindow.TypeKeys( "<HOME>" ) + EditWindow.TypeKeys( aInstructionList( iCurrentInstruction ) ) + EditWindow.TypeKeys( "<RETURN>" ) + next iCurrentInstruction + printlog( CFN & "Inserted macro: " & cMacroId ) + hInsertMacroFromFile() = iInstructionCount + else + printlog( CFN & "IDE is not empty, will not insert macro" ) + hInsertMacroFromFile() = RETVAL_FAILURE + endif + else + printlog( CFN & "Editwindow is not visible" ) + hInsertMacroFromFile() = RETVAL_FAILURE + endif + '///</ul> + +end function -***** +'******************************************************************************* function hMacroOrganizerRunMacro( cMacroName as string ) as integer diff --git a/testautomation/global/tools/includes/optional/t_ole.inc b/testautomation/global/tools/includes/optional/t_ole.inc index aa06bd91f361..482a74e99ffd 100644 --- a/testautomation/global/tools/includes/optional/t_ole.inc +++ b/testautomation/global/tools/includes/optional/t_ole.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,42 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Tools for OLE objects +'* +'\****************************************************************************** + +function hGetOfficeVersion() as string + + ' The "Insert OLE object" dialog lists the OLE Objects with application name + ' and version number. THe version numbers are tracked in the officeinfo.txt + ' file which must be adjusted each time we change to a new major version. -***** + const CFN = "global::tools::includes::optional::t_ole.inc::hGetOfficeVersion(): " + const DATAFILE = "global/input/officeinfo.txt" + const MAX_LINES_IN_DATAFILE = 20 + + dim cPath as string + dim aItemList( MAX_LINES_IN_DATAFILE ) as string + + ' Path to info file + cPath = convertpath( gTesttoolPath & DATAFILE ) + if ( GVERBOSE ) then printlog( CFN & "Reading: " & cPath ) + + ' Read the file, store the list of known office versions + hGetDatafileSection( cPath, aItemList(), "", "", "" ) + + ' Search for the version number matching the product name, store value in global variable + gOfficeVersion = hGetValueForKeyAsString( aItemList(), gProductName ) + + ' Return content of the global variable as well + hGetOfficeVersion() = gOfficeVersion + +end function + +'******************************************************************************* function hGetOleObjectName( cApplication as string ) as string diff --git a/testautomation/global/tools/includes/optional/t_security_tools.inc b/testautomation/global/tools/includes/optional/t_security_tools.inc index 33b0ff550453..0d9e9e9e0cf4 100644 --- a/testautomation/global/tools/includes/optional/t_security_tools.inc +++ b/testautomation/global/tools/includes/optional/t_security_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,95 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Tools to ease testing of security related funtionality +'* +'\****************************************************************************** + +function hSetPasswordRecommendation( bEnable as boolean ) as boolean + + '///<h3>Toggle Tools/Options/OOo/Security: Password recommendation</h3> + '///<u>Input</u>: + '///<ol> + '///+<li>Mode (boolean)</li> + '///<ul> + '///+<li>TRUE: Switch password recommendation on</li> + '///+<li>FALSE: Switch password recommendation off</li> + '///</ul> + '///</ol> + + '///<u>Returns</u>: + '///<ol> + '///+<li>Prior state (boolean)</li> + '///<ul> + '///+<li>TRUE: Password recommendation was on</li> + '///+<li>FALSE: Password recommendation was off</li> + '///</ul> + '///</ol> + + '///<u>Description</u>: + '///<ul> + + const CFN = "hSetPasswordRecommendation::" + + '///+<li>Open Tools/Options</li> + ToolsOptions + + kontext "OptionenDlg" + if ( OptionenDlg.exists( 2 ) ) then + + '///+<li>Go to the security page</li> + hToolsOptions( "STAROFFICE" , "SECURITY" ) + + '///+<li>Click on the "Options..." button</li> + kontext "TabSecurity" + if ( hClickButton( Options ) ) then + + kontext "TabSecurityOptionsAndWarnings" + if ( TabSecurityOptionsAndWarnings.exists( 1 ) ) then + + '///+<li>Retrieve the current setting for passwor recommendation</li> + if ( RecommendPasswordProtectionOnSaving.isChecked() ) then + hSetPasswordRecommendation() = true + else + hSetPasswordRecommendation() = false + endif + + '///+<li>Set the requested state</li> + if ( bEnable ) then + printlog( CFN & "Enabled password recommendation" ) + RecommendPasswordProtectionOnSaving.check() + else + printlog( CFN & "Disabled password recommendation" ) + RecommendPasswordProtectionOnSaving.uncheck() + endif + + hCloseDialog( TabSecurityOptionsAndWarnings, "ok" ) + + else + warnlog( "Failed to open security options page" ) + hSetPasswordRecommendation() = false + endif + + else + warnlog( CFN & "Unable to click options button" ) + hSetPasswordRecommendation() = false + endif + + '///+<li>Close Tools/Options</li> + Kontext "ToolsOptionsDlg" + hCloseDialog( ToolsOptionsDlg, "ok" ) + + else + warnlog( "Failed to open Tools/Options" ) + endif + '///</ul> + +end function -**** +'****************************************************************************** function hOpenDigitalSignaturesDialog() as boolean diff --git a/testautomation/global/tools/includes/optional/t_set_standard_controls.inc b/testautomation/global/tools/includes/optional/t_set_standard_controls.inc index 35b444354578..fc10fe1e91b6 100644 --- a/testautomation/global/tools/includes/optional/t_set_standard_controls.inc +++ b/testautomation/global/tools/includes/optional/t_set_standard_controls.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************************ +' +'************************************************************** +'* +'* short description : Tool library for setting controls and verifying the functionality +'* +'************************************************************************************************** '* ' #0 fSetListBoxByItem 'Function to select item in list box ' #0 fSetListBoxByString 'Function to select item by string in list box diff --git a/testautomation/global/tools/includes/optional/t_stringtools.inc b/testautomation/global/tools/includes/optional/t_stringtools.inc index fc1759f13745..5f208f382a1b 100644 --- a/testautomation/global/tools/includes/optional/t_stringtools.inc +++ b/testautomation/global/tools/includes/optional/t_stringtools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,24 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Functions for manipulation of strings +'* +'\****************************************************************************** + +function hRemoveLineBreaks( cString as string ) as string + + dim myString as string : myString = cString + myString = hStringReplaceChar( myString, CHR$(09), " " ) + myString = hStringReplaceChar( myString, CHR$(13), " " ) + myString = hStringReplaceChar( myString, CHR$(10), "" ) + hRemoveLineBreaks() = myString -***** +end function + +'******************************************************************************* function hCompareSubStrings( cRef as string, cSub as string ) as integer diff --git a/testautomation/global/tools/includes/optional/t_toolbar_tools1.inc b/testautomation/global/tools/includes/optional/t_toolbar_tools1.inc index f4c4a618e6d4..0f6c250fe79f 100644 --- a/testautomation/global/tools/includes/optional/t_toolbar_tools1.inc +++ b/testautomation/global/tools/includes/optional/t_toolbar_tools1.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************* +' +'************************************************************** +'* +'* short description : Toolbar tools 1 +'* +'*************************************************************************************** '* ' #1 fActiveObjectInToolbar ' active/inactive image button in toolbar '* diff --git a/testautomation/global/tools/includes/optional/t_toolbar_writer.inc b/testautomation/global/tools/includes/optional/t_toolbar_writer.inc index 236f803fb952..887c0dfb2e8c 100644 --- a/testautomation/global/tools/includes/optional/t_toolbar_writer.inc +++ b/testautomation/global/tools/includes/optional/t_toolbar_writer.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************* +' +'************************************************************** +'* +'* short description : Toolbar tools - Writer +'* +'*************************************************************************************** '* ' #0 fGetObjectWriter ' #0 fGetObjectCalc diff --git a/testautomation/global/tools/includes/optional/t_treelist_tools.inc b/testautomation/global/tools/includes/optional/t_treelist_tools.inc index 30da0fad166e..20fad49c1546 100644 --- a/testautomation/global/tools/includes/optional/t_treelist_tools.inc +++ b/testautomation/global/tools/includes/optional/t_treelist_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,71 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Helpers for accessing treelists +'* +'\****************************************************************************** + +function hGetNodeCount( oControl as object ) as integer + + '///<h3>Retrieve the number of visible (open) nodes from a treelist</h3> + '///<u>Input</u>: + '///<ol> + '///+<li>Treelist control object (Object)</li> + '///<ul> + '///+<li>Object must exist in current context</li> + '///</ul> + '///</ol> + '///<u>Returns</u>: + '///<ol> + '///+<li>Number of items in treelist</li> + '///<ul> + '///+<li>0 on any error</li> + '///+<li>> 0 Number of items</li> + '///</ul> + '///</ol> + '///<u>Description</u>: + '///<ul> + + + const CFN = "hGetNodeCount::" + const RETVAL_FAILURE = 0 + dim iCount as integer + + '///+<li>Verify that the control exists</li> + if ( oControl.exists( 5 ) ) then + + '///+<li>Verify that the control is enabled</li> + if ( oControl.isEnabled() ) then + + if ( GVERBOSE ) then printlog( CFN & "Regular access, control available and enabled" ) + + '///+<li>get the number of items from the control</li> + iCount = oControl.getItemCount() + else + printlog( CFN & "Failure: Control claims to be disabled." ) + iCount = RETVAL_FAILURE + endif + else + try + printlog( CFN & "Forcing access to non existing control" ) + iCount = oControl.getItemCount() + catch + printlog( CFN & "Failure: Control not available." ) + iCount = RETVAL_FAILURE + endcatch + endif -***** + if ( GVERBOSE ) then printlog( CFN & "Exit with nodecount = " & iCount ) + + hGetNodeCount = iCount + '///</ul> + +end function + +'******************************************************************************* function hSelectTopNode( oControl as object ) as boolean diff --git a/testautomation/global/tools/includes/optional/t_ui_filters.inc b/testautomation/global/tools/includes/optional/t_ui_filters.inc index e40d6c68fff2..2ac0cd42ac3c 100644 --- a/testautomation/global/tools/includes/optional/t_ui_filters.inc +++ b/testautomation/global/tools/includes/optional/t_ui_filters.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,22 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Get the UI names for default filters +'* +'\****************************************************************************** + +global gWriterFilter as String +global gCalcFilter as String +global gImpressFilter as String +global gMasterDocFilter as String +global gMathFilter as String +global gDrawFilter as String +global gHTMLFilter as String -***** +'******************************************************************************* sub GetDefaultFilterNames() diff --git a/testautomation/global/tools/includes/optional/t_xml1.inc b/testautomation/global/tools/includes/optional/t_xml1.inc index 39ec86e61114..b4a21dbe76bf 100644 --- a/testautomation/global/tools/includes/optional/t_xml1.inc +++ b/testautomation/global/tools/includes/optional/t_xml1.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -********* +' +'************************************************************** +'* +'* short description : simple XML-Parser for XML-Files from Registration-Database and Routines to work with SAX-Parser in Testtool +'* +'*********************************************************************************** ' #1 hXMLGotoElement ' #1 hXMLGetFirstCharsForElement ' #1 ExtractSections diff --git a/testautomation/global/tools/includes/required/t_doc1.inc b/testautomation/global/tools/includes/required/t_doc1.inc index 68bf5055fbd5..5be50913a77b 100755 --- a/testautomation/global/tools/includes/required/t_doc1.inc +++ b/testautomation/global/tools/includes/required/t_doc1.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,364 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. +' +'************************************************************** +'* +'* short description : Global Routines for Document Handling +'* +'\************************************************************************************* + +sub hNewDocument ( optional bANewDoc ) + '/// hNewDocument : open a new document dependent on 'gApplication' ///' + dim sTemp as string + + if IsMissing ( bANewDoc ) <> TRUE then + if bANewDoc = TRUE then + gNoNewDoc = FALSE + else + gNoNewDoc = TRUE + end if + end if + + select case gApplication + case "WRITER" + Kontext "DocumentWriter" + if gNoNewDoc = TRUE then + FileOpen "FileName", "private:factory/swriter", "SynchronMode", TRUE + else + FileOpen "FileName", "private:factory/swriter", "FrameName", "_default", "SynchronMode", TRUE + end if + if ( DocumentWriter.IsMax() = false ) then + DocumentWriter.Maximize() + Wait( 2000 ) + end if + case "CALC" + Kontext "DocumentCalc" + if gNoNewDoc = TRUE then + FileOpen "FileName", "private:factory/scalc", "SynchronMode", TRUE + else + FileOpen "FileName", "private:factory/scalc", "FrameName", "_default", "SynchronMode", TRUE + end if + if ( DocumentCalc.IsMax() = false ) then + DocumentCalc.Maximize() + Wait( 2000 ) + end if + case "IMPRESS" + Kontext "DocumentImpress" + if gNoNewDoc = TRUE then + FileOpen "FileName", "private:factory/simpress", "SynchronMode", TRUE + else + FileOpen "FileName", "private:factory/simpress", "FrameName", "_default", "SynchronMode", TRUE + Kontext "AutoPilotPraesentation1" + if AutoPilotPraesentation1.Exists (2) then + Printlog "------------------------------The Impress-Autopilot was active------------------" + Startwithwizard.Check ' opposite of the checkboxs' title + AutoPilotPraesentation1.OK + Sleep 2 + Kontext "SeitenLayout" + SeitenLayout.Cancel + end if + Kontext "DocumentImpress" + Sleep 2 + if ( DocumentImpress.IsMax() = false ) then + DocumentImpress.Maximize() + Wait( 2000 ) + end if + end if + case "DRAW" + Kontext "DocumentDraw" + if gNoNewDoc = TRUE then + FileOpen "FileName", "private:factory/sdraw", "SynchronMode", TRUE + else + FileOpen "FileName", "private:factory/sdraw", "FrameName", "_default", "SynchronMode", TRUE + end if + if ( DocumentDraw.IsMax() = false ) then + DocumentDraw.Maximize() + Wait( 2000 ) + end if + case "MASTERDOCUMENT" + Kontext "DocumentMasterDoc" + if gNoNewDoc = TRUE then + FileOpen "FileName", "private:factory/swriter/GlobalDocument", "SynchronMode", TRUE + else + FileOpen "FileName", "private:factory/swriter/GlobalDocument", "FrameName", "_default", "SynchronMode", TRUE + end if + Kontext "Navigator" + sleep (1) + if Navigator.Exists(5) then Navigator.Close + Kontext "DocumentMasterDoc" + if ( DocumentMasterDoc.IsMax() = false ) then + DocumentMasterDoc.Maximize() + Wait( 2000 ) + end if + case "MATH" + Kontext "DocumentMath" + if gNoNewDoc = TRUE then + FileOpen "FileName", "private:factory/smath", "SynchronMode", TRUE + else + FileOpen "FileName", "private:factory/smath", "FrameName", "_default", "SynchronMode", TRUE + end if + Kontext "DocumentMath" + if ( DocumentMath.IsMax() = false ) then + DocumentMath.Maximize() + Wait( 2000 ) + end if + case "HTML" + Kontext "DocumentWriterWeb" + if gNoNewDoc = TRUE then + FileOpen "FileName", "private:factory/swriter/web", "SynchronMode", TRUE + else + FileOpen "FileName", "private:factory/swriter/web", "FrameName", "_default", "SynchronMode", TRUE + end if + Kontext "DocumentWriterWeb" + if ( DocumentWriterWeb.IsMax() = false ) then + DocumentWriterWeb.Maximize() + Wait( 2000 ) + end if + case "DATABASE" + FileOpen "FileName", "private:factory/sdatabase?Interactive", "FrameName", "_default", "SynchronMode", TRUE + Kontext "DatabaseWizard" + if DatabaseWizard.exists(5) then + FinishBtn.click + kontext "SpeichernDlg" + if SpeichernDlg.exists(5) then + if (Dateiname.getSelText = "") then + sTemp = convertPath(gOfficePath + "user/work/hNewDocument.odb") + if fileExists(sTemp) then + app.kill(sTemp) + endif + qaErrorlog "## lost default filename" + Dateiname.setText "hNewDocument" + endif + Speichern.click + Kontext "DATABASE" + else + warnlog "t_doc1.inc::hNewDocument():: Can't create Database Document 2" + endif + else + warnlog "t_doc1.inc::hNewDocument():: Can't create Database Document 1" + endif + case "BASIC" + ToolsMacroMacro + kontext "makro" + if makro.exists(5) then + MakroAus.typeKeys "<home>" + sTemp = "" + while (NOT bearbeiten.isEnabled) AND (sTemp <> MakroAus.getSelText) + sTemp = MakroAus.getSelText + MakroAus.typeKeys "<down>+" + wend + if (bearbeiten.isEnabled) then + bearbeiten.click + else + qaErrorlog "Can't edit document." + endif + else + warnlog "Can't open Basic IDE." + endif + case else : WarnLog "hNewDocument: No Applikation named '" + gApplication + "' exists in this routine!" + end select + Sleep 2 + +end sub +' +'------------------------------------------------------------------------------- +' +function hCreateLabels() as Boolean + + hCreateLabels() = false + + FileOpen( "FileName", "private:factory/swriter?slot=21051", "FrameName", "_default", "SynchronMode", TRUE ) + + Kontext + if ( Active.exists( 5 ) ) then + Active.setPage TabEtiketten + + if ( TabEtiketten.exists( 1 ) ) then + if ( Tabetiketten.isVisible() ) then + hCreateLabels() = true + else + warnlog( "<TabEtiketten> is not visible" ) + endif + else + warnlog( "<TabEtiketten> not open" ) + endif + else + warnlog( "Failed to open <TabEtiketten>" ) + endif + +end function +' +'------------------------------------------------------------------------------- +' +function hCreateBusinessCards() as Boolean + + hCreateBusinessCards() = false + + FileOpen( "FileName", "private:factory/swriter?slot=21052", "FrameName", "_default", "SynchronMode", TRUE ) + + Kontext + if ( Active.exists( 5 ) ) then + Active.setPage TabEtikettenMedium + + if ( TabEtikettenMedium.exists( 1 ) ) then + if ( TabetikettenMedium.isVisible() ) then + hCreateBusinessCards() = true + else + warnlog( "<TabEtikettenMedium> is not visible" ) + endif + else + warnlog( "<TabEtikettenMedium> not open" ) + endif + else + warnlog( "Failed to open <TabEtikettenMedium>" ) + endif + +end function +' +'------------------------------------------------------------------------------- +' +function hCloseDocument() + + hUseAsyncSlot( "FileClose") + + Kontext "Active" + if ( Active.Exists( 2 ) ) then + try + Active.No + catch + Active.click( 202 ) + endcatch + end if + + WaitSlot( 2000 ) + +end function +' +'------------------------------------------------------------------------------- +' +sub gMouseClick ( X%, Y%, optional _mousebutton ) + + dim oDocument as object + dim mousebutton as integer + + ' Handle infamous optional parameter + if ( IsMissing( _mousebutton ) ) then + mousebutton = 1 + else + mousebutton = _mousebutton + endif + + hSetDocumentContext() ' set kontext to current document type + oDocument = hSetDocumentObject() ' get the current document object + + autoexecute = false + oDocument.MouseDown ( X%, Y%, mousebutton ) + oDocument.MouseUp ( X%, Y%, mousebutton ) + autoexecute = true + wait( 1000 ) + +end sub +' +'------------------------------------------------------------------------------- +' +sub gMouseDoubleClick ( X%, Y% ) + + dim oDocument as object + + hSetDocumentContext() ' set kontext to current document type + oDocument = hSetDocumentObject() ' get the current document object + oDocument.MouseDoubleClick ( X%, Y% ) + wait( 1000 ) + +end sub +' +'------------------------------------------------------------------------------- +' +sub gMouseMove ( BeginX%, BeginY%, EndX%, EndY% ) + + dim oDocument as object + + hSetDocumentContext() ' set kontext to current document type + oDocument = hSetDocumentObject() ' get the current document object + oDocument.MouseDown ( BeginX%, BeginY% ) + oDocument.MouseMove ( EndX%, EndY%) + oDocument.MouseUp ( EndX%, EndY% ) + wait( 1000 ) + +end sub +' +'------------------------------------------------------------------------------- +' +sub gMouseDown ( BeginX%, BeginY% ) + + dim oDocument as object + + hSetDocumentContext() ' set kontext to current document type + oDocument = hSetDocumentObject() ' get the current document object + oDocument.MouseDown ( BeginX%, BeginY% ) + wait( 300 ) + +end sub +' +'------------------------------------------------------------------------------- ' -'************************************************************************* +sub gMouseMove2 ( EndX%, EndY% ) -***** + dim oDocument as object + + hSetDocumentContext() ' set kontext to current document type + oDocument = hSetDocumentObject() ' get the current document object + oDocument.MouseMove ( EndX%, EndY%) + wait( 300 ) + +end sub +' +'------------------------------------------------------------------------------- +' +sub gMouseUp ( EndX%, EndY% ) + + dim oDocument as object + + hSetDocumentContext() ' set kontext to current document type + oDocument = hSetDocumentObject() ' get the current document object + oDocument.MouseUp ( EndX%, EndY% ) + wait( 300 ) + +end sub +' +'------------------------------------------------------------------------------- +' +sub hTypeKeys ( OutputText , optional _iLoop as Integer ) + + const CFN = "global::tools::includes::required::t_doc1.inc::hTypeKeys(): " + + dim iRepeat as integer + dim iLoop as integer + dim oDocument as object + + ' Handle infamous optional parameter + If ( IsMissing( _iLoop ) ) then + iLoop = 1 + else + iLoop = _iLoop + endif + + hSetDocumentContext() ' set kontext to current document type + oDocument = hSetDocumentObject() ' Get the document object we want to write to + + try + for iRepeat = 1 to iLoop + oDocument.TypeKeys( OutputText ) + wait( 200 ) + next iRepeat + catch + warnlog( CFN & "Failed to send keystroke to given context" ) + endcatch + +end sub + +'******************************************************************************* function hSetDocumentContext() as string diff --git a/testautomation/global/tools/includes/required/t_files.inc b/testautomation/global/tools/includes/required/t_files.inc index 1b484ec22a81..3470c6f8c559 100644 --- a/testautomation/global/tools/includes/required/t_files.inc +++ b/testautomation/global/tools/includes/required/t_files.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,20 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Global routines for loading, saving, printing, export +'* +'\****************************************************************************** + +function hGrafikEinfuegen( cFile as string ) as Boolean -***** + hGrafikEinfuegen() = hInsertGraphic( cFile, "Static" ) + +end function + +'******************************************************************************* function hGrafikVerknuepftEinfuegen( cFile as string ) as Boolean diff --git a/testautomation/global/tools/includes/required/t_filters.inc b/testautomation/global/tools/includes/required/t_filters.inc index 4d77e8451f03..62b65110ca91 100644 --- a/testautomation/global/tools/includes/required/t_filters.inc +++ b/testautomation/global/tools/includes/required/t_filters.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,30 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Retrieve and set filternames and suffixes +'* +'\****************************************************************************** + +private const LENGTH_OF_FILTERFILE = 100 +private const FILE_DATA_SIZE = 300 -***** +function hCheckForBinfilters() as boolean + + try + hGetSuffix( "569" ) + hCheckForBinfilters() = true + catch + warnlog( "Optional legacy filters package is not installed" ) + printlog( "Please restart the setup to install the missing filters" ) + hCheckForBinfilters() = false + endcatch + +end function + +'******************************************************************************* function hGetSuffix( optional cBuildId as string ) as string diff --git a/testautomation/global/tools/includes/required/t_lists.inc b/testautomation/global/tools/includes/required/t_lists.inc index bcee807216ae..af0f5eecba2a 100644 --- a/testautomation/global/tools/includes/required/t_lists.inc +++ b/testautomation/global/tools/includes/required/t_lists.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,427 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : general routines to work with lists (arrays) +'* +'\****************************************************************** + +function ListCount ( lsList() as String ) as Integer + 'Author: tz + '///Returns the number of list entries. + '///+<u>Input</u>: The list (only string lists are possible) + '///+<u>Return</u>: The number of entries + ListCount = Val(lsList(0)) +end function + +'------------------------------------------------------------------------- + +function ListCopy ( lsList1() as String, lsList2() as String ) as Boolean + 'Author: tz + '///Copies all entries out of one list into another list. + '///+<u>Input</u>:<ol><lo>list which should be copied</li><li>An empty list</li></ol>After this function the 2nd list is a copy of the 1st list. + '///+<u>Return</u>: If copy of the list is correct this function returns TRUE otherweise FALSE + + Dim ii as Integer + + ListAllDelete ( lsList2() ) + for ii=1 to ListCount ( lsList1() ) + ListAppend ( lsList2(), lsList1(ii) ) + next ii + + if ListCount ( lsList1() ) = ListCount ( lsList2 () ) then + ListCopy = TRUE + else + ListCopy = FALSE + end if +end function + +'------------------------------------------------------------------------- + +sub ListAllDelete ( lsList() as String ) + 'Author: tz + '///Deletes a complete list. + '///+<u>Input</u>: The list (only string lists are possible) + lsList(0) = "0" +end sub + +'------------------------------------------------------------------------- + +sub ListAppend ( lsList() as String, sNewEntry as String ) + 'Author: tz + '///Appends a new entry at the end of the list. + '///+<u>Input</u>: <ol><li>the list (only string lists are possible)</li><li>The new entry</li></ol> + lsList(0) = Val(lsList(0)) + 1 + lsList( lsList(0) ) = sNewEntry +end sub + +'------------------------------------------------------------------------- + +function ListDelete ( lsList() as String, iNr as Integer ) as Boolean + 'Author: tz + '///Deletes an entry out of the list on a defined position (iNr). + '///+<u>Input</u>: <ol><li>The list (only string lists are possible)</li><li>The position of the entry</li></ol> + '///+<u>Return</u>: TRUE if the entry was deleted otherweise FALSE + + + Dim i%, ListenAnzahl as Integer + + ListenAnzahl = listcount( lsList() ) + + if iNr > ListenAnzahl then + ListDelete = FALSE + Exit Function + end if + + for i% = iNr to ListenAnzahl + lsList( i% ) = lsList( i% + 1 ) + next i% + + lsList(0) = ListenAnzahl - 1 + + ListDelete = TRUE +end function + +'------------------------------------------------------------------------- + +function ListDeleteString ( lsList() as String, sText as String ) as Boolean + 'Author: tz + '///Deletes the 1st string in the list which is equal to the input string. + '///+<u>Input</u>: <ol><li>The list (only string lists are possible)</li><li>The string</li></ol> + '///+<u>Return</u>: TRUE if the entry was deleted otherwise FALSE + Dim i as Integer : Dim EintragsNr as Integer : Dim ListenAnzahl as Integer + + ListenAnzahl = Val(lsList(0)) + EintragsNr = 0 + for i = 1 to ListenAnzahl + if lsList(i) = sText then + EintragsNr = i + i = ListenAnzahl + 1 + end if + next i + if EintragsNr = 0 then + ListDeleteString = FALSE + else + ListDeleteString = ListDelete ( lsList(), EintragsNr ) + end if +end function + +'------------------------------------------------------------------------- + +function ListInsert ( lsList() as String, ZeileNr%, sWert$ ) as Boolean + 'Author: tz + '///Inserts a string at a defined position in the list. + '///+<u>Input</u>: <ol><li>The list (only string lists are possible)</li><li>The position</li><li>The string</li></ol> + '///+<u>Return</u>: TRUE if the entry was inserted otherwise FALSE + Dim i% : Dim ListenAnzahl as Integer + + ListenAnzahl = Val(lsList(0)) + if ZeileNr% > ListenAnzahl then + ListInsert = FALSE + Exit Function + end if + + ' Nach hinten verschieben, hinten beginnend + for i% = ListenAnzahl to ZeileNr% step -1 + lsList( i%+1 ) = lsList( i% ) + next i% + + ' Einfuegen + lsList( ZeileNr% ) = sWert$ + lsFile(0) = ListenAnzahl + 1 + ListInsert = TRUE + +end function + +'------------------------------------------------------------------------- + +function ListRead ( lsList() as String, Datei$, optional sEncode as String ) as Boolean + 'Author: tz + '///+Opens a file and insert all rows into a list (row for row). + '///+<u>Input</u>: <ol><li>The list (old list entries will be deleted)</li><li>The file</li><li><b>optional</b>: The encoding "UTF8"</li></ol> + '///+<u>Return</u>: TRUE or FALSE if this routine can read the file. + Dim bUTF8 as Boolean + Dim i% + Dim CompareList(15000) as String + + if Dir( Datei$ ) = "" then + Warnlog "ListRead: " + Datei$ + " is missing!" + ListRead = FALSE + exit function + end if + + if IsMissing ( sEncode ) = TRUE then + bUTF8 = FALSE + else + if UCASE ( sEncode ) = "UFT8" OR UCASE ( sEncode ) = "UTF8" then + bUTF8 = TRUE + else + Warnlog "ListRead :" + sEncode + " - Encoding is unkown!" + bUTF8 = FALSE + end if + end if + + ListAllDelete ( lsList() ) ' clean up the list + + if bUTF8 = TRUE then + Dim textin as object, sfa as object, xInput as object ' for UTF-8-input-routines + Dim iC as Integer + + textin = createUnoService( "com.sun.star.io.TextInputStream" ) ' uno-handling to input an UFT-8-File + textin.setEncoding("utf8") ' + sfa = createUnoService( "com.sun.star.ucb.SimpleFileAccess" ) ' + xInput = sfa.openFileRead( Datei$ ) ' + textin.setInputStream( xInput ) ' + + do until textin.isEOF() ' + i% = Val(lsList(0)) + 1 + lsList(0) = i% + lsList( i% ) = textin.readLine() ' + loop + xInput.closeInput ' uno-file-close + + 'INFO: (TZ) Only to workaround a problem with UNIX-Files... + if Right ( lsList(i%), 1 ) = Chr(10) then + lsList(i%) = Left ( lsList(i%), Len ( lsList(i%) ) - 1 ) + end if + 'INFO: (TBO) Remove the BOM http://www.unicode.org/versions/Unicode4.0.0/ch15.pdf + if (left(lsList(1), 1) = chr(&HFEFF)) then + lsList(1) = right(lsList(1), Len(lsList(1)) - 1) + end if + else + Dim FileNum% + + FileNum% = FreeFile + Open Datei$ for input as #FileNum% + + do until EOF(#FileNum%) ' all from LIS-file + i% = Val(lsList(0)) + 1 + lsList(0) = i% + Line Input #FileNum%, lsList( i% ) + loop + Close #FileNum% + end if + ListRead = TRUE +end function + +'------------------------------------------------------------------------- + +function ListWrite ( lsList() as String, Datei$, optional sEncode as String) as Boolean + 'Author: tz + '///+Writes a list into a file (an existing file will be deleted before) + '///+<u>Input</u>: <ol><li>The list</li><li>The file</li><li><b>optional</b>: The encoding "UTF8"</li></ol> + '///+<u>return</u>: TRUE or FALSE if this routine can read the file. + + Dim bUTF8 as Boolean + Dim i% + + if Dir (Datei$) <> "" then + Kill(Datei$) ' the file must be deleted if you use 'UTF8' + endif + + if IsMissing ( sEncode ) = TRUE then + bUTF8 = FALSE + else + if UCASE ( sEncode ) = "UTF8" then + bUTF8 = TRUE + else + Warnlog "ListWrite :" + sEncode + " - Encoding is unkown!" + bUTF8 = FALSE + end if + end if + + if bUTF8 = TRUE then + Dim textout as object, sfa as object, xOutput as object ' for UTF-8-output-routines + + textout = createUnoService( "com.sun.star.io.TextOutputStream" ) ' uno-handling to output an UFT-8-File + textout.setEncoding("utf8") ' + sfa = createUnoService( "com.sun.star.ucb.SimpleFileAccess" ) ' + xOutput = sfa.openFileWrite( Datei$ ) ' + textout.setOutputStream( xOutput ) ' + + for i%=1 to ListCount ( lsList() ) + textout.writeString( lsList( i% ) + Chr(13) + Chr(10) ) ' + next i% + xOutput.closeOutput ' uno-file-close + else + Dim FileNum% : Dim iLast% + + FileNum% = FreeFile + Open Datei$ for Output as #FileNum% + iLast% = Val(lsList(0)) + i%=1 + do while i% <= iLast% + Print #FileNum%, lsList(i%) + i% = i% +1 + loop + Close #FileNum% + endif + + ListWrite = TRUE +end function -***** +'------------------------------------------------------------------------- + +function ListReadAppend( lsList() as String , Datei$, optional sEncode as String ) as Boolean + 'Author: tz + '///+Appends a list into a file (If the file exists the file will be deleted before!). + '///+<u>Input</u>: <ol><li>The list</li><li>The file</li><li><b>optional</b>: The encoding "UTF8"</li></ol> + '///+<u>return</u>: TRUE or FALSE if this routine can read the file. + + Dim bUTF8 as Boolean + Dim i% + Dim CompareList() as String + Dim isCounter as Integer + Dim FileNum% + + if Dir( Datei$ ) = "" then + Warnlog "ListReadAppend : " + Datei$ + " is missing!" + ListReadAppend = FALSE + exit function + end if + + isCounter = ListCount ( lsList() ) + + if IsMissing ( sEncode ) = TRUE then + bUTF8 = FALSE + else + if UCASE ( sEncode ) = "UFT8" OR UCASE ( sEncode ) = "UTF8" then + bUTF8 = TRUE + else + Warnlog "ListRead : " + sEncode + " - Encoding is unkown!" + bUTF8 = FALSE + end if + end if + + if bUTF8 = TRUE then + Dim textin as object, sfa as object, xInput as object ' for UTF-8-input-routines + + textin = createUnoService( "com.sun.star.io.TextInputStream" ) ' uno-handling to input an UFT-8-File + textin.setEncoding("utf8") ' + sfa = createUnoService( "com.sun.star.ucb.SimpleFileAccess" ) ' + xInput = sfa.openFileRead( Datei$ ) ' + textin.setInputStream( xInput ) ' + + do until textin.isEOF() ' + i% = Val(lsList(0)) + 1 + lsList(0) = i% + lsList( i% ) = textin.readLine() ' + loop + xInput.closeInput ' uno-file-close + + 'INFO: (TZ) Only to workaround a problem with UNIX-Files... + if Right ( lsList(i%), 1 ) = Chr(10) then + lsList(i%) = Left ( lsList(i%), Len ( lsList(i%) ) - 1 ) + end if + '... + else + FileNum% = FreeFile + Open Datei$ for input as #FileNum% + + do until EOF(FileNum%) ' All from LIST-file + i% = Val(lsList(0)) + 1 + lsList(0) = i% + Line Input #FileNum%, lsList( i% ) + loop + Close #FileNum% + end if + + ListReadAppend = TRUE + +end function + +'------------------------------------------------------------------------- + +function ListWriteAppend( lsList() as String, Datei$, optional sEncode as String ) as Boolean + 'Author: tz + '///+Writes a list into a file (If the files exist all entries will be appended). + '///+<u>Input</u>: <ol><li>The list</li><li>The file</li><li><b>optional</b>: The encoding "UTF8"</li></ol> + '///+<u>return</u>: TRUE or FALSE if this routine can read the file. + + Dim bUTF8 as Boolean + Dim i% + Dim DummyList ( 15000 ) as String + + if IsMissing ( sEncode ) = TRUE then + bUTF8 = FALSE + else + if UCASE ( sEncode ) = "UTF8" then + bUTF8 = TRUE + else + Warnlog "ListRead :" + sEncode + " - Encoding is unkown!" + bUTF8 = FALSE + end if + end if + + if bUTF8 = TRUE then + Dim sfa as object, xOutput as object, textout as object ' for UTF-8-output-routines + + ListRead ( DummyList(), Datei$, "utf8" ) ' read old file in another list + for i% = 1 to ListCount ( lsList() ) + ListAppend ( DummyList(), lsList(i%) ) ' add the new list at the old list + next i% + + textout = createUnoService( "com.sun.star.io.TextOutputStream" ) ' uno-handling to output an UFT-8-File + textout.setEncoding("utf8") ' + sfa = createUnoService( "com.sun.star.ucb.SimpleFileAccess" ) ' + xOutput = sfa.openFileWrite( Datei$ ) ' + textout.setOutputStream( xOutput ) ' + + for i%=1 to ListCount (DummyList()) + textout.writeString( DummyList( i% ) + Chr(13) + Chr(10 ) ' + next i% + xOutput.closeOutput ' uno-file-close + else + Dim FileNum% + + FileNum% = FreeFile + Open Datei$ for Append as #FileNum% + + for i% = 1 to Val(lsList(0)) + Print #FileNum%, lsList(i%) + next i% + + Close #FileNum% + end if + ListWriteAppend = TRUE + +end function + +'------------------------------------------------------------------------- + +sub ListSort ( lsList() as String, optional UpDown as Boolean ) + 'Author: tz + '///+Sorts a list upward per default or downward if optional parameter is FALSE with quicksort method. + '///+<u>Input</u>: Unsorted list + + Dim Listenanzahl as Integer, i as Integer, j as Integer + Dim Zwischenspeicher as String + + ListenAnzahl = Val(lsList(0)) + for i=ListenAnzahl-1 to 1 step -1 + for j=1 to i + if UpDown = FALSE then + ' upward sorting + if uCase ( lsList(j) ) < uCase ( lsList(j+1) ) then + Zwischenspeicher = lsList (j) ' invert value (i) with value (i+1) + lsList (j) = lsList(j+1) + lsList (j+1) = Zwischenspeicher + end if + else + ' Downward sorting + if uCase ( lsList(j) ) > uCase ( lsList(j+1) ) then + Zwischenspeicher = lsList (j) ' invert value (i) with value (i+1) + lsList (j) = lsList(j+1) + lsList (j+1) = Zwischenspeicher + end if + end if + next j + next i +end sub + +'******************************************************************************* function gCompare2Lists( aListOne() as String, aListTwo() as String ) as boolean diff --git a/testautomation/global/tools/includes/required/t_menu.inc b/testautomation/global/tools/includes/required/t_menu.inc index 121dd5b2562d..83ad1cc151bb 100644 --- a/testautomation/global/tools/includes/required/t_menu.inc +++ b/testautomation/global/tools/includes/required/t_menu.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,33 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : wrappers for accessing menues (context-, bar-, button- menues) +'* +'\****************************************************************************** + +function hMenuItemGetCount as Integer + + '/// OUTPUT: number of entries in the activated menu (without seperators) ///' + '///+ menu left open ///' + dim iCurrentMenuItem as integer + dim iValidMenuItems as integer + + sleep( 2 ) + + iValidMenuItems = 0 + for iCurrentMenuItem = 1 to MenuGetItemCount + if ( NOT MenuIsSeperator ( iCurrentMenuItem ) ) then + iValidMenuItems = iValidMenuItems + 1 + endif + next iCurrentMenuItem + hMenuItemGetCount = iValidMenuItems -***** +end function + +'******************************************************************************* function hMenuSelectNr ( EintragsNr as Integer ) as String diff --git a/testautomation/global/tools/includes/required/t_option2.inc b/testautomation/global/tools/includes/required/t_option2.inc index 846da461b8bd..392d2abde61e 100644 --- a/testautomation/global/tools/includes/required/t_option2.inc +++ b/testautomation/global/tools/includes/required/t_option2.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,270 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Tools library for options testcases +'* +'\*********************************************************************** + +function OptionTabPageZaehler ( SollAnzahl as Integer, optional Ausnahme as Boolean ) + 'parameter Ausnahme is depracted + Dim IstAnzahl + Kontext "ExtrasOptionenDlg" + IstAnzahl = Optionsliste.GetItemCount - iSectionNumber + if Ausnahme = FALSE then + if IstAnzahl <> SollAnzahl then WarnLog "Number of tabpages old : " + SollAnzahl + " new : " + IstAnzahl + end if + OptionTabPageZaehler = IstAnzahl +end function + +'------------------------------------------------------------------------- + +sub ToPosInOptionlist ( Sprung as Integer ) + Dim i as Integer + Kontext "OptionenDlg" + Optionsliste.TypeKeys "<HOME>" + for i = 1 to 12 + Optionsliste.TypeKeys "-<DOWN>" + next i + Optionsliste.Select Sprung + Optionsliste.TypeKeys "+" +end sub + +'------------------------------------------------------------------------- + +sub DialogeFuerTypenKontrollieren + ' Complete test for path-options, for all entries the file-dialog or the path-dialog will be opened + Dim i as Integer + Dim iCount as Integer + Dim iErrorCount as integer + dim iExitCounter as integer : iExitCounter = 0 + Kontext "TabPfade" + Typ.TypeKeys "<Down><Down><Home>" + iCount = 0 + iErrorCount = 0 + for i=1 to Typ.GetItemCount + if i<>1 then Typ.TypeKeys "<Down>" + printlog " "+typ.getText + if ( bAsianLan <> TRUE ) then + try + Bearbeiten.Click + + do while( iExitCounter <= 10 ) + + kontext "Active" + if ( active.exists() ) then + iErrorCount = iErrorCount + 1 + if (iErrorCount > 1) then + Warnlog active.getText + endif + qaErrorlog "#i69014# gallery path doesn't exist: '" + active.getText + "'" + printlog active.getText + active.ok + endif + + Kontext "OeffnenDlg" + if OeffnenDlg.Exists() then + if ( Dateityp.IsVisible ) then + Warnlog "The normal FileOpen-Dialog is visible with the Filetype-Listbox => BUG!" + endif + OeffnenDlg.Cancel + exit do + endif + + Kontext "PfadeAuswaehlen" + if ( PfadeAuswaehlen.exists() ) then + PfadeAuswaehlen.Cancel + exit do + endif + + iExitCounter = iExitCounter + 1 + loop + Kontext "TabPfade" + catch + Warnlog "Error on entry " & i & "!" + Exceptlog + endcatch + else + try + if ( Bearbeiten.IsEnabled ) then + Bearbeiten.Click + + do while( iExitCounter <= 10 ) + + kontext "Active" + if active.exists () then + iErrorCount = iErrorCount + 1 + if (iErrorCount > 1) then + Warnlog active.getText + endif + qaErrorlog "WorkAround for #109107# has to come up only once @'Add-Ins'! else BUG!" + active.ok + endif + + Kontext "OeffnenDlg" + if OeffnenDlg.Exists() then + if ( Dateityp.IsVisible ) then + Warnlog "The normal FileOpen-Dialog is visible with the Filetype-Listbox => BUG!" + endif + OeffnenDlg.Cancel + exit do + endif + + Kontext "PfadeAuswaehlen" + if ( PfadeAuswaehlen.exists() ) then + PfadeAuswaehlen.Cancel + exit do + end if + + iExitCounter = iExitCounter + 1 + loop + Kontext "TabPfade" + else + iCount = iCount + 1 + end if + catch + Warnlog "Error on entry " & i & "!" + Exceptlog + endcatch + end if + next i + if iCount > 3 then Warnlog "There are more than 3 entries are disabled!" + +end sub + +'------------------------------------------------------------------------- + +function hSetMacroSecurity( iLevel as integer ) as integer + + '///<h3>Set macro security level via GUI</h3> + '///<i>Set the macro security by accessing the Tools/Options-> + '///+ OpenOffice.org/Security::Macro... Tabpage</i><br><br> + + '///<u>Parameter(s):</u><br> + '///<ol> + + '///+<li>Desired macro security level (Integer). Following symbolic names are defined:</li> + '///<ul> + '///+<li>GC_MACRO_SECURITY_LEVEL_LOW (0) for low security</li> + '///+<li>GC_MACRO_SECURITY_LEVEL_MEDIUM (1) for medium security</li> + '///+<li>GC_MACRO_SECURITY_LEVEL_HIGH (2) for high security</li> + '///+<li>GC_MACRO_SECURITY_LEVEL_VERYHIGH (3) for very high security</li> + '///</ul> + + '///</ol> + -***** + '///<u>Returns:</u><br> + '///<ol> + '///+<li>Previous security level (Integer)</li> + '///<ul> + '///+<li>GC_MACRO_SECURITY_LEVEL_LOW (0) for low security</li> + '///+<li>GC_MACRO_SECURITY_LEVEL_MEDIUM (1) for medium security</li> + '///+<li>GC_MACRO_SECURITY_LEVEL_HIGH (2) for high security</li> + '///+<li>GC_MACRO_SECURITY_LEVEL_VERYHIGH (3) for very high security</li> + '///+<li>-1 on error</li> + '///</ul> + '///</ol> + + + + '///Switch between macro security levels in Tools/Options + '///<ul> + const CFN = "hSetMacroSecurity::" + const RETVAL_FAILURE = -1 + const DEFAULT_WAIT_TIME = 2 + + dim iOldSecurityLevel as integer + + dim caLevel( 3 ) as string + caLevel( 0 ) = "low" + caLevel( 1 ) = "medium" + caLevel( 2 ) = "high" + caLevel( 3 ) = "very high" + + if ( ( iLevel < GC_MACRO_SECURITY_LEVEL_LOW ) or ( iLevel > GC_MACRO_SECURITY_LEVEL_VERYHIGH ) ) then + warnlog( CFN & "Invalid index (0...3) passed to function: " & ilevel ) + hSetMacroSecurity() = RETVAL_FAILURE + exit function + end if + + '///+<li>Open Tools/Options -> OpenOffice.org/Security</li> + ToolsOptions + hToolsOptions( "Staroffice" , "Security" ) + + '///+<li>Click on the macro security button</li> + Kontext "TabSecurity" + if ( MacroSecurity.exists( DEFAULT_WAIT_TIME ) ) then + MacroSecurity.click() + + '///+<li>Ensure we are on the Security Level page</li> + kontext "Active" + if ( Active.exists( DEFAULT_WAIT_TIME ) ) then + + Kontext + active.setpage TabSecurityLevel + + '///+<li>Get the current setting (=returnvalue)</li> + Kontext "TabSecurityLevel" + if ( TabSecurityLevel.exists( 2 ) ) then + if ( veryhigh.isChecked() ) then + iOldSecurityLevel = GC_MACRO_SECURITY_LEVEL_VERYHIGH + elseif( high.isChecked() ) then + iOldSecurityLevel = GC_MACRO_SECURITY_LEVEL_HIGH + elseif( medium.isChecked() ) then + iOldSecurityLevel = GC_MACRO_SECURITY_LEVEL_MEDIUM + elseif( low.isChecked() ) then + iOldSecurityLevel = GC_MACRO_SECURITY_LEVEL_LOW + end if + else + printlog( CFN & "Security Tabpage not available. Aborting." ) + kontext "OptionenDlg" + if ( OptionenDlg.exists( DEFAULT_WAIT_TIME ) ) then + OptionenDlg.cancel() + else + warnlog( CFN & "Unrecoverable error, status unknown." ) + endif + hSetMacroSecurity() = RETVAL_FAILURE + exit function + endif + + '///+<li>Set the new security level</li> + select case iLevel + case GC_MACRO_SECURITY_LEVEL_LOW : low.check() + case GC_MACRO_SECURITY_LEVEL_MEDIUM : medium.check() + case GC_MACRO_SECURITY_LEVEL_HIGH : high.check() + case GC_MACRO_SECURITY_LEVEL_VERYHIGH : veryhigh.check() + end select + + printlog( CFN & "Setting macro security level to " & caLevel( iLevel ) ) + + else + printlog( CFN & "Macro Security Dialog did not open. Aborting." ) + kontext "OptionenDlg" + if ( OptionenDlg.exists( DEFAULT_WAIT_TIME ) ) then + OptionenDlg.cancel() + else + warnlog( CFN & "Unrecoverable error, status unknown." ) + endif + hSetMacroSecurity() = RETVAL_FAILURE + exit function + endif + + '///+<li>Close Tools/Options</li> + TabSecurityLevel.ok() + else + warnlog( CFN & "The Macro Security Button is not available" ) + iOldSecurityLevel = RETVAL_FAILURE + end if + Kontext "OptionenDLG" + OptionenDLG.OK() + '///</ul> + hSetMacroSecurity() = iOldSecurityLevel +end function + +'******************************************************************************* function hGetMacroSecurityAPI() as integer diff --git a/testautomation/global/tools/includes/required/t_tools1.inc b/testautomation/global/tools/includes/required/t_tools1.inc index f0e2c418da6d..d559db6db4fc 100644 --- a/testautomation/global/tools/includes/required/t_tools1.inc +++ b/testautomation/global/tools/includes/required/t_tools1.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,59 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Tools (1) +'* +'\****************************************************************************** + +private SLEEP_TIME_REQUESTED as integer +private SLEEP_CALLS_SUM as integer +private SLEEP_TIME_USED as integer + +function GetClipboardText as string + + '/// Returns the correct clipboard text (also if there is a 'RETURN' at it's end. + Dim i% : Dim CBText$ + Dim Zwischen$ + + wait 500 + GetClipboardText = "" + CBText$ = GetClipboard + + if CBText$ = "" then + GetClipboardText = "" + exit function + end if + + if asc ( Right( CBText$, 1 )) = 10 then + Zwischen$ = Mid( CBText$, 1, len(CBText$)-1 ) + if Zwischen$ <> "" then + if asc ( Right( Zwischen$, 1 )) = 13 then + GetClipboardText = Mid( Zwischen$, 1, len(Zwischen$)-1 ) + else + GetClipboardText = Zwischen$ + end if + else + GetClipboardText = Zwischen$ + end if + else + if asc ( Right( CBText$, 1 )) = 13 then + Zwischen$ = Mid( CBText$, 1, len(CBText$)-1 ) + if asc ( Right( Zwischen$, 1 )) = 10 then + GetClipboardText = Mid( Zwischen$, 1, len(Zwischen$)-1 ) + else + GetClipboardText = Zwischen$ + end if + else + GetClipboardText = CBText$ + end if + end if + +end function -***** +'******************************************************************************* function hDoubleClickInList ( window, Selektion as String, optional bFocus as boolean ) as Boolean diff --git a/testautomation/global/tools/includes/required/t_tools3.inc b/testautomation/global/tools/includes/required/t_tools3.inc index 51150482a2dc..74c117f1ea72 100644 --- a/testautomation/global/tools/includes/required/t_tools3.inc +++ b/testautomation/global/tools/includes/required/t_tools3.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,898 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Global Tools III +'* +'\****************************************************************************** + +sub hToolbarSelect( sType as string, sOpen as boolean, optional SetToDefault as boolean ) + Dim sDefault as integer, sKontext as string, sPosition as integer + Dim SteppedThrough as boolean + '/// Created by helge.delfs@oracle.com + '/// This function opens/closes a toolbar through View/Toolbar menu + '/// Required parameters: + '/// sType as string -> Name of the toolbar to be opened / closed + '/// sOpen as boolean -> Shall the toolbar be opened (true) or closed (false) + '/// optional SetToDefault as boolean -> true if Toolbar-State should be set to default + + Select Case Ucase(sType) + case "3DSETTING" + Kontext "ExtrusionObjectBar" + if ExtrusionObjectBar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsThreeDSettings + else + if SetToDefault = True then ViewToolbarsThreeDSettings + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsThreeDSettings + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsThreeDSettings + endif + endif + endif + -***** + case "ALIGN" + Kontext "Alignmentbar" + if Alignmentbar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsAlign + else + if SetToDefault = True then ViewToolbarsAlign + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsAlign + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsAlign + endif + endif + endif + + Case "BULLETSANDNUMBERING" + Kontext "NumObjectbar" + if NumObjectbar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsBulletsAndNumbering + else + if SetToDefault = True then ViewToolbarsBulletsAndNumbering + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsBulletsAndNumbering + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsBulletsAndNumbering + endif + endif + endif + + case "COLOR" + Kontext "ColorBar" + if ColorBar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsColor + else + if SetToDefault = True then ViewToolbarsColor + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsColor + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsColor + endif + endif + endif + + case "CUSTOMIZE" + ViewToolbarsCustomize + + case "DRAWING" + Kontext "DrawBar" + if DrawBar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsDrawing + else + if SetToDefault = True then ViewToolbarsDrawing + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsDrawing + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsDrawing + endif + endif + endif + + case "FORMATTING" + Kontext "TextObjectbar" + if TextObjectbar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsFormatting + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsFormatting + else + if SetToDefault = True then ViewToolbarsFormatting + endif + endif + endif + + case "FORMCONTROLS" + Kontext "FormControls" + if FormControls.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsFormControls + else + if SetToDefault = True then ViewToolbarsFormControls + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsFormControls + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsFormControls + endif + endif + endif + case "CONTROLS" + Kontext "FormControls" + if FormControls.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsFormControls + else + if SetToDefault = True then ViewToolbarsFormControls + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsFormControls + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsFormControls + endif + endif + endif + + case "FORMDESIGNTOOLS", "FORMDESIGN" + Kontext "FormDesignTools" + if FormDesignTools.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsFormDesign + else + if SetToDefault = True then ViewToolbarsFormDesign + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsFormDesign + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsFormDesign + endif + endif + endif + + case "HTMLSOURCEVIEW" + Kontext "SourceViewToolbar" + if SourceViewToolbar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsHTMLSourceView + else + if SetToDefault = True then ViewToolbarsHTMLSourceView + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsHTMLSourceView + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsHTMLSourceView + endif + endif + endif + + case "FORMFILTER" + Kontext "FormsFilterBar" + if FormsFilterBar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsFormFilter + else + if SetToDefault = True then ViewToolbarsFormFilter + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsFormFilter + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsFormFilter + endif + endif + endif + + case "FORMNAVIGATION" + Kontext "FormsNavigationBar" + if FormsNavigationBar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsFormNavigation + else + if SetToDefault = True then ViewToolbarsFormNavigation + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsFormNavigation + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsFormNavigation + endif + endif + endif + + case "FORMOBJECT" + Kontext "FormsObjectbar" + if FormsObjectbar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsFormObject + else + if SetToDefault = True then ViewToolbarsFormObject + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsFormObject + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsFormObject + endif + endif + endif + + case "FRAME" + Kontext "FrameObjectbar" + if FrameObjectbar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsFrame + else + if SetToDefault = True then ViewToolbarsFrame + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsFrame + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsFrame + endif + endif + endif + + case "FULLSCREEN" + Kontext "FullScreenBar" + if FullScreenBar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsFullScreen + else + if SetToDefault = True then ViewToolbarsFullScreen + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsFullScreen + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsFullScreen + endif + endif + endif + + case "GRAPHIC", "DRAWINGOBJECTPROPERTIES" + Kontext "DrawingObjectbar" + if DrawingObjectbar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsGraphic + else + if SetToDefault = True then ViewToolbarsGraphic + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsGraphic + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsGraphic + endif + endif + endif + + case "HYPERLINK", "HYPERLINKBAR" + Kontext "Hyperlinkleiste" + if Hyperlinkleiste.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsInsertHyperlink + else + if SetToDefault = True then ViewToolbarsInsertHyperlink + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsInsertHyperlink + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsInsertHyperlink + endif + endif + endif + + + case "INSERT" + Kontext "InsertBar" + if InsertBar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsInsert + else + if SetToDefault = True then ViewToolbarsInsert + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsInsert + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsInsert + endif + endif + endif + + case "INSERTOBJECT" + Kontext "InsertObjectBar" + if InsertObjectBar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsInsertObject + else + if SetToDefault = True then ViewToolbarsInsertObject + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsInsertObject + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsInsertObject + endif + endif + endif + + case "MEDIAPLAYBACK" + Kontext "MediaObjectBar" + if MediaObjectBar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsMediaPlayback + else + if SetToDefault = True then ViewToolbarsMediaPlayback + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsMediaPlayback + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsMediaPlayback + endif + endif + endif + + case "MORECONTROLS" + Kontext "MoreControls" + if MoreControls.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsMoreControls + else + if SetToDefault = True then ViewToolbarsMoreControls + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsMoreControls + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsMoreControls + endif + endif + endif + + case "MOREXFORMCONTROLS" + Kontext "MoreXFormControls" + if MoreXFormControls.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsMoreXFormControls + else + if SetToDefault = True then ViewToolbarsMoreXFormControls + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsMoreXFormControls + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsMoreXFormControls + endif + endif + endif + + case "OLEOBJECT" + Kontext "OLEObjectbar" + if OLEObjectbar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsOleObject + else + if SetToDefault = True then ViewToolbarsOleObject + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsOleObject + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsOleObject + endif + endif + endif + + case "OPTIMIZETABLE" + Kontext "OptimizeTablebar" + if OptimizeTablebar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsOptimizeTable + else + if SetToDefault = True then ViewToolbarsOptimizeTable + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsOptimizeTable + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsOptimizeTable + endif + endif + endif + + case "PAGEPREVIEW" + Kontext "PreviewObjectbar" + if PreviewObjectbar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsPagePreview + else + if SetToDefault = True then ViewToolbarsPagePreview + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsPagePreview + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsPagePreview + endif + endif + endif + + case "PATH" + Kontext "BezierObjectBar" + if BezierObjectBar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsBezier + else + if SetToDefault = True then ViewToolbarsBezier + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsBezier + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsBezier + endif + endif + endif + + case "PICTURE" + Kontext "GraphicObjectbar" + if GraphicObjectbar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsPicture + else + if SetToDefault = True then ViewToolbarsPicture + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsPicture + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsPicture + endif + endif + endif + + case "PICTUREFILTER" + Kontext "GraphicFilterBar" + if GraphicFilterBar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsPictureFilter + else + if SetToDefault = True then ViewToolbarsPictureFilter + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsPictureFilter + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsPictureFilter + endif + endif + endif + + case "STANDARD" + Kontext "StandardBar" + if StandardBar.Exists then + if StandardBar.IsVisible then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsStandard + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsStandard + else + if SetToDefault = True then ViewToolbarsStandard + endif + endif + endif + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsStandard + else + if SetToDefault = True then ViewToolbarsStandard + endif + endif + endif + + case "STANDARDVIEWINGMODE" + Kontext "Viewerbar" + if Viewerbar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsStandardView + else + if SetToDefault = True then ViewToolbarsStandardView + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsStandardView + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsStandardView + endif + endif + endif + + case "TABLE" + Kontext "TableObjectbar" + if TableObjectbar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsTable + else + if SetToDefault = True then ViewToolbarsTable + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsTable + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsTable + endif + endif + endif + + case "TEXTOBJECT" + Kontext "DrawTextObjectBar" + if DrawTextObjectBar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsTextObject + else + if SetToDefault = True then ViewToolbarsTextObject + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsTextObject + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsTextObject + endif + endif + endif + + case "TOOLS" + Kontext "Toolbar" + if Toolbar.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsTools + else + if SetToDefault = True then ViewToolbarsTools + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsTools + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsTools + endif + endif + endif + + + case "MATH" + Kontext "OL_SW_Rechenleiste" + if OL_SW_Rechenleiste.Exists then + Select Case sOpen + Case False + if IsMissing(SetToDefault) then + ViewToolbarsInsertFormula + else + if SetToDefault = True then ViewToolbarsInsertFormula + endif + Case True + if IsMissing(SetToDefault) = False then + if SetToDefault = True then ViewToolbarsInsertFormula + endif + end select + else + if sOpen = True then + if IsMissing(SetToDefault) then + ViewToolbarsInsertFormula + endif + endif + endif + + case else + Warnlog "No menuentry for parameter " & sType & " found!" + + end select + Sleep 1 + +end sub + +sub hCloseAllToolbars + '/// Created by thorsten.bosbach@oracle.com + '/// This function closes all known toolbars which are not docked + '/// only if Build ID is below 8892 + if (gBuild < 8892) AND (gBuild > 8888) then + try + Kontext "ExtrusionObjectBar" + if ExtrusionObjectBar.Exists(0) then if NOT ExtrusionObjectBar.isDocked then ExtrusionObjectBar.close + Kontext "Alignmentbar" + if Alignmentbar.Exists(0) then if NOT Alignmentbar.isDocked then Alignmentbar.close + Kontext "NumObjectbar" + if NumObjectbar.Exists(0) then if NOT NumObjectbar.isDocked then NumObjectbar.close + Kontext "DrawBar" + if DrawBar.Exists(0) then if NOT DrawBar.isDocked then DrawBar.close + Kontext "TextObjectbar" + if TextObjectbar.Exists(0) then if NOT TextObjectbar.isDocked then TextObjectbar.close + Kontext "FormControls" + if FormControls.Exists(0) then if NOT FormControls.isDocked then FormControls.close + Kontext "FormControls" + if FormControls.Exists(0) then if NOT FormControls.isDocked then FormControls.close + Kontext "FormDesignTools" + if FormDesignTools.Exists(0) then if NOT FormDesignTools.isDocked then FormDesignTools.close + Kontext "SourceViewToolbar" + if SourceViewToolbar.Exists(0) then if NOT SourceViewToolbar.isDocked then SourceViewToolbar.close + Kontext "FormsFilterBar" + if FormsFilterBar.Exists(0) then if NOT FormsFilterBar.isDocked then FormsFilterBar.close + Kontext "FormsNavigationBar" + if FormsNavigationBar.Exists(0) then if NOT FormsNavigationBar.isDocked then FormsNavigationBar.close + Kontext "FormsObjectbar" + if FormsObjectbar.Exists(0) then if NOT FormsObjectbar.isDocked then FormsObjectbar.close + Kontext "FrameObjectbar" + if FrameObjectbar.Exists(0) then if NOT FrameObjectbar.isDocked then FrameObjectbar.close + Kontext "FullScreenBar" + if FullScreenBar.Exists(0) then if NOT FullScreenBar.isDocked then FullScreenBar.close + Kontext "DrawingObjectbar" + if DrawingObjectbar.Exists(0) then if NOT DrawingObjectbar.isDocked then DrawingObjectbar.close + Kontext "Hyperlinkleiste" + if Hyperlinkleiste.Exists(0) then if NOT Hyperlinkleiste.isDocked then Hyperlinkleiste.close + Kontext "InsertBar" + if InsertBar.Exists(0) then if NOT InsertBar.isDocked then InsertBar.close + Kontext "InsertObjectBar" + if InsertObjectBar.Exists(0) then if NOT InsertObjectBar.isDocked then InsertObjectBar.close + Kontext "MediaObjectBar" + if MediaObjectBar.Exists(0) then if NOT MediaObjectBar.isDocked then MediaObjectBar.close + Kontext "MoreControls" + if MoreControls.Exists(0) then if NOT MoreControls.isDocked then MoreControls.close + Kontext "OLEObjectbar" + if OLEObjectbar.Exists(0) then if NOT OLEObjectbar.isDocked then OLEObjectbar.close + Kontext "OptimizeTablebar" + if OptimizeTablebar.Exists(0) then if NOT OptimizeTablebar.isDocked then OptimizeTablebar.close + Kontext "PreviewObjectbar" + if PreviewObjectbar.Exists(0) then if NOT PreviewObjectbar.isDocked then PreviewObjectbar.close + Kontext "BezierObjectBar" + if BezierObjectBar.Exists(0) then if NOT BezierObjectBar.isDocked then BezierObjectBar.close + Kontext "GraphicObjectbar" + if GraphicObjectbar.Exists(0) then if NOT GraphicObjectbar.isDocked then GraphicObjectbar.close + Kontext "GraphicFilterBar" + if GraphicFilterBar.Exists(0) then if NOT GraphicFilterBar.isDocked then GraphicFilterBar.close + Kontext "StandardBar" + if StandardBar.Exists(0) then if NOT StandardBar.isDocked then StandardBar.close + Kontext "Viewerbar" + if Viewerbar.Exists(0) then if NOT Viewerbar.isDocked then Viewerbar.close + Kontext "TableObjectbar" + if TableObjectbar.Exists(0) then if NOT TableObjectbar.isDocked then TableObjectbar.close + Kontext "DrawTextObjectBar" + if DrawTextObjectBar.Exists(0) then if NOT DrawTextObjectBar.isDocked then DrawTextObjectBar.close + Kontext "Toolbar" + if Toolbar.Exists(0) then if NOT Toolbar.isDocked then Toolbar.close + Kontext "OL_SW_Rechenleiste" + if OL_SW_Rechenleiste.Exists(0) then if NOT OL_SW_Rechenleiste.isDocked then OL_SW_Rechenleiste.close + catch + printlog "tools3.inc::hCloseAllToolbars Can't close some toolbar" + endcatch + endif +end sub + +'******************************************************************************* function hIsAccessbridgeInstalled() as boolean '/// created by HDE diff --git a/testautomation/graphics/optional/includes/impress/i_saveloadlayout.inc b/testautomation/graphics/optional/includes/impress/i_saveloadlayout.inc index a00ffa08c776..9033314b5bbe 100644 --- a/testautomation/graphics/optional/includes/impress/i_saveloadlayout.inc +++ b/testautomation/graphics/optional/includes/impress/i_saveloadlayout.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,56 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description: Save & Load testing of Layout -templates. +'* +'\************************************************************************************** + +testcase tSaveLoadLayoutEmpty + Dim NewFileDir as String + NewFileDir = ConvertPath (gOfficePath + "user\work\LayoutTest\") + + printlog "Create New folder in the Work-directory" + printlog " Will try to create the directory: " + NewFileDir + app.mkdir NewFileDir -************************** + printlog "Create a new document, add an empty Layout, Save the document in all available Formats, and open the saved files." + + printlog "Make new Presentation" + gApplication = "IMPRESS" + Call hNewDocument + + printlog "Choose and Insert an empty Layout." + printlog " Choose and Insert an empty Layout." + FormatModifyPage + sleep (1) + kontext "Tasks" + LayoutsPreview.TypeKeys "<HOME>" + kontext "Pagelayout_UndoDeleteWarning" + if Pagelayout_UndoDeleteWarning.exists then + Pagelayout_UndoDeleteWarning.ok + end if + kontext "Tasks" + printlog "Press Enter to use the layout on the current slide" + LayoutsPreview.TypeKeys "<RETURN>" + sleep (5) + + printlog "Save the document in different formats..." + printlog "Close the file." + printlog "Load the different files." + call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below. + + printlog "Delete the different files." + printlog " Will try to delete the directory: " + NewFileDir + app.rmDir NewFileDir + + printlog "tSaveLoadLayoutEmpty ended." + printlog "End the test" +endcase 'tSaveLoadLayoutEmpty + +'**************************************************************************************************** testcase tSaveLoadLayoutText printlog "Testing layout with text." diff --git a/testautomation/graphics/required/includes/draw/d_002_.inc b/testautomation/graphics/required/includes/draw/d_002_.inc index e249fa833cd4..761d583040f5 100644 --- a/testautomation/graphics/required/includes/draw/d_002_.inc +++ b/testautomation/graphics/required/includes/draw/d_002_.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,21 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : +'* +'\***************************************************************** + +sub d_002 + + call tdEditCrossFading() + call tdEditLayer() + +end sub -***** +'******************************************************************************* testcase tdEditCrossFading diff --git a/testautomation/graphics/required/includes/draw/d_003_.inc b/testautomation/graphics/required/includes/draw/d_003_.inc index 8b419a11bca7..22bd4652c398 100644 --- a/testautomation/graphics/required/includes/draw/d_003_.inc +++ b/testautomation/graphics/required/includes/draw/d_003_.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,21 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : +'* +'\***************************************************************** + +sub d_003 + + call tdViewPagePane() + call tdViewSlide() + +end sub -***** +'******************************************************************************* testcase tdViewPagePane diff --git a/testautomation/graphics/required/includes/draw/d_005_.inc b/testautomation/graphics/required/includes/draw/d_005_.inc index 6ef1243610b4..95ec72dccbaf 100644 --- a/testautomation/graphics/required/includes/draw/d_005_.inc +++ b/testautomation/graphics/required/includes/draw/d_005_.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,20 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : +'* +'\***************************************************************** + +sub d_005 + + call tiFormatLayer() + +end sub -***** +'******************************************************************************* testcase tiFormatLayer diff --git a/testautomation/graphics/required/includes/draw/d_007.inc b/testautomation/graphics/required/includes/draw/d_007.inc index e0397e72591a..629125e20e15 100644 --- a/testautomation/graphics/required/includes/draw/d_007.inc +++ b/testautomation/graphics/required/includes/draw/d_007.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,20 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : +'* +'\***************************************************************** + +sub d_007 + + call tdModifyRotate() + +end sub -***** +'******************************************************************************* testcase tdModifyRotate diff --git a/testautomation/graphics/required/includes/impress/im_002_.inc b/testautomation/graphics/required/includes/impress/im_002_.inc index e808d4213a1b..410dc5d4a09e 100644 --- a/testautomation/graphics/required/includes/impress/im_002_.inc +++ b/testautomation/graphics/required/includes/impress/im_002_.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,20 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Impress Required Test Library (2) +'* +'\***************************************************************** + +sub im_002_ + + call tiEditDeleteSlide() + +end sub -***** +'******************************************************************************* testcase tiEditDeleteSlide diff --git a/testautomation/graphics/required/includes/impress/im_003_.inc b/testautomation/graphics/required/includes/impress/im_003_.inc index 116115841b8c..4e3cc46b87db 100644 --- a/testautomation/graphics/required/includes/impress/im_003_.inc +++ b/testautomation/graphics/required/includes/impress/im_003_.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,23 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Impress Resource Test: View Menu +'* +'\****************************************************************************** + +sub im_003_ + + call tiViewPanes() + call tiViewMasterView() + call tiViewSlideMaster() + call tiViewToolbar_1() + +end sub -***** +'******************************************************************************* testcase tiViewPanes diff --git a/testautomation/graphics/required/includes/impress/im_004_.inc b/testautomation/graphics/required/includes/impress/im_004_.inc index 142ef5919c62..0bd8c956ffb4 100644 --- a/testautomation/graphics/required/includes/impress/im_004_.inc +++ b/testautomation/graphics/required/includes/impress/im_004_.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,20 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Impress Required Test Library (4) +'* +'\***************************************************************** + +sub im_004_ + + call tiInsertSlideExpandSummary() + +end sub -***** +'******************************************************************************* testcase tiInsertSlideExpandSummary diff --git a/testautomation/graphics/required/includes/impress/im_005_.inc b/testautomation/graphics/required/includes/impress/im_005_.inc index 8e71e9be74a0..8ff49f9cac27 100644 --- a/testautomation/graphics/required/includes/impress/im_005_.inc +++ b/testautomation/graphics/required/includes/impress/im_005_.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,20 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Impress Required Test Library (5) +'* +'\***************************************************************** + +sub im_005_ + + call tiFormatModifyLayout() + +end sub -***** +'******************************************************************************* testcase tiFormatModifyLayout diff --git a/testautomation/graphics/required/includes/impress/im_007_.inc b/testautomation/graphics/required/includes/impress/im_007_.inc index 4dd9de7e5c89..36b4f1c36c6b 100644 --- a/testautomation/graphics/required/includes/impress/im_007_.inc +++ b/testautomation/graphics/required/includes/impress/im_007_.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,28 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -***** +' +'************************************************************** +'* +'* short description : Impress Required Test Library (7) +'* +'\***************************************************************** + +sub im_007_ + + call tSlideShowSlideShow() + call tSlideShowRehearseTimings() + call tSlideShowSlideShowSettings() + call tSlideShowCustomSlideShow() + call tSlideShowSlideTransition() + call tSlideShowShowHideSlide() + call tSlideShowCustomAnimation() + call tSlideShowInteraction() + call tSlideShowAnimation() + +end sub + +'******************************************************************************* testcase tSlideShowSlideShow diff --git a/testautomation/graphics/required/includes/impress/im_011_.inc b/testautomation/graphics/required/includes/impress/im_011_.inc index 71fa5f258dfd..75c2405a83dd 100644 --- a/testautomation/graphics/required/includes/impress/im_011_.inc +++ b/testautomation/graphics/required/includes/impress/im_011_.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,20 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* +' +'************************************************************** +'* +'* short description : Impress Required Test Library (11) +'* +'\***************************************************************** + +sub m_011_ + + call tiDiaLeiste() + +end sub -***** +'******************************************************************************* testcase tiDiaLeiste diff --git a/testautomation/spreadsheet/optional/includes/printscale/c_print_scale.inc b/testautomation/spreadsheet/optional/includes/printscale/c_print_scale.inc index 253a3e7c5331..95f6cbc86da1 100644 --- a/testautomation/spreadsheet/optional/includes/printscale/c_print_scale.inc +++ b/testautomation/spreadsheet/optional/includes/printscale/c_print_scale.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -*********************** +' +'************************************************************** +'* +'* short description : Check correct print scaling settings +'* +'************************************************************************************************* '* ' #1 subPrintScaling ' #1 tPrintScaling diff --git a/testautomation/spreadsheet/tools/includes/c_cell_tools.inc b/testautomation/spreadsheet/tools/includes/c_cell_tools.inc index ca0e0e9e3a12..895135ec66a3 100644 --- a/testautomation/spreadsheet/tools/includes/c_cell_tools.inc +++ b/testautomation/spreadsheet/tools/includes/c_cell_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************************ +' +'************************************************************** +'* +'* short description : tools for working with cells in calc +'* +'************************************************************************************************** '* ' #1 fCalcGetCellValue 'Returns the value of a given cell ' #1 fCalcCompareCellValue 'Compares the value of a given cell with a given result diff --git a/testautomation/spreadsheet/tools/includes/c_select_tools.inc b/testautomation/spreadsheet/tools/includes/c_select_tools.inc index 3ddef403df45..b4780e1756b9 100644 --- a/testautomation/spreadsheet/tools/includes/c_select_tools.inc +++ b/testautomation/spreadsheet/tools/includes/c_select_tools.inc @@ -1,6 +1,6 @@ 'encoding UTF-8 Do not remove or change this line! -'************************************************************************* -' +'************************************************************** +' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information @@ -17,10 +17,12 @@ ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. -' -'************************************************************************* - -************************ +' +'************************************************************** +'* +'* short description : selecting objects in calc +'* +'************************************************************************************************** '* ' #1 fCalcSelectRange ' #1 fCalcNameRange |