Return-Path: X-Original-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D2C8A9D41 for ; Sat, 14 Jan 2012 00:57:42 +0000 (UTC) Received: (qmail 94814 invoked by uid 500); 14 Jan 2012 00:57:42 -0000 Delivered-To: apmail-incubator-ooo-commits-archive@incubator.apache.org Received: (qmail 94750 invoked by uid 500); 14 Jan 2012 00:57:42 -0000 Mailing-List: contact ooo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ooo-dev@incubator.apache.org Delivered-To: mailing list ooo-commits@incubator.apache.org Received: (qmail 94731 invoked by uid 99); 14 Jan 2012 00:57:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Jan 2012 00:57:41 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Jan 2012 00:57:36 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 7CE3523889EC; Sat, 14 Jan 2012 00:57:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1231427 [3/5] - in /incubator/ooo/trunk/main/testautomation: chart2/optional/includes/loadsave/ chart2/required/includes/ chart2/tools/ dbaccess/tools/ framework/optional/includes/ framework/required/includes/ framework/tools/includes/ glo... Date: Sat, 14 Jan 2012 00:57:11 -0000 To: ooo-commits@incubator.apache.org From: arist@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120114005716.7CE3523889EC@eris.apache.org> Modified: incubator/ooo/trunk/main/testautomation/global/required/includes/g_findbar.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/required/includes/g_findbar.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/required/includes/g_findbar.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/required/includes/g_findbar.inc Sat Jan 14 00:57:08 2012 @@ -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 (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 " ) + endif + + printlog( "Click (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 " ) + endif + + qaerrorlog( "#i111984 - exclude 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 is visible, it should be hidden by default" ) + else + printlog( "Button is hidden, good" ) + endif + else + warnlog( " button should not be visible" ) + endif + + printlog( "Add 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 Listbox. Good." ) + else + warnlog( "Search string should have been copied from findbar to search dialog" ) + endif + FindAndReplace.close() + else + warnlog( "Dialog is missing" ) + endif + + printlog( "Remove button from toolbar" ) + hToggleSearchDialog() + + skip_SearchDialog: + + else + warnlog( "FindBar is not visible" ) + endif + + hCloseDocument() + +endcase -***** +'******************************************************************************* function hToggleSearchDialog() Modified: incubator/ooo/trunk/main/testautomation/global/required/includes/g_printing.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/required/includes/g_printing.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/required/includes/g_printing.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/required/includes/g_printing.inc Sat Jan 14 00:57:08 2012 @@ -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() Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_accels.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_accels.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_accels.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_accels.inc Sat Jan 14 00:57:08 2012 @@ -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 '** Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_basic_ide_tools.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_basic_ide_tools.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_basic_ide_tools.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_basic_ide_tools.inc Sat Jan 14 00:57:08 2012 @@ -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 + + '///

Tear off the ToolsCollectionBar from the MacroBar

+ '///Starting point: Basic dialog editor is open and has the focus + '///
    + 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" ) + + '///+
  • Test whether the ToolsCollectionBar is already open. If yes, exit directly
  • + kontext "ToolsCollectionBar" + if ( ToolsCollectionBar.exists( SHORT_WAIT ) ) then + printlog( CFN & "ToolsCollectionBar is already open." ) + hShowMacroControls() = true + exit function + endif + + '///+
  • Verify that the Dialog Bar is available
  • + Kontext "DialogBar" + if ( DialogBar.exists( MAX_WAIT ) ) then + + '///+
  • Verify that the controls-button is enabled
  • + try + '///+
  • Click on the controls-button to open the ToolsCollectionBar
  • + controls.click() + + '///+
  • Tear off the ToolsCollectionBar from the DialogBar
  • + controls.tearOff() + + '///+
  • Verify that the ToolsCollectionBar is visible and can be accessed
  • + kontext "ToolsCollectionBar" + if ( ToolsCollectionBar.exists( MAX_WAIT ) ) then + + '///+
  • Move it to the upper left corner at pos 50/50
  • + 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 + '///
+ +end function + +'******************************************************************************* function hGetBasicWorkFile( cMajorID as string ) as string Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_basic_organizer_tools.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_basic_organizer_tools.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_basic_organizer_tools.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_basic_organizer_tools.inc Sat Jan 14 00:57:08 2012 @@ -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 + + '///

Select the last (editable) module in the macro seletor treelist + + 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 Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_control_objects.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_control_objects.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_control_objects.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_control_objects.inc Sat Jan 14 00:57:08 2012 @@ -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 Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_docfuncs.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_docfuncs.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_docfuncs.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_docfuncs.inc Sat Jan 14 00:57:08 2012 @@ -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 + + '///

Enable/disable the Impress Autopilot in Tools/Options

+ '///Starting point: Any plain document + '///
    + const CFN = "global::tools::includes::optional::t_docfuncs.inc::hUseImpressAutopilot::" + + if ( GVERBOSE ) then printlog( CFN & "Enter" ) + + '///+
  • Create a new IMPRESS document
  • + gApplication = "IMPRESS" + hCreateDocument() + + '///+
  • Open Tools/Options, go to Presentataion/General page
  • + ToolsOptions + hToolsOptions( gApplication , "General" ) + + '///+
  • Check or uncheck to start with autopilot
  • + 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 + + '///+
  • Return Status of Checkbox (checked=TRUE)
  • + hUseImpressAutopilot() = mitAutopilotStarten.isChecked() -***** + else + + warnlog( CFN & "Cannot find Autopilot Checkbox" ) + + endif + + '///+
  • Close Tools/Options
  • + Kontext "OptionenDlg" + hCloseDialog( OptionenDlg, "ok" ) + + '///+
  • Close IMPRESS document
  • + hDestroyDocument() + + '///+
  • Returncode is undefined
  • + if ( GVERBOSE ) then printlog( CFN & "Exit" ) + '///
+ +end function + +'******************************************************************************* function hNumericDocType( doctype as integer ) as string Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_extension_manager_tools.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_extension_manager_tools.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_extension_manager_tools.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_extension_manager_tools.inc Sat Jan 14 00:57:08 2012 @@ -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 + + '///

Install an extension using the OpenOffice.org Extension Manager UI

+ '///

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.
This has become necessary + '///+ because the Extension Manager can turn up with a really huge number + '///+ of different dialogs, warnings, errormessages etc.
+ '///+ As this function is designed to handle the most common installation + '///+ scenarios it needs quite a number of differnt options.
+ '///+ Please have a look at the usage sample:

+ '///+

hExtensionAddGUI( sMyExtension, + '///+ "InstallForAll,BrokenDeps,DenyUpdate" )
+ + + '///Input:
+ '///

    + '///+
  1. Path to extension (String)
  2. + '///
      + '///+
    • The path has to be fully qualified
    • + '///+
    • The path may be platform specific
    • + '///
    + + '///+
  3. Flags (String), defaults underlined
  4. + '///
      + '///+
    • The string is non optional but may be empty. Allowed flags are:
    • + '///
        + '///+
      • InstallForAll | InstallForUser
        Used when running office with administrator rights
      • + '///+
      • AllowUpdate | DenyUpdate | NoUpdate
        Reinstall already installed extension/update
      • + '///+
      • AcceptLicense | DenyLicense | NoLicense
        How to handle possible license dialog
      • + '///+
      • BrokenDeps
        Close exactly one broken dependencies warning
      • + '///+
      • UseSlot
        Use the File Open slot to load the extension (faster)
      • + '///
      + '///+
    • It is recommended to use the comma as delimiter between flags
    • + '///
    + '///
+ + '///Return Value:
+ '///
    + '///+
  1. Installation status (Integer)
  2. + '///
      + '///+
    • > 0 = Installation completed with no errors, number of installed extensions
    • + '///+
    • -1 = The requested extension does not exist
    • + '///+
    • -2 = The Add-button could not be accessed
    • + '///+
    • -3 = The Extension Manager did not open
    • + '///+
    • -4 = Unknown messagebox before the file Open dialog exists
    • + '///+
    • -5 = Broken dependency warning displayed
    • + '///+
    • -6 = The File Open dialog did not pop up
    • + '///+
    • -7 = Unknown and unhandled messagebox. function exit
    • + '///
    + '///
+ + dim flags as string : flags = lcase( _flags ) + dim path as string : path = convertpath( _path ) + dim bLogs as boolean : bLogs = FALSE + + const CFN = "hExtensionAddGUI()::" + + '///Description + '///
    -***** + ' 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 ) + + '///+
  • Verify that the requested extension exists (filesystem level)
  • + 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 + + '///+
  • Open the Extension Manager - optionally using the slot (CWS oxtsysint01)
  • + if ( instr( flags , "useslot" ) <> 0 ) then + hFileOpen( path ) + else + ToolsPackageManager + kontext "PackageManager" + + if ( PackageManager.exists( 2 ) ) then + + '///+
  • Verify that the "Add.." button is available
  • + if ( add.exists() and add.isEnabled() ) then + + '///+
  • Click the "Add..." button
  • + add.click() + else + printlog( CFN & "Add button is missing or disabled" ) + hExtensionAddGUI() = -2 + exit function + endif + + '///+
  • Test for the dreaded "The office workdirectory does not exist" warning, close it
  • + 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 + + '///+
  • Enter the extension name into the file picker, open the file
  • + 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 + + '///+
  • 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
  • + 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 + + '///+
  • Test for the broken dependencies exception, close it with ok.
  • + 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 + + '///+
  • Test for the extension update dialog which pops up if an extension + '///+ is already installed. Handle as specified by flags
  • + 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 + + '///+
  • Test for the Software License Agreement dialog. Handle as specified by + '///+ flags
  • + 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 + + '///+
  • Retrieve the number of installed extensions
  • + kontext "PackageManager" + wait( 500 ) + hExtensionAddGUI() = BrowsePackages.getItemCount() + + '///+
  • Close the Extension Manager
  • + hCloseDialog( PackageManager , "close" ) + + if ( bLogs ) then + printlog( "********** Installing extension end **********" ) + printlog( "" ) + endif + '///
+ +end function + + +'******************************************************************************* function hExtensionRemoveGUI( cExtensionName as string ) as integer Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_filetools.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_filetools.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_filetools.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_filetools.inc Sat Jan 14 00:57:08 2012 @@ -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 + + '///

Handle any dialogs that might pop up when loading a file

+ '///Beware: This function gives only limited control over the dialogs closed, + '///+ it just closes anything it can.
+ '///Please refer to the inline documentation for further details
+ '///Input: + '///
    + '///+
  1. Number of dialogs to be closed (integer)
  2. + '///
      + '///+
    • Number of dialogs not limited though more than 3 is not useful
    • + '///
    + '///+
  3. Additional dialogs (integer).
  4. + '///
      + '///+
    • Number of dialogs to handle in case of unexpected behavior. If unsure set it to 2
    • + '///
    + '///
+ '///Returns: + '///
    + '///+
  1. Errorcondition (boolean)
  2. + '///
      + '///+
    • TRUE: The expected number of dialogs were closed
    • + '///+
    • FALSE: On any other condition
    • + '///
    + '///
+ '///Description: + '///
    + '///+
  • OK to create a new document based on a template
  • + '///+
  • YES to update links
  • + '///+
  • YES to execute macros
  • + '///
+ + 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 & " or " ) + 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 Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_key_tools.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_key_tools.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_key_tools.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_key_tools.inc Sat Jan 14 00:57:08 2012 @@ -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 Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_listfuncs.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_listfuncs.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_listfuncs.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_listfuncs.inc Sat Jan 14 00:57:08 2012 @@ -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 + + '///

Delete one item from a list specified by index

+ '///Prerequisite: Array compatible with those from t_lists.inc
+ '///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))
+ + 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 Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_macro_tools.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_macro_tools.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_macro_tools.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_macro_tools.inc Sat Jan 14 00:57:08 2012 @@ -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 + + '///

Paste a macro (taken from a file) to the basic IDE

+ '///uses: framework/tools/input/macros.txt
+ '///Starting point: Basic IDE
+ '///Note: Overwrites any existing macros in the current module
+ '///Input: + '///
    + '///+
  1. Name (ID) of the macro to be inserted (string)
  2. + '///
      + '///+
    • Allowed is any string that corresponds to a section in the source file
    • + '///
    + '///
+ '///Returns: + '///
    + '///+
  1. Number of lines inserted (integer)
  2. + '///
      + '///+
    • 0: Error, no lines inserted
    • + '///+
    • > 0: Number of lines
    • + '///
    + '///
+ '///Description: + '///
    + + const CFN = "hInsertMacroFromFile::" + const RETVAL_FAILURE = 0 + const MAX_LINES_IN_MACRO_FILE = 10000 + + '///+
  • Find the path to the source file
  • + 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" + + '///+
  • retrieve the macro from the file with ID as section
  • + iInstructionCount = hGetDataFileSection( cFile, aInstructionList(), cMacroId, "", "" ) + + '///+
  • Delete all content from the BASIC IDE edit window
  • + '///+
  • Insert the code into the IDE line by line
  • + kontext "BasicIDE" + if ( EditWindow.exists() ) then + if ( hDeleteMacro() ) then + for iCurrentInstruction = 1 to iInstructionCount + EditWindow.TypeKeys( "" ) + EditWindow.TypeKeys( aInstructionList( iCurrentInstruction ) ) + EditWindow.TypeKeys( "" ) + 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 + '///
+ +end function -***** +'******************************************************************************* function hMacroOrganizerRunMacro( cMacroName as string ) as integer Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_ole.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_ole.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_ole.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_ole.inc Sat Jan 14 00:57:08 2012 @@ -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 Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_security_tools.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_security_tools.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_security_tools.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_security_tools.inc Sat Jan 14 00:57:08 2012 @@ -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 + + '///

Toggle Tools/Options/OOo/Security: Password recommendation

+ '///Input: + '///
    + '///+
  1. Mode (boolean)
  2. + '///
      + '///+
    • TRUE: Switch password recommendation on
    • + '///+
    • FALSE: Switch password recommendation off
    • + '///
    + '///
+ + '///Returns: + '///
    + '///+
  1. Prior state (boolean)
  2. + '///
      + '///+
    • TRUE: Password recommendation was on
    • + '///+
    • FALSE: Password recommendation was off
    • + '///
    + '///
+ + '///Description: + '///
    + + const CFN = "hSetPasswordRecommendation::" + + '///+
  • Open Tools/Options
  • + ToolsOptions + + kontext "OptionenDlg" + if ( OptionenDlg.exists( 2 ) ) then + + '///+
  • Go to the security page
  • + hToolsOptions( "STAROFFICE" , "SECURITY" ) + + '///+
  • Click on the "Options..." button
  • + kontext "TabSecurity" + if ( hClickButton( Options ) ) then + + kontext "TabSecurityOptionsAndWarnings" + if ( TabSecurityOptionsAndWarnings.exists( 1 ) ) then + + '///+
  • Retrieve the current setting for passwor recommendation
  • + if ( RecommendPasswordProtectionOnSaving.isChecked() ) then + hSetPasswordRecommendation() = true + else + hSetPasswordRecommendation() = false + endif + + '///+
  • Set the requested state
  • + 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 + + '///+
  • Close Tools/Options
  • + Kontext "ToolsOptionsDlg" + hCloseDialog( ToolsOptionsDlg, "ok" ) + + else + warnlog( "Failed to open Tools/Options" ) + endif + '///
+ +end function -**** +'****************************************************************************** function hOpenDigitalSignaturesDialog() as boolean Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_set_standard_controls.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_set_standard_controls.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_set_standard_controls.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_set_standard_controls.inc Sat Jan 14 00:57:08 2012 @@ -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 Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_stringtools.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_stringtools.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_stringtools.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_stringtools.inc Sat Jan 14 00:57:08 2012 @@ -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 Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_toolbar_tools1.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_toolbar_tools1.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_toolbar_tools1.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_toolbar_tools1.inc Sat Jan 14 00:57:08 2012 @@ -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 '* Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_toolbar_writer.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_toolbar_writer.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_toolbar_writer.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_toolbar_writer.inc Sat Jan 14 00:57:08 2012 @@ -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 Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_treelist_tools.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_treelist_tools.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_treelist_tools.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_treelist_tools.inc Sat Jan 14 00:57:08 2012 @@ -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 + + '///

Retrieve the number of visible (open) nodes from a treelist

+ '///Input: + '///
    + '///+
  1. Treelist control object (Object)
  2. + '///
      + '///+
    • Object must exist in current context
    • + '///
    + '///
+ '///Returns: + '///
    + '///+
  1. Number of items in treelist
  2. + '///
      + '///+
    • 0 on any error
    • + '///+
    • > 0 Number of items
    • + '///
    + '///
+ '///Description: + '///
    + + + const CFN = "hGetNodeCount::" + const RETVAL_FAILURE = 0 + dim iCount as integer + + '///+
  • Verify that the control exists
  • + if ( oControl.exists( 5 ) ) then + + '///+
  • Verify that the control is enabled
  • + if ( oControl.isEnabled() ) then -***** + if ( GVERBOSE ) then printlog( CFN & "Regular access, control available and enabled" ) + + '///+
  • get the number of items from the control
  • + 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 + '///
+ +end function + +'******************************************************************************* function hSelectTopNode( oControl as object ) as boolean Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_ui_filters.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_ui_filters.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_ui_filters.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_ui_filters.inc Sat Jan 14 00:57:08 2012 @@ -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() Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_xml1.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_xml1.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_xml1.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/optional/t_xml1.inc Sat Jan 14 00:57:08 2012 @@ -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 Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/required/t_doc1.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/required/t_doc1.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/required/t_doc1.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/required/t_doc1.inc Sat Jan 14 00:57:08 2012 @@ -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 "" + sTemp = "" + while (NOT bearbeiten.isEnabled) AND (sTemp <> MakroAus.getSelText) + sTemp = MakroAus.getSelText + MakroAus.typeKeys "+" + 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( " is not visible" ) + endif + else + warnlog( " not open" ) + endif + else + warnlog( "Failed to open " ) + 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( " is not visible" ) + endif + else + warnlog( " not open" ) + endif + else + warnlog( "Failed to open " ) + 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 Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/required/t_files.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/required/t_files.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/required/t_files.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/required/t_files.inc Sat Jan 14 00:57:08 2012 @@ -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 Modified: incubator/ooo/trunk/main/testautomation/global/tools/includes/required/t_filters.inc URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/testautomation/global/tools/includes/required/t_filters.inc?rev=1231427&r1=1231426&r2=1231427&view=diff ============================================================================== --- incubator/ooo/trunk/main/testautomation/global/tools/includes/required/t_filters.inc (original) +++ incubator/ooo/trunk/main/testautomation/global/tools/includes/required/t_filters.inc Sat Jan 14 00:57:08 2012 @@ -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