diff options
Diffstat (limited to 'testautomation/framework/required/includes')
30 files changed, 6686 insertions, 0 deletions
diff --git a/testautomation/framework/required/includes/basic_dialog_export.inc b/testautomation/framework/required/includes/basic_dialog_export.inc new file mode 100644 index 000000000000..489a727545fe --- /dev/null +++ b/testautomation/framework/required/includes/basic_dialog_export.inc @@ -0,0 +1,110 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Update test for the dialog export feature +'* +'\****************************************************************************** + +testcase tUpdtDialogExport + + printlog( "Update test for the dialog export feature" ) + + dim brc as boolean + dim cMsg as string + + dim cDlgName as string + cDlgName = hGetWorkPath() & "DialogTest" + + const DLG_SUFFIX = ".xdl" + + hCreateDocument() + + printlog( "Test init: Setting up environment" ) + brc = hInitFormControls( "DialogExport" ) + if ( not brc ) then + warnlog( "Failed to initialize BAIC IDE/Dialog editor, aborting" ) + goto endsub + endif + + printlog( "Test begin" ) + kontext "DialogBar" + if ( not DialogBar.exists() ) then + warnlog( "DialogBar does not exist, aborting" ) + hClosebasicIDE() + hDestroyDocument() + goto endsub + endif + sleep(1) + printlog( "Click the Export button on the DialogBar" ) + kontext "DialogBar" + Export.click() + + kontext "ExportierenDlg" + if ( not ExportierenDlg.exists( 1 ) ) then + warnlog( "Export dialog is not open, aborting" ) + hCloseBasicIDE() + hDestroyDocument() + goto endsub + endif + + printlog( "Export dialog is open. Good." ) + + kontext "ExportierenDlg" + DateiName.setText( cDlgName ) + Speichern.click() + + kontext "Active" + if ( Active.exists() ) then + cMsg = active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + printlog( "File appears to exist, overwriting: " & cMsg ) + Active.Yes() + endif + + kontext "DialogBar" + if ( not DialogBar.exists() ) then + warnlog( "DialogBar is not visible, please check." ) + endif + + printlog( "Back on the Basic IDE / Dialog Editor. Good." ) + + cDlgName = cDlgName & DLG_SUFFIX + if ( dir( cDlgName ) = "" ) then + warnlog( "The dialog was not saved to the expected location" ) + else + hDeleteFile( cDlgName ) + printlog( "Dialog was exported and deleted. Good." ) + endif + + printlog( "Test end. Cleanup" ) + hCloseBasicIDE() + hDestroyDocument() + +endcase + diff --git a/testautomation/framework/required/includes/basic_dialog_i18n.inc b/testautomation/framework/required/includes/basic_dialog_i18n.inc new file mode 100755 index 000000000000..590c45a5f58a --- /dev/null +++ b/testautomation/framework/required/includes/basic_dialog_i18n.inc @@ -0,0 +1,132 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Update test for Basic IDE / Dialog i18n-feature +'* +'\****************************************************************************** + +testcase tUpdtBasicDialogI18n + + printlog( "BASIC IDE Dialog i18n." ) + const MODULE_NAME = "tUpdtBasicDialogI18n" + const DIALOG_DEFAULT_TIMEOUT = 2 + + kontext "Navigator" + hCloseDialog( Navigator, "close,optional" ) + hCreateDocument() + + if ( not hInitFormControls( MODULE_NAME ) ) then + warnlog( "Failed to open Basic IDE / Dialogs / ToolsCollectionBar" ) + goto endsub + endif + + printlog( "Click Manage Languages on ToolsCollectionBar") + kontext "ToolsCollectionBar" + if ( ToolsCollectionBar.exists( DIALOG_DEFAULT_TIMEOUT ) ) then + hClickButton( ManageLanguage ) + else + warnlog( "<ToolsCollectionBar> is not open, is the test environment dirty?" ) + endif + + kontext "ManageUILanguages" + if ( ManageUILanguages.exists( DIALOG_DEFAULT_TIMEOUT ) ) then + call dialogtest( ManageUILanguages ) + + printlog( "Add default language, choose preselection") + kontext "ManageUILanguages" + hClickButton( Add ) + + kontext "SetDefaultLanguage" + if ( SetDefaultLanguage.exists( DIALOG_DEFAULT_TIMEOUT ) ) then + call dialogtest( SetDefaultLanguage ) + + kontext "SetDefaultLanguage" + DefaultLanguageListbox.select( 3 ) + + kontext "SetDefaultLanguage" + hCloseDialog( SetDefaultLanguage, "ok" ) + else + warnlog( "Dialog <SetDefaultLanguage> did not open" ) + endif + + printlog( "Back on Manage UI Languages Dialog we click <Add>") + kontext "ManageUILanguages" + hClickButton( Add ) + + kontext "AddUserInterface" + if ( AddUserInterface.exists( DIALOG_DEFAULT_TIMEOUT ) ) then + call dialogtest( AddUserInterface ) + + printlog( "Add just another language at random") + kontext "AddUserInterface" + AddNewControl.typeKeys( "<HOME>" ) ' select first item + AddNewControl.typeKeys( "<SPACE>" ) ' check it + + kontext "AddUserInterface" + hCloseDialog( AddUserInterface, "ok" ) + else + warnlog( "Dialog <AddUserInterface> did not open" ) + endif + + kontext "ManageUILanguages" + PresentLanguages.Select (1) + + printlog( "Back on Manage UI Languages Dialog, delete selected language") + kontext "ManageUILanguages" + hClickButton( Delete ) + + printlog( "Confirm delete") + kontext "active" + if ( Active.exists( DIALOG_DEFAULT_TIMEOUT ) ) then + call dialogtest( active ) + + kontext "active" + hCloseDialog( active, "ok" ) + else + warnlog( "Confirm delete messagebox is missing" ) + endif + + printlog( "Leave Manage UI Languages Dialog") + kontext "ManageUILanguages" + hCloseDialog( ManageUILanguages, "ok" ) + else + warnlog( "Manage UI languages did not open" ) + endif + + printlog( "Verify that the translationbar is visible") + kontext "TranslationBar" + if ( not TranslationBar.exists() ) then warnlog( "The IDE Translation Toolbar is not visible" ) + + kontext "ToolsCollectionBar" + hCloseDialog( ToolsCollectionBar, "close" ) + hClosebasicIDE() + hDestroyDocument() + +endcase + diff --git a/testautomation/framework/required/includes/basic_dialog_i18n_import.inc b/testautomation/framework/required/includes/basic_dialog_i18n_import.inc new file mode 100644 index 000000000000..db72863173b8 --- /dev/null +++ b/testautomation/framework/required/includes/basic_dialog_i18n_import.inc @@ -0,0 +1,154 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : +'* +'\****************************************************************************** + +testcase tBasicDialogI18nImport + + printlog( "Dialogs that show up when importing multi locale dialogs into BASIC IDE" ) + + dim cDialogPath as string + cDialogPath = gTesttoolPath & "framework\required\input\basic_ide\Dialog5.xdl" + cDialogPath = convertpath( cDialogPath ) + + dim iNumberOfLanguages as integer + dim iTry as integer + + const LANGUAGE_COUNT = 5 + const MAX_RETRIES = 5 + const WAIT_TIME = 100 + const MODULE_NAME = "tDialogI18nImport" + const DIALOG_WAIT_TIMEOUT = 2 + const MSG_LOCALE_CLASH_WARNING_BUTTONCOUNT = 4 + const MSG_DIALOG_REPLACE_WARNING_BUTTONCOUNT = 3 + + printlog( "Open BASIC-IDE" ) + hCreateDocument() + hInitFormControls( MODULE_NAME ) + + kontext "ToolsCollectionBar" + if ( ToolsCollectionBar.exists() ) then ToolsCollectionBar.close() + + Kontext "DialogBar" + if ( DialogBar.exists() ) then + + printlog( "Click on <Import> button on <DialogBar>" ) + Import.click() + + kontext "OeffnenDlg" + if ( OeffnenDlg.exists( DIALOG_WAIT_TIMEOUT ) ) then + + printlog( "Enter path to test dialog" ) + DateiName.setText( cDialogPath ) + Oeffnen.click() + + printlog( "Test messagebox" ) + kontext "active" + if ( Active.exists( DIALOG_WAIT_TIMEOUT ) ) then + + printlog( "Messagebox: " & Active.getText() ) + if ( Active.getButtonCount() <> MSG_LOCALE_CLASH_WARNING_BUTTONCOUNT ) then + warnlog( "Incorrect messagebox, expected locale clash warning" ) + endif + + call DialogTest( Active ) + + printlog( "Accept with yes" ) + hCloseDialog( Active, "yes" ) + + Kontext "TranslationBar" + if ( TranslationBar.exists() ) then + + for iTry = 1 to MAX_RETRIES + iNumberOfLanguages = CurrentLanguage.getItemCount() + if ( iNumberOfLanguages = LANGUAGE_COUNT ) then exit for + wait( WAIT_TIME ) + next iTry + + printlog( "Check number of imported languages" ) + if ( iNumberOfLanguages <> LANGUAGE_COUNT ) then + warnlog( "Incorrect language count in listbox <CurrentLanguage>" ) + printlog( "Expected: " & LANGUAGE_COUNT ) + printlog( "Found...: " & iNumberOfLanguages ) + endif + + Kontext "DialogBar" + if ( DialogBar.exists() ) then + + printlog( "Click on <Import> button on <DialogBar>" ) + Import.click() + + kontext "OeffnenDlg" + if ( OeffnenDlg.exists( DIALOG_WAIT_TIMEOUT ) ) then + + printlog( "Enter path to test dialog" ) + DateiName.setText( cDialogPath ) + Oeffnen.click() + + printlog( "Test messagebox" ) + kontext "Active" + if ( Active.exists( DIALOG_WAIT_TIMEOUT ) ) then + + printlog( "Messagebox: " & Active.getText() ) + if ( Active.getButtonCount() <> MSG_DIALOG_REPLACE_WARNING_BUTTONCOUNT ) then + warnlog( "Incorrect messagebox, expected dialog replace warning" ) + endif + + call DialogTest( Active ) + + Printlog( "Rename the new dialog" ) + hCloseDialog( Active, "yes" ) + else + warnlog( "Overwrite warning missing" ) + endif + else + warnlog( "<OeffnenDlg> did not open" ) + endif + else + warnlog( "<DialogBar> is not available" ) + endif + else + warnlog( "<TranslationBar> is not available" ) + endif + else + warning( "Conflicting locales messagebox is missing" ) + endif + else + warnlog( "<OeffnenDlg> did not open" ) + endif + else + warnlog( "<DialogBar> is not available" ) + endif + hCloseBasicIde() + hDestroyDocument() + +endcase + diff --git a/testautomation/framework/required/includes/basic_macroassignment.inc b/testautomation/framework/required/includes/basic_macroassignment.inc new file mode 100755 index 000000000000..05967fcfd008 --- /dev/null +++ b/testautomation/framework/required/includes/basic_macroassignment.inc @@ -0,0 +1,126 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Update-Test for some dialogs in Basic-IDE +'* +'\****************************************************************************** + +testcase tUpdtMacroAssignment + + printlog( "Update test all dialogs from plain document via assign macro dialog to scriptselector" ) + + const TABPAGE_EVENTS = 2 + const BASIC_MODULE = "tUpdtMacroAssignment" + const DEFAULT_DIALOG_TIMEOUT = 1 + const RC_TIMEOUT = -1 + + printlog( "New document" ) + hCreateDocument() + + printlog( "Create a new BASIC-module for this document" ) + hInitBasicIDE( BASIC_MODULE ) + + printlog( "Create a new BASIC-dialog" ) + if ( hNewDialog() ) then + + printlog( "Select the Dialog-Pane from the DialogWindow" ) + if ( hSelectDialogPane() ) then + + printlog( "Show ToolsCollectionBar" ) + if ( hShowMacroControls() ) then + + printlog( "Open the Property-Browser" ) + if ( hOpenPropertyBrowser() ) then + + kontext "TabGeneralControl" + call dialogtest( TabGeneralControl ) + + printlog( "Switch to events-tab" ) + if ( hSetPBTabPage( TABPAGE_EVENTS ) ) then + + printlog( "Current Dialog: Property-Browser / Events-Page" ) + call dialogtest( TabEventsControl ) + + Kontext "TabEventsControl" + printlog( "Click the button for the FocusGained-Event" ) + if ( hClickButton( PBFocusGained ) <> RC_TIMEOUT ) then + + Kontext "AssignMacro" + printlog( "Current Dialog: Assign Macro" ) + if ( AssignMacro.exists( DEFAULT_DIALOG_TIMEOUT ) ) then + + call dialogtest( AssignMacro ) + + printlog( "Click the Assign-Button on the Macro-Assignment-Dialog to open Script Selector" ) + if ( hClickButton( AssignButton ) <> RC_TIMEOUT ) then + + Kontext "ScriptSelector" + if ( ScriptSelector.exists( DEFAULT_DIALOG_TIMEOUT ) ) then + + call dialogtest( ScriptSelector ) + + printlog( "Close Script Selector" ) + hCloseDialog( ScriptSelector, "cancel" ) + + printlog( "Close all remaining dialogs and documents" ) + Kontext "AssignMacro" + hCloseDialog( AssignMacro, "cancel" ) + hClosePropertyBrowser() + hCloseBasicIDE() + hDestroyDocument() + else + warnlog( "Failed to open/access <ScriptSelector>" ) + endif + else + warnlog( "Assign-button is not enabled" ) + endif + else + warnlog( "Failed to open/access <AssignMacro> dialog" ) + endif + else + warnlog( "#i64196# - Events missing on properties tab-page" ) + endif + else + warnlog( "Failed to switch tabpage to Tab-Events" ) + endif + else + warnlog( "Property-Browser is not open, skipping further testing" ) + endif + else + warnlog( "ToolsCollectionBar is not open" ) + endif + else + warnlog( "Selecting failed: ToolsCollectionBar is in the way." ) + endif + else + warnlog( "Failed to create a new BASIC-dialog" ) + endif + +endcase + diff --git a/testautomation/framework/required/includes/basic_organizer.inc b/testautomation/framework/required/includes/basic_organizer.inc new file mode 100755 index 000000000000..789d870cb9a6 --- /dev/null +++ b/testautomation/framework/required/includes/basic_organizer.inc @@ -0,0 +1,228 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Update test for the Basic Organizer dialog +'* +'\****************************************************************************** + +testcase tUpdtBasicOrganizer + + printlog( "Update test for the Basic Organizer dialog" ) + + dim cTempString as string + const TESTLIB = "zzzz" + + printlog( "Open a new document" ) + hCreateDocument() + + printlog( "Open the Basic Macro Organizer" ) + ToolsMacro_uno + + kontext "Makro" + if ( not makro.exists() ) then + warnlog( "Macro Organizer is not open, aborting test" ) + hDestroyDocument() + goto endsub + else + printlog( "Successfully opened the MacroOrganizer" ) + endif + + kontext "Makro" + printlog( "Click <Organizer> to open the library/modules organizer" ) + if ( Verwalten.isEnabled() ) then + Verwalten.click() + else + warnlog( "Cannot click the <Organize...> button" ) + endif + + ' Try to recover from previous error + Kontext "TabModule" + if ( not TabModule.exists() ) then + printlog( "TabModule is not open, the test cannot continue" ) + kontext "Makro" + Makro.cancel() + hDestroyDocument() + goto endsub + endif + + kontext + active.setPage TabModule + + kontext "TabModule" + printlog( "Modules Tab" ) + call DialogTest( TabModule ) + + Modulliste.typeKeys( "<HOME>" ) + try + printlog( "New Modules-dialog" ) + NeuesModul.click() + kontext "NeuesModul" + call DialogTest( NeuesModul ) + NeuesModul.cancel() + catch + warnlog( "There is a problem accessing the NewModule-dialog" ) + endcatch + + kontext + active.setPage( TabDialogs ) + + Kontext "TabDialogs" + printlog( "Dialogs Tab" ) + call DialogTest( TabDialogs ) + + ModuleList.typeKeys( "<HOME>" ) + + try + printlog( "New Libraries-dialog" ) + NewDialog.click() + kontext "NeuerDialog" + call DialogTest( NeuerDialog ) + NeuerDialog.cancel() + catch + warnlog( "There is a problem accessing the NewModule-dialog" ) + endcatch + + Kontext + active.setPage( TabBibliotheken ) + + Kontext "TabBibliotheken" + printlog( "Libraries Tab" ) + call DialogTest( TabBibliotheken ) + + Bibliotheksliste.typeKeys( "<HOME>" ) + + kontext "TabBibliotheken" + + if ( neu.isEnabled() ) then + printlog( "New Library dialog" ) + Neu.click() + kontext "NeueBibliothek" + call DialogTest( NeueBibliothek ) + Bibliotheksname.setText( TESTLIB ) + NeueBibliothek.ok() + else + warnlog( "There is a problem accessing the New Libraries dialog" ) + endif + + kontext "TabBibliotheken" + if ( neu.isEnabled() ) then + + printlog( "New Library dialog" ) + Neu.click() + kontext "NeueBibliothek" + call DialogTest( NeueBibliothek ) + Bibliotheksname.setText( TESTLIB ) + NeueBibliothek.ok() + else + warnlog( "There is a problem accessing the New Libraries dialog" ) + endif + + kontext "active" + if ( active.exists() ) then + printlog( "Closing warning" ) + active.ok() + else + warnlog( "Warning missing for duplicate library name" ) + endif + + kontext "TabBibliotheken" + printlog( "Export the package" ) + export.click() + + kontext "ExportBasicLibraryDlg" + printlog( "Export as package, click OK" ) + ExportAsPackage.check() + ExportBasicLibraryDlg.ok() + + kontext "SpeichernDlg" + printlog( "Cancel FileSave dialog" ) + SpeichernDlg.cancel() + + kontext "TabBibliotheken" + printlog( "Export the package" ) + export.click() + + kontext "ExportBasicLibraryDlg" + printlog( "Export as library, click OK" ) + ExportAsLibrary.check() + ExportBasicLibraryDlg.ok() + + kontext "OeffnenDlg" + printlog( "Cancel FileOpen dialog" ) + OeffnenDlg.cancel() + + kontext "TabBibliotheken" + if ( passwort.isEnabled() ) then + printlog( "Password-Dialog" ) + passwort.click() + kontext "PasswdDlg" + PasswdDlg.cancel() + else + warnlog( "There is a problem accessing the Passwords-dialog" ) + endif + + kontext "TabBibliotheken" + printlog( "Try to delete the library" ) + + cTempString = BibliotheksListe.getSelText() + if ( cTempString = TESTLIB ) then + printlog( "Delete" ) + Loeschen.click() + Kontext "Active" + Active.yes() + else + warnlog( "Could not delete the library, name is incorrect: " & cTempString ) + endif + + Kontext "TabBibliotheken" + + try + printlog( "Append a new library" ) + Hinzufuegen.click() + kontext "OeffnenDlg" + call DialogTest( OeffnenDlg ) + OeffnenDlg.cancel() + catch + warnlog( "There is a problem appending a new library" ) + endcatch + + Kontext "TabBibliotheken" + + printlog( "Cancel library/modules/dialogs organizer" ) + TabBibliotheken.cancel() + + printlog( "Cancel Macro Organizer" ) + Kontext "Makro" + Makro.cancel() + + printlog( "Close the document" ) + hDestroyDocument() + +endcase + diff --git a/testautomation/framework/required/includes/first.inc b/testautomation/framework/required/includes/first.inc new file mode 100755 index 000000000000..700cee374104 --- /dev/null +++ b/testautomation/framework/required/includes/first.inc @@ -0,0 +1,399 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* 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 + + printlog( "Load a Java applet. It should *not* be executed, applets are disabled by default" ) + + Dim iTryLoadingJava as integer + Dim cPath as string + + ' This test will not work if the system filedialog is used. + if (gUseSysDlg) then + warnlog("No test with system file-dialog!") + else + FileOpen + Kontext "OeffnenDlg" + Dateiname.settext(ConvertPath(gTestToolPath & "global\input\java\java.htm") + Oeffnen.Click() + hFileWait( false ) ' Wait but do not warn. + for iTryLoadingJava = 1 to 10 + + 'Sometimes it needs time to bring up the Java Runtime on the system. + 'Just trying it 10 times (paused with a sleep(1) + + ' if no java is installed or it is disabled a messagebox will be displayed + ' for each class file triggered by this test, so there will be two errormessages + ' asking to enable java. The first msgbox will be handled within the loop while + ' waiting for the document to get loaded, the second msgbox will be handled + ' outside the loop, it comes up right after the first one. + try + Kontext "Messagebox" + if ( MessageBox.exists( 1 )) then + warnlog(Messagebox.GetText()) + try + Messagebox.Cancel() + MessageBox.notExists( 2 ) ' wait till it's gone, timing related + catch + Messagebox.OK() ' if "OK" works, we are in an undefined state + warnlog( "The dialog has been closed by OK -> BUG" ) + endcatch + exit for + end if + catch + printlog "... wait another second ..." + endcatch + next iTryLoadingJava + + ' the second errormessage is a bug (even if it is logical it is not ok + ' from a user's point of view. The task will not be fixed for OOo 2.0 + kontext "Messagebox" + if ( messagebox.exists() ) then + try + qaerrorlog( "#i37020# Second messagebox displayed" ) + Messagebox.cancel() + catch + Messagebox.OK() + warnlog( "The dialog has been closed by OK -> BUG" ) + endcatch + endif + + messageBox.notExists( 5 ) + Call hCloseDocument() + end if +endcase + +'******************************************************************************* + +testcase tDatabaseCheck + + printlog( "Minimal test for Database functionality" ) + + try + gApplication = "WRITER" + hFileOpen( ConvertPath(gOfficePath & "user\database\biblio.odb" ) + printlog "check if database is open" + Kontext "DATABASE" + if (Database.exists()) then + printlog "Database open" + printlog "click on the table icon and check if tables are displayed" + ViewTables + WaitSlot() + Kontext "ContainerView" + if TableTree.exists() then + printlog "table tree visible" + else + warnlog "table tree not visible" + end if + else + warnlog "Database not open" + end if + Call hCloseDocument + catch + warnlog "error while open Database." + endcatch +endcase + +'******************************************************************************* + +function fDocumentCheck( SollFilter as String ) as boolean + ' Check the name of the file type in the Save dialog and validate + ' it against a given string. + Dim sFiltername as String + + FileSaveAs + + Kontext "SpeichernDlg" + if ( SpeichernDlg.exists( 1 ) ) then + sFiltername = DateiTyp.GetItemText (1) + if (Instr(lcase(sFiltername), lcase (SollFilter)) <> 0) then + fDocumentCheck() = TRUE + else + printlog("Filter names do not match:") + printlog("Found: [" & sFilterName & "]") + printlog("Expected: [" & SollFilter & "]") + SollFilter = sFiltername + fDocumentCheck() = FALSE + end if + SpeichernDlg.Cancel() + else + warnlog( "Dialog <File Save As> did not open" ) + fDocumentCheck() = FALSE + endif +end function + +'******************************************************************************* + +testcase tInFilterCountCompare() + + printlog( "Check filterlist (filterstring) for graphics files" ) + + const FILE_NAME = "graphic_filters.txt" + const SUFFIX_STRING_LENGTH = 178 + +' List of filter suffixes for verification in case of error +' *.bmp;*.dxf;*.emf;*.eps;*.gif;*.jpg;*.jpeg;*.jfif;*.jif;*.met;*.pbm;*.pcd; +' *.pct;*.pcx;*.pgm;*.png;*.ppm;*.psd;*.ras;*.sgf;*.sgv;*.svm;*.tga;*.tif; +' *.tiff;*.wmf;*.xbm;*.xpm;*.pict + + dim caUIFilters( 30 ) as string + + dim cReferencePath as string + cReferencePath = gTesttoolPath & "global/input/filters/" + cReferencePath = convertpath ( cReferencePath & FILE_NAME ) + + dim cUIFiltersPath as string + cUIFiltersPath = hGetWorkPath() & FILE_NAME + + dim iCurrentFilter as integer + dim iFilterCount as integer + + dim cAllFormats as string + + dim irc as integer + dim iBegin as integer + dim iEnd as integer + + printlog( "" ) + printlog( "Verify filternames listed on the Insert Graphics dialog" ) + + hCreateDocument() + hChangeDoc() + + InsertGraphicsFromFile + + kontext "GrafikEinfuegenDlg" + if ( GrafikEinfuegenDlg.exists( 1 ) ) then + iFilterCount = DateiTyp.getItemCount() + + 'Make list compatible with listfunctions + caUIFilters( 0 ) = iFilterCount - 1 + + for iCurrentFilter = 2 to iFilterCount + + caUIFilters( iCurrentFilter - 1 ) = DateiTyp.getItemText( iCurrentFilter ) + + next iCurrentFilter + + irc = hManageComparisionList( cReferencePath, cUIFiltersPath, caUIFilters() ) + hListResultEvaluation( irc , 0 ) + + printlog( "" ) + printlog( "Verify <All formats>-string" ) + cAllFormats = DateiTyp.getItemText( 1 ) + + iBegin = instr( cAllFormats, "<" ) + if ( iBegin <> 1 ) then + warnlog( "The opening bracket < is missing in <All formats> string" ) + endif + + iEnd = instr( cAllFormats, ">" ) + if ( iEnd = 0 ) then + warnlog( "The closing bracket > is missing in <All formats> string" ) + endif + + if ( ( iEnd - iBegin ) < 2 ) then + warnlog( "<All formats> string is shorter than expected, please check" ) + printlog( "String is: " & cAllFormats & ", length (" & len( cAllFormats ) & ")" ) + endif + + iBegin = instr( cAllFormats, "(" ) + if ( iBegin <> iEnd + 2 ) then + warnlog( "The opening bracket ( is missing in <All formats> string" ) + endif + + iEnd = instr( cAllFormats, ")" ) + if ( iEnd < 10 ) then + warnlog( "The closing bracket ) is missing in <All formats> string" ) + endif + + irc = iEnd - iBegin + if ( irc <> SUFFIX_STRING_LENGTH ) then + warnlog( "The list of file suffixes has changed, please verify" ) + printlog( "Found: " & irc & " chars, expected " & SUFFIX_STRING_LENGTH ) + endif + + kontext "GrafikEinfuegenDlg" + GrafikEinfuegenDlg.cancel() + else + warnlog( "<Insert Graphics> dialog did not open" ) + endif + + hDestroyDocument() + +endcase diff --git a/testautomation/framework/required/includes/help_browser.inc b/testautomation/framework/required/includes/help_browser.inc new file mode 100755 index 000000000000..62438373dc37 --- /dev/null +++ b/testautomation/framework/required/includes/help_browser.inc @@ -0,0 +1,195 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* 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 + + printlog( "Resource test for the help toolbar" ) + + dim brc as boolean + dim iExitCounter as integer : iExitCounter = 0 + + 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 + + + kontext "starofficehelp" + printlog "- Index -> on" + Index.Click() + waitslot + + printlog "- Index -> off" + Index.Click() + + ' Backward- and Forward-button + printlog "- activate 'Index'-page" + brc = hSelectHelpTab( "index" ) + + do while( SearchIndex.getItemCount() < 100 ) + iExitCounter = iExitCounter + 1 : if ( iExitCounter = 20 ) then exit do + wait( 100 ) + loop + + SearchIndex.Select( 4 ) + DisplayIndex.Click() + waitslot + + printlog "- backward" + Backward.Click() + waitslot + + printlog "- forward" + Forward.Click() + waitslot + + printlog "- first page" + GoToStart.Click() + + printlog "- print" + ' the print-dialog must be shown ( if direct-printing is activated => BUG ) + PrintButton.Click() + + kontext "active" + if ( Active.Exists ( 1 ) ) then + qaerrorlog( "Unexpected messagebox: " & Active.getText() ) + qaerrorlog( "Probably missing default printer on this system, fix it!" ) + Active.OK() + endif + + kontext "Printing" + if ( Printing.exists( 2 ) ) then + printlog( "Print dialog open, good." ) + Printing.cancel() + else + warnlog( "Print dialog not open" ) + endif + + kontext "tb_help" + printlog "- Set Bookmark" + SetBookmarks.Click() + + kontext "AddBookmark" + call DialogTest ( AddBookmark ) + AddBookmark.Cancel() + + brc = hCloseHelp() + +endcase + +'******************************************************************************* + +testcase tHelp_Registration + + ' Check i69670 which was a showstopper in OOo 2.0.4 + ' Menu-entry "Help / Registration" is disabled + + dim iCurrentMenuEntry as integer + dim iMenuEntryCount as integer + + printlog "Check if all entries in Help Menu are enabled" + call hNewDocument + + printlog "Open menu" + hUseMenu() + iMenuEntryCount = hMenuItemGetCount + + printlog "Select the last entry 'Help'" + hMenuSelectNr( iMenuEntryCount ) + iMenuEntryCount = hMenuItemGetCount + for iCurrentMenuEntry = 1 to iMenuEntryCount + if ( hMenuItemIsEnabled( iCurrentMenuEntry ) ) then + printlog "(" & iCurrentMenuEntry & "/" & iMenuEntryCount & _ + "): Menu entry is enabled: Help-> " & hMenuItemGetText( iCurrentMenuEntry ) + else + if (lcase(gPlatform) = "osx") then + warnlog "#i86247# Help->Registration is disabled on MacOS X" + else + warnlog "(" & iCurrentMenuEntry & "/" & iMenuEntryCount & _ + "): Menu entry is not enabled: Help-> " & hMenuItemGetText( iCurrentMenuEntry ) + endif + endif + next iCurrentMenuEntry + hMenuClose() + call hCloseDocument + +endcase + diff --git a/testautomation/framework/required/includes/printer_administration.inc b/testautomation/framework/required/includes/printer_administration.inc new file mode 100755 index 000000000000..a05ecc6b02a1 --- /dev/null +++ b/testautomation/framework/required/includes/printer_administration.inc @@ -0,0 +1,271 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* 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 ) + + + + dim iWait as integer + + printlog( " * New Printer" ) + Kontext "SPAdmin" + PBNewPrinter.click() + waitslot + + printlog( " * select 'Connect a Fax Device'" ) + Kontext "TabPWDeviceSelector" + call dialogtest( TabPWDeviceSelector ) + RBFax.check() + + printlog( " * next ->" ) + Kontext "SpPrinterWizard" + PBNext.click() + waitslot + + printlog( " * accept the default driver (first entry)" ) + Kontext "TabPWFaxDriverSelector" + call dialogtest( TabPWFaxDriverSelector ) + + printlog( " * next ->" ) + Kontext "SpPrinterWizard" + PBNext.click() + waitslot + + printlog( " * enter '(PHONE)' as queue" ) + Kontext "TabPWQueueCommand" + call dialogtest( TabPWQueueCommand ) + CBCommand.setText( """(PHONE)""" ) + + printlog( " * next ->" ) + Kontext "SpPrinterWizard" + PBNext.click() + waitslot + + printlog( " * enter a name for the fax-printer" ) + Kontext "TabPWPrinterName" + call dialogtest( TabPWPrinterName ) + EFFaxName.setText( cPrinter ) + waitslot( 2000 ) + + printlog( " * Finish" ) + for iWait = 1 to 3 + try + Kontext "SpPrinterWizard" + SpPrinterWizard.ok() + iWait = 4 ' leave the loop + catch + printlog( "Waiting for dialog" ) + sleep( 1 ) + if ( iWait = 3 ) then + qaerrorlog( "Could not click 'finish' on printerwizard" ) + endif + endcatch + next iWait + + printlog( "" ) + +end sub + +'******************************************************************************* + +sub TestProperties( cPrinter as string ) + + + + dim iPrinterPos as integer + + kontext "SpAdmin" + iPrinterPos = hGetPrinterPosition( CPRINTER , true ) + + LBPrinters.select( iPrinterPos ) + + PBProperties.click() + waitslot + printlog( " * Properties for the new fax device" ) + + kontext + active.setpage TabSPACommand + + kontext "TabSPACommand" + printlog( " * Tab: Command" ) + call dialogtest( TabSPACommand ) + + kontext + active.setpage TabSPAPaper + + kontext "TabSPAPaper" + printlog( " * Tab: Paper" ) + call dialogtest( TabSPAPaper ) + + kontext + active.setpage TabSPADevice + + kontext "TabSPADevice" + printlog( " * Tab: Device" ) + call dialogtest( TabSPADevice ) + + kontext + active.setpage TabSPAFontReplacement + + kontext "TabSPAFontReplacement" + printlog( " * Tab: FontReplacement" ) + call dialogtest( TabSPAFontReplacement ) + + kontext + active.setpage TabSPAOther + + kontext "TabSPAOther" + printlog( " * Tab: Other" ) + call dialogtest( TabSPAOther ) + + printlog( " * close Properties" ) + TabSPAOther.cancel() + + printlog( "" ) + +end sub + +'******************************************************************************* + +sub TestRename( cPrinter as string ) + + + + Kontext "SpAdmin" + LBPrinters.select( hGetPrinterPosition( CPRINTER , true ) ) + waitslot + + printlog( " * Open 'Rename' dialog" ) + PBRename.click() + waitslot + + Kontext "SPRenamePrinterDLG" + call dialogtest( SPRenamePrinterDLG ) + printlog( " * Close 'Rename' dialog" ) + SPRenamePrinterDLG.cancel() + + printlog( "" ) + +end sub
\ No newline at end of file diff --git a/testautomation/framework/required/includes/script_organizers.inc b/testautomation/framework/required/includes/script_organizers.inc new file mode 100755 index 000000000000..6082a3313ce0 --- /dev/null +++ b/testautomation/framework/required/includes/script_organizers.inc @@ -0,0 +1,127 @@ +'encoding UTF-8 Do not remove or change this line! +'******************************************************************************* +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/****************************************************************************** +'* +'* owner : Joerg.Skottke@Sun.Com +'* +'* short description : Verify names of macros and scripts +'* +'\****************************************************************************** + +testcase tUpdtScriptCount + dim sDialog as string + + printlog( "Resource test for macros and scripts / related dialogs" ) + + const SCRIPTING_DIALOGS = 5 + + dim aScriptCount( SCRIPTING_DIALOGS ) + + aScriptCount( 1 ) = 10 ' JavaScript + aScriptCount( 2 ) = 14 ' BeanShell + + if ( lcase( gPlatform ) = "osx" ) then + aScriptCount( 3 ) = 8 ' Python + aScriptCount( 5 ) = 600 ' Run Macro + else + aScriptCount( 3 ) = 10 ' Python + aScriptCount( 5 ) = 602 ' Run Macro + endif + + if ( gOOo ) then + aScriptCount( 4 ) = 585 ' Makro Organizer + aScriptCount( 5 ) = aScriptCount( 5 ) - 1 ' Run Macro + else + ' Makro Organizer + aScriptCount( 4 ) = 586 + endif + + dim iCurrentDialog as integer + dim iCurrentScriptCount as integer + + hInitSingleDoc() + + for iCurrentDialog = 1 to SCRIPTING_DIALOGS + + printlog( "" ) + select case iCurrentDialog + case 1: sDialog = "JavaScript" + ToolsMacrosOrganizeMacrosJavaScript + kontext "ScriptOrganizer" + iCurrentScriptCount = hExpandAllNodes( ScriptTreeList ) + ScriptOrganizer.cancel() + case 2: sDialog = "BeanShell" + ToolsMacrosOrganizeMacrosBeanShell + kontext "ScriptOrganizer" + iCurrentScriptCount = hExpandAllNodes( ScriptTreeList ) + ScriptOrganizer.cancel() + case 3: sDialog = "Python" + ToolsMacrosOrganizeMacrosPython + kontext "ScriptOrganizer" + iCurrentScriptCount = hExpandAllNodes( ScriptTreeList ) + ScriptOrganizer.cancel() + case 4: sDialog = "Makro Organizer" + ToolsMacro_uno + Kontext "Makro" + hExpandAllNodes( MakroAus ) + iCurrentScriptCount = hGetScriptCount( MakroAus, MakroListe ) + Makro.close() + case 5: sDialog = "Run Macro" + ToolsMacrosRunMacro + kontext "ScriptSelector" + hExpandAllNodes( LibraryTreeList ) + iCurrentScriptCount = hGetScriptCount( LibraryTreeList, ScriptList ) + ScriptSelector.cancel() + end select + + printlog( sDialog ) + + if ( aScriptCount( iCurrentDialog ) <> iCurrentScriptCount ) then + warnlog( "Incorrect number of scripts for this dialog: '" + sDialog + "' expected:" + aScriptCount( iCurrentDialog ) + ", but is:" & iCurrentScriptCount ) + else + printlog( "Number of scripts is ok" ) + endif + + next iCurrentDialog + + hCloseDocument() + +endcase + +'******************************************************************************* + +function hGetScriptCount( oTree as object, oList as object ) as integer + + dim iCurrentTreeItem as integer + dim iScriptCount as integer : iScriptCount = 0 + + for iCurrentTreeItem = 1 to oTree.getItemCount() + oTree.select( iCurrentTreeItem ) + iScriptCount = iScriptCount + oList.getItemCount() + next iCurrentTreeItem + hGetScriptCount() = iScriptCount + +end function diff --git a/testautomation/framework/required/includes/scripting_basics.inc b/testautomation/framework/required/includes/scripting_basics.inc new file mode 100755 index 000000000000..d5377c4873bd --- /dev/null +++ b/testautomation/framework/required/includes/scripting_basics.inc @@ -0,0 +1,74 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Quick short test for the scripting framework +'* +'\****************************************************************************** + +testcase tScripting + + printlog( "Verify that the nodes <My Macros> and <OOo Macros> are present" ) + + const ORGANIZER_ITEMS = 2 + const MAX_DIALOG_DELAY = 5 + + hFileCloseAll() + + ToolsMacrosOrganizeMacrosBeanShell + + Kontext "ScriptOrganizer" + if ( ScriptOrganizer.exists( MAX_DIALOG_DELAY ) ) then + printlog( "Beanshell Script Organizer is present. Good" ) + if ( ScriptTreeList.getItemCount() <> ORGANIZER_ITEMS ) then + warnlog( "The Treelist does not contain the expected number " & _ + "of items. Please verify that exactly " & ORGANIZER_ITEMS & " top-nodes exist" ) + endif + hCloseDialog( ScriptOrganizer, "cancel" ) + else + warnlog( "Script Organizer for Beanshell is missing" ) + endif + + ToolsMacrosOrganizeMacrosJavaScript + + Kontext "ScriptOrganizer" + if ( ScriptOrganizer.exists( MAX_DIALOG_DELAY ) ) then + printlog( "JavaScript Script Organizer is present. Good" ) + if ( ScriptTreeList.getItemCount() <> ORGANIZER_ITEMS ) then + warnlog( "The Treelist does not contain the expected number " & _ + "of items. Please verify that exactly " & ORGANIZER_ITEMS & " top-nodes exist" ) + endif + hCloseDialog( ScriptOrganizer, "cancel" ) + else + warnlog( "Script Organizer for JavaScript is missing" ) + endif + +endcase + + + diff --git a/testautomation/framework/required/includes/security_dialogs.inc b/testautomation/framework/required/includes/security_dialogs.inc new file mode 100644 index 000000000000..fec9900a28b8 --- /dev/null +++ b/testautomation/framework/required/includes/security_dialogs.inc @@ -0,0 +1,186 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Security dialogs in Tools/Options +'* +'\****************************************************************************** + +testcase tUpdtSecurityDialogs + + printlog( "Security dialogs in Tools/Options" ) + + const C_PASSWORD = "huhuhu" + + printlog( "Tools/Options" ) + ToolsOptions + + hToolsOptions( "StarOffice", "Security" ) + + kontext "TabSecurity" + call DialogTest( TabSecurity ) + + Options.click() + + kontext "TabSecurityOptionsAndWarnings" + if ( TabSecurityOptionsAndWarnings.exists( 1 ) ) then + call DialogTest( TabSecurityOptionsAndWarnings ) + printlog( "Options dialog is present" ) + + TabSecurityOptionsAndWarnings.cancel() + else + warnlog( "options dialog is missing" ) + endif + + kontext "TabSecurity" + if ( PersistentlySavePasswords.isChecked() ) then + qaerrorlog( "Security settings already changed by another test" ) + Kontext "TabSecurity" + PersistentlySavePasswords.unCheck() + kontext "active" + if( active.exists( 1 ) ) then + active.yes() + else + warnlog( "failed to reset password configuration, aborting" ) + kontext "OptionenDlg" + OptionenDlg.cancel() + endif + endif + + kontext "TabSecurity" + PersistentlySavePasswords.check() + + kontext "MasterPasswordDefine" + if ( MasterPasswordDefine.exists( 1 ) ) then + + printlog( "Define Master password dialog is open" ) + call DialogTest( MasterPasswordDefine ) + + Password1.setText( C_PASSWORD ) + Password2.setText( C_PASSWORD ) + MasterPasswordDefine.ok() + + else + warnlog( "Define Master Password dialog is missing" ) + endif + + kontext "TabSecurity" + MasterPassword.click() + + kontext "MasterPasswordEnter" + if ( MasterPasswordEnter.exists( 1 ) ) then + printlog( "Enter master Password dialog is open" ) + call DialogTest( MasterPasswordEnter ) + + MasterPasswordEnter.cancel() + else + warnlog( "Enter Password dialog is missing" ) + endif + + + kontext "TabSecurity" + ShowPasswords.click() + + kontext "MasterPasswordEnter" + if ( MasterPasswordEnter.exists( 1 ) ) then + printlog( "Enter password dialog is open" ) + + Password.setText( C_PASSWORD ) + + MasterPasswordEnter.ok() + + kontext "StoredPasswordsDialog" + if ( StoredPasswordsDialog.exists( 1 ) ) then + printlog( "Stored passwords dialog is open" ) + call DialogTest( StoredPasswordsDialog ) + + StoredPasswordsDialog.close() + else + warnlog( "Stored passwords dialog is missing" ) + endif + else + warnlog( "Enter Master Password dialog is missing" ) + endif + + kontext "TabSecurity" + MacroSecurity.click() + + kontext "TabSecurityLevel" + if ( TabSecurityLevel.exists( 1 ) and TabSecurityLevel.isVisible() ) then + printlog( "Security Level tabpage is open." ) + + kontext + active.setPage TabTrustedSources + + kontext "TabTrustedSources" + if ( TabTrustedSources.isVisible() ) then + printlog( "Trusted Sources tabpage is visible" ) + + LocationsAdd.click() + + kontext "OeffnenDlg" + if ( OeffnenDlg.exists( 1 ) ) then + printlog( "File open dialog is visible" ) + call DialogTest( OeffnenDlg ) + OeffnenDlg.cancel() + + kontext "TabTrustedSources" + if ( TabTrustedSources.exists() ) then + TabTrustedSources.cancel() + else + warnlog( "Trusted Sources tabpage not available" ) + endif + else + warnlog( "Trusted Paths selector not visible" ) + endif + else + warnlog( "Trusted Sources tabpage is not available" ) + endif + else + warnlog( "The Macro Security settings dialog is not open" ) + endif + + Kontext "TabSecurity" + PersistentlySavePasswords.unCheck() + + kontext "active" + if( active.exists( 1 ) ) then + printlog( "Passwords deletion warning is displayed. Good" ) + call DialogTest( active ) + active.yes() + else + warnlog( "Password deletion warning is missing" ) + endif + + + kontext "OptionenDlg" + OptionenDlg.cancel() + + +endcase + diff --git a/testautomation/framework/required/includes/smoketest.inc b/testautomation/framework/required/includes/smoketest.inc new file mode 100644 index 000000000000..dcff255d6c6c --- /dev/null +++ b/testautomation/framework/required/includes/smoketest.inc @@ -0,0 +1,206 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : "10ner/Smoke Test" from release engineering +'* +'\****************************************************************************** + +testcase tSmokeTest + + printlog( "Smoketest (10er-Test) from Release Engineering" ) + dim sLocation as string + dim i,x,a as integer + dim sTemp as string + dim lFiles(200) as string + dim bTemp as boolean + dim iError, iOK as integer + + sLocation = "framework/first/inc/smoketest.inc::" + + 'To avoid focus problems, go to backingwindow + if getDocumentcount <> 0 then + 'After an resetApplication at least one document may be open. + printlog "closed one window " + getDocumentCount + call hCloseDocument() + endif + + 'Delete temp dir of logs + sTemp = convertPath(gOfficePath + "user/temp/") + printlog "Going to delete ttt.*: " + GetFileList(sTemp,"ttt.*",lFiles()) + printlog "Going to delete *.dat: " + GetFileList(sTemp,"*.dat",lFiles()) + bTemp = KillFileList(lFiles()) + if NOT bTemp then + for i = 1 to ListCount(lFiles()) + qaErrorlog sLocation + "Can't delete file: " + i + ": '" + lFiles(i) + "'" + next i + endif + + 'Open the test document + call hFileOpen(convertPath(gTestToolPath + "framework/required/input/10erTest_680.sxw")) + 'Security dialog might come up + kontext "SecurityWarning" + if SecurityWarning.exists(5) then + 'Allow to run macros + SecurityWarning.ok + endif + call sleep 1 + + 'Start the macro, that performs the test + 'Tools->Macros->Run Macro... + 'Check, if all three libraries are there, else close and try again... + ToolsMacrosRunMacro + Kontext "ScriptSelector" + if ScriptSelector.exists(10) then + x = LibraryTreeList.getItemCount + 'There have to show up 3 libraries, else the document isn't loaded + if x <> 3 then + printlog "Try again..." + ScriptSelector.cancel + sleep 10 + ToolsMacrosRunMacro + Kontext "ScriptSelector" + x = LibraryTreeList.getItemCount + endif + 'Look for library '10erTest_680' and '10ERTEST_680' + for i = 1 to x + sTemp = LibraryTreeList.getItemText(i) + 'printlog "("+i+"/"+x+"): '" + sTemp + "'" + if (instr(sTemp,"10erTest_680")>0 OR instr(sTemp,"10ERTEST_680")) then + a = i + printlog "Found library ("+i+"/"+x+"): '" + sTemp + "'" + endif + next i + if 0 <> a then + 'Select the library and unfold it + LibraryTreeList.select(a) + LibraryTreeList.typeKeys("+") + ' LibraryTreeList.select("10erTest_680") ' not implemented right now :-( + 'Go to 'Standard' and unfold + LibraryTreeList.typeKeys("<down>") + LibraryTreeList.typeKeys("+") + 'Go to 'Global' + LibraryTreeList.typeKeys("<down>") + + 'Select macro name 'StartTestByOption' + x = ScriptList.getItemCount + for i = 1 to x + sTemp = ScriptList.getItemText(i) + 'printlog "("+i+"/"+x+"): '" + sTemp + "'" + if "StartTestByOptions" = sTemp then + a = i + printlog "Found macro ("+i+"/"+x+"): '" + sTemp + "'" + endif + next i + if (0 <> a) then + 'Select the macro + ScriptList.select(a) + 'Start the macro by pressing the button 'run' + ScriptSelector.ok + ' sleep... at least 60 seconds + call sleep(60) + ' If macro fails for whatever reason, a message comes up + Kontext + if active.exists() then + warnlog "#i87290# " + active.getText + active.ok + call hCloseDocument() + goto endsub + endif + + 'Path of the log file written by the macro + sTemp = convertPath(gOfficePath + "user/temp/log.dat") + a = 0 + 'Wait until file exists, but not longer than ten minutes + while ((NOT fileExists(sTemp)) AND (a < 10)) + printlog "waiting another minute until file exists - " + a + inc(a) + call sleep(60) + wend + + 'File exists + if (a<10) then + printlog "Log file exists: " + sTemp + 'Wait until test finished, but not longer than ten minutes + 'String at end, if finished: 'FINISHED' modified 10er sxw document from TBO! + a = 0 + lFiles(0)=0 + call ListRead (lFiles(), sTemp) + while ((lFiles(ListCount(lFiles())) <> "FINISHED") AND (a < 10)) + printlog "last line: '" + lFiles(ListCount(lFiles())) + "'" + inc(a) + call sleep(60) + lFiles(0)=0 + call ListRead (lFiles(), sTemp) + wend + + 'Macro finished + if (a<10) then + printlog "Test document finished." + 'Grep file for "-> error" & "-> ok" + a = ListCount(lFiles()) + for i = 1 to a + if inStr(lFiles(i), "-> error") > 0 then + if inStr("simpress Paste Object -> errorsdraw Paste Object -> error",lFiles(i)) > 0 then + qaerrorlog lFiles(i) + else + warnlog lFiles(i) + inc(iError) + endif + elseif inStr(lFiles(i), "-> ok") > 0 then + printlog lFiles(i) + inc(iOK) + endif + next i + if (iError > 0) then + qaErrorlog sLocation + "Smoketest/10-er Test failed: " + iError + " times." + endif + printlog "Smoketest/10-er Test succeeded: " + iOK + " times." + else + warnlog sLocation + "Macro didn't finish in time (10 minutes)" + endif + else + warnlog sLocation + "Macro didn't create log file in time (10 minutes)" + endif + else + warnlog sLocation + "Macro not found: 'StartTestByOptions'" + endif + else + warnlog sLocation + "Library not found: '10erTest_680' or '10ERTEST_680'" + endif + else + warnlog sLocation + "'Run macro dialog' didn't came up" + endif + + 'clean up + 'Close the document, else an error about the navigator will be thrown + if getDocumentcount > 0 then + call hCloseDocument() + endif +endcase + diff --git a/testautomation/framework/required/includes/standard_toolbar_1.inc b/testautomation/framework/required/includes/standard_toolbar_1.inc new file mode 100644 index 000000000000..4494d6a26cad --- /dev/null +++ b/testautomation/framework/required/includes/standard_toolbar_1.inc @@ -0,0 +1,77 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : global update test (Standardbar) +'* +'\*************************************************************************** + +testcase tStandardBar_1 + + printlog "Check the 'Standardbar' in all applications" + + gApplication = "WRITER" + hNewDocument() + kontext "DocumentWriter" + DocumentWriter.maximize() + hCloseDocument() + + Printlog " - WRITER: check if Standardbar exists" + gApplication = "WRITER" + hAccessStandardBar() + + Printlog " - CALC: check if Standardbar exists" + gApplication = "CALC" + hAccessStandardBar() + + Printlog " - IMPRESS: check if Standardbar exists" + gApplication = "IMPRESS" + hAccessStandardBar() + + Printlog " - DRAW: check if Standardbar exists" + gApplication = "DRAW" + hAccessStandardBar() + + Printlog " - HTML: check if Standardbar exists" + gApplication = "HTML" + hAccessStandardBar() + + Printlog " - MATH: check if Standardbar exists" + gApplication = "MATH" + hAccessStandardBar() + + Printlog " - GLOBALDOC: check if Standardbar exists" + gApplication = "MASTERDOCUMENT" + hAccessStandardBar() + + gApplication = "WRITER" + + +endcase + + diff --git a/testautomation/framework/required/includes/standard_toolbar_3.inc b/testautomation/framework/required/includes/standard_toolbar_3.inc new file mode 100644 index 000000000000..cbc08096b8a6 --- /dev/null +++ b/testautomation/framework/required/includes/standard_toolbar_3.inc @@ -0,0 +1,256 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Items on the standardbar +'* +'\*************************************************************************** + +testcase tStandardBar_3 + + printlog( "Items on the standardbar" ) + + dim sFileOut as String + dim HyperlinkTabID as integer + dim iTabPage as integer + + gApplication = "CALC" + + printlog( "Cleanup test environment - delete files" ) + sFileOut = hGetWorkPath() & "FWK-update-functionbar" & hGetSuffix( "current" ) + ConvertPath ( sFileOut ) + hDeleteFile( sFileOut ) + + printlog( "Reset the standardbar to defaults" ) + hResetStandardBar() + + printlog( "New Spreadsheet document" ) + hCreateDocument() + + Kontext "Navigator" + if ( Navigator.Exists() ) then + Navigator.close() + endif + + printlog( "Insert text into a random cell, press <Enter>" ) + Kontext "DocumentCalc" + DocumentCalc.TypeKeys( "Only for a test.<Return>" ) + + Kontext "Standardbar" + printlog( "Press the 'Save' button" ) + hWaitForObject( Speichern , 1000 ) + Speichern.click() + + + Kontext "SpeichernDlg" + printlog( "- Save the file to: " & sFileOut ) + Dateiname.SetText( sFileOut ) + Speichern.Click() + + printlog( "Close the document" ) + hDestroyDocument() + + printlog( "Click the 'File Open' button" ) + hUseAsyncSlot( "FileOpen" ) + + Kontext "OeffnenDlg" + Printlog( "Load test file in read-only mode" ) + if ( OeffnenDlg.exists( 2 ) ) then + Dateiname.SetText( sFileOut ) + NurLesen.Check() + oeffnen.click() + else + warnlog( "File Open dialog is missing" ) + endif + + wait( 2000 ) + + Kontext "DocumentCalc" + printlog( "Try to insert a chart to verify that the document is read-only (this should fail)" ) + try + InsertChartCalc + warnlog( "The document is not read-only" ) + catch + endcatch + + Kontext "Standardbar" + printlog( "Click the <Edit File> button" ) + hWaitForObject( Bearbeiten , 1000 ) + Bearbeiten.click() : WaitSlot() + + printlog( "Try to insert a chart (should work this time)" ) + InsertChartCalc + + Kontext "ChartWizard" + if ( ChartWizard.exists( 2 ) ) then + printlog( "Cancel Chart Wizard" ) + ChartWizard.cancel() + WaitSlot() + else + warnlog( "Chart Wizard should be open" ) + endif + + printlog( "Select a few cells for Cut/Copy/Paste test" ) + Kontext "DocumentCalc" + DocumentCalc.TypeKeys( "<Up>", 7 ) + DocumentCalc.TypeKeys( "<Shift Down>", 5 ) + + printlog( "Cut" ) + Kontext "Standardbar" + hWaitForObject( Ausschneiden , 1000 ) + Ausschneiden.Click() + WaitSlot() + + Kontext "DocumentCalc" + printlog( "Move down one cell" ) + DocumentCalc.TypeKeys( "<Down>" ) + + printlog( "Paste" ) + Kontext "Standardbar" + sleep( 3 ) ' No better solution found yet. + Einfuegen.Click() + + Kontext "DocumentCalc" + printlog( "Move up 7 cells, then do <shift down>" ) + DocumentCalc.TypeKeys( "<Up>", 7 ) + DocumentCalc.TypeKeys( "<Shift Down>", 5 ) + WaitSlot() + + printlog( "Copy" ) + Kontext "Standardbar" + hWaitForObject( Kopieren , 1000 ) + Kopieren.Click() + WaitSlot() + + Kontext "DocumentCalc" + printlog( "Press right arrow and RETURN" ) + DocumentCalc.TypeKeys( "<Right><Return>" ) + WaitSlot() + + printlog( "Paste again" ) + Kontext "Standardbar" + hWaitForObject( Einfuegen , 1000 ) + Einfuegen.Click() + + printlog( "Undo" ) + hWaitForObject( Undo , 2000 ) + Undo.Click() + WaitSlot() + + printlog( "Redo" ) + hWaitForObject( Redo , 2000 ) + Redo.Click() + WaitSlot() + + Kontext "Standardbar" + printlog( "Open Navigator" ) + hWaitForObject( NavigatorButton , 1000 ) + NavigatorButton.Click() + + Kontext "Navigator" + if ( Navigator.Exists( 1 ) ) then + printlog( "Close Navigator" ) + Kontext "Standardbar" + NavigatorButton.Click() + else + warnlog( "Navigator did not open" ) + endif + + Kontext "Navigator" + if ( Navigator.exists() ) then + warnlog( "The navigator should not be visible" ) + endif + + Kontext "Standardbar" + printlog( "Click <HyperLink> to open the dialog" ) + hWaitForObject( HyperlinkDialog , 1000 ) + HyperlinkDialog.Click() + + for iTabPage = 1 to 4 + select case iTabPage + case 1: Kontext "Hyperlink" + if ( Hyperlink.exists() ) then HyperlinkTabID = 1 + exit for + case 2: kontext "TabHyperlinkMailUndNews" + if ( TabHyperlinkMailUndNews.exists() ) then HyperlinkTabID = 2 + exit for + case 3: kontext "TabHyperlinkDokument" + if ( TabHyperlinkDokument.exists() ) then HyperlinkTabID = 3 + exit for + case 4: kontext "TabHyperlinkNeuesDokument" + if ( TabHyperlinkNeuesDokument.exists() ) then HyperlinkTabID = 4 + exit for + case default: + HyperlinkTabID = 0 + end select + next iTabPage + + if ( HyperlinkTabID > 0 ) then + + if ( HyperlinkTabID <> 1 ) then + qaerrorlog( "This is not the internet tabpage, did you " & _ + "kill the userlayer before running the test?" ) + endif + + kontext "Standardbar" + printlog( "Click <HyperLink> to close" ) + HyperlinkDialog.Click() + WaitSlot() + else + warnlog( "#i104704# - Insert Hyperlink dialog cannot be accessed" ) + Kontext "Standardbar" + HyperlinkDialog.Click() + endif + + Kontext "Standardbar" + printlog( "Gallery button" ) + hWaitForObject( GalleryButton , 1000 ) + GalleryButton.Click() + + kontext "Gallery" + if ( Gallery.exists( 3 ) ) then + printlog( "Gallery button again, to close" ) + kontext "StandardBar" + GalleryButton.click() + WaitSlot() + + kontext "Gallery" + if ( Gallery.exists() ) then + warnlog( "Gallery did not close " ) + endif + else + warnlog( "The Gallery did not open" ) + endif + + printlog( "Close all documents and delete files" ) + hDestroyDocument() + hDeleteFile( sFileOut ) + +endcase + + diff --git a/testautomation/framework/required/includes/standard_toolbar_4.inc b/testautomation/framework/required/includes/standard_toolbar_4.inc new file mode 100755 index 000000000000..3f393ff3291a --- /dev/null +++ b/testautomation/framework/required/includes/standard_toolbar_4.inc @@ -0,0 +1,65 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Invisible items on the standardbar +'* +'\****************************************************************************** + +testcase tStandardBar_4 + + printlog( "Invisible items on the standardbar" ) + + printlog( "Reset standardbar to defaults" ) + hResetStandardBar() + + gApplication = "WRITER" + printlog( "Open one single Writer document" ) + hInitSingleDoc() + + kontext "DocumentWriter" + DocumentWriter.maximize() ' Needed to avoid toolbar clipping on resolutions < 1024x768 or small windows. + + printlog( "Check item count on toolbar" ) + hStandardbarItemGetCount() + + printlog( "Load URL" ) + hStandardbarLoadUrl() + + printlog( "<NEW> dialog" ) + hStandardbarNewDialog() + + printlog( "<Save As>" ) + hStandardbarSaveAs() + + printlog( "Close all open documents" ) + hFileCloseAll() + +endcase + + diff --git a/testautomation/framework/required/includes/standard_toolbar_5.inc b/testautomation/framework/required/includes/standard_toolbar_5.inc new file mode 100644 index 000000000000..76fa20d5dffa --- /dev/null +++ b/testautomation/framework/required/includes/standard_toolbar_5.inc @@ -0,0 +1,78 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Customize toolbar +'* +'\*************************************************************************** + + +testcase tStandardBar_5 + + printlog( "Customize toolbar" ) + + hCreateDocument() + + kontext "standardbar" + Standardbar.OpenContextmenu() + waitslot + hMenuselectNr( 2 ) + waitslot + + hToolsCustomizeSelectTab( "menu" ) + call dialogtest( TabCustomizeMenu ) + + hToolsCustomizeSelectTab( "keyboard" ) + call dialogtest( Tabtastatur ) + + hToolsCustomizeSelectTab( "toolbars" ) + call dialogtest( TabCustomizeToolbars ) + + hToolsCustomizeSelectTab( "events" ) + call dialogtest( TabCustomizeEvents ) + + kontext "tabcustomizeevents" + TabCustomizeEvents.OK() + + kontext "standardbar" + Standardbar.OpenContextmenu() + waitslot + hMenuselectNr (2) + waitslot + + kontext "tabcustomizetoolbars" + TabCustomizeToolbars.OK() + + printlog "Reset" + hResetStandardBar() + + hDestroyDocument() + +endcase + + diff --git a/testautomation/framework/required/includes/standard_toolbar_6.inc b/testautomation/framework/required/includes/standard_toolbar_6.inc new file mode 100755 index 000000000000..c3ff6be6e849 --- /dev/null +++ b/testautomation/framework/required/includes/standard_toolbar_6.inc @@ -0,0 +1,141 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Open applications from New button on standardbar +'* +'\*************************************************************************** + +testcase tStandardBar_6 + + printlog( "Open applications from New button on standardbar" ) + + + hUseImpressAutopilot( false ) + + gApplication = "WRITER" + + printlog "Check the 'New'-menu-button in Standardbar in each application" + printlog "- click on menu-button -> open a new document as same document-type" + + printlog " - Writer" + gApplication = "WRITER" + hCreateDocument() + + kontext "standardbar" + Neu.Click() + + kontext "documentwriter" + DocumentWriter.TypeKeys( "Hallo" ) + + hDestroyDocument() + hDestroyDocument() + + printlog " - Calc" + gApplication = "CALC" + hCreateDocument() + + kontext "standardbar" + Neu.Click() + + kontext "documentcalc" + DocumentCalc.TypeKeys( "Hallo" ) + + hDestroyDocument() + hDestroyDocument() + + printlog " - Draw" + gApplication = "DRAW" + hCreateDocument() + + kontext "standardbar" + Neu.Click() + + gMouseClick ( 50, 50 ) + + hDestroyDocument() + hDestroyDocument() + + printlog " - Impress" + gApplication = "IMPRESS" + hCreateDocument() + + kontext "standardbar" + Neu.Click() + + gMouseClick ( 50, 50 ) + + hDestroyDocument() + hDestroyDocument() + + printlog " - HTML-document" + gApplication = "HTML" + hCreateDocument() + + kontext "standardbar" + Neu.Click() + + kontext "documentwriter" + DocumentWriter.TypeKeys( "Hallo" ) + + hDestroyDocument() + hDestroyDocument() + + printlog " - Master-document" + gApplication = "MASTERDOCUMENT" + hCreateDocument() + + kontext "standardbar" + Neu.Click() + + kontext "documentwriter" + DocumentWriter.TypeKeys( "Hallo" ) + + kontext "Navigator" + hCloseDialog( Navigator, "close,optional" ) + hDestroyDocument() + + kontext "Navigator" + hCloseDialog( Navigator, "close,optional" ) + hDestroyDocument() + + printlog " - Math" + gApplication = "MATH" + hCreateDocument() + + kontext "standardbar" + Neu.Click() + + SchreibenInMathdok "a over b" + + hDestroyDocument() + hDestroyDocument() + +endcase + + diff --git a/testautomation/framework/required/includes/tools_customize.inc b/testautomation/framework/required/includes/tools_customize.inc new file mode 100755 index 000000000000..2f7064055883 --- /dev/null +++ b/testautomation/framework/required/includes/tools_customize.inc @@ -0,0 +1,731 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* 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() + + const CFN = "hUpdtToolsCustomizeMenu::" + + const MENUITEM_MOVE = 1 + const MENUITEM_ADDSUBMENU = 1 + const MENUITEM_RENAME = 2 + const MENUITEM_DELETE = 3 + const MENUITEM_MODIFY = 2 + const MENUITEM_MODIFY_LARGE_MENU = 4 + + const APPLICATION_ONLY = 1 + const APPLICATION_AND_DOCUMENT = 2 + const ITEMNAME = "tUpdtCustomize" + + dim brc as boolean + + dim iItems as integer + dim iCurrentItem as integer + dim iMenuListItems as integer + dim iEntriesListItems as integer + + printlog( "" ) + printlog( "Menu" ) + + hToolsCustomizeSelectTab( "Menu" ) + call DialogTest( TabCustomizeMenu ) + + printlog( CFN & "Click New..." ) + kontext "TabCustomizeMenu" + BtnNew.click() + + Kontext "MenuOrganiser" + if ( MenuOrganiser.exists( 2 ) ) then + printlog( CFN & "MenuOrganiser" ) + call DialogTest( MenuOrganiser ) + + printlog( CFN & "Down..." ) + ButtonDown.click() + + printlog( CFN & "Up..." ) + ButtonUp.click() + + printlog( CFN & "Name the new menu" ) + MenuName.setText( "tUpdtCustomize" ) + + 'qaerrorlog( "#i60609# Undeclared listbox in menu organiser" ) + printlog( "TODO: Access the listbox in menuorganizer" ) + + printlog( CFN & "Close the menu with ok" ) + hCloseDialog( MenuOrganiser, "ok" ) + else + warnlog( "Dialog <MenuOrganiser> did not open" ) + endif + + printlog( CFN & "Click the menu listbutton" ) + kontext "TabCustomizeMenu" + hOpenMenuButton( MenuBtn ) ' MenuBtn.OpenMenu() + + printlog( CFN & "Select Move..." ) + hMenuSelectNr( MENUITEM_MOVE ) + + kontext "MenuOrganiser" + if ( MenuOrganiser.exists( 2 ) ) then + printlog( CFN & "Click UP" ) + ButtonUp.click() + + kontext "MenuOrganiser" + printlog( CFN & "Click DOWN" ) + ButtonDown.click() + + printlog( CFN & "Cancel the dialog" ) + hCloseDialog( MenuOrganiser, "cancel" ) + else + warnlog( "Dialog <MenuOrganizer> did not open" ) + endif + + printlog( CFN & "Click the menu listbutton" ) + kontext "TabCustomizeMenu" + hOpenMenuButton( MenuBtn ) ' MenuBtn.OpenMenu() + + printlog( CFN & "Select Rename..." ) + hMenuSelectNr( MENUITEM_RENAME ) + + printlog( CFN & "Cancel the renaming-dialog" ) + kontext "RenameMenu" + RenameMenu.cancel() + + printlog( CFN & "Click the menu listbutton" ) + kontext "TabCustomizeMenu" + hOpenMenuButton( MenuBtn ) ' MenuBtn.OpenMenu() + + printlog( CFN & "Select Delete" ) + hMenuSelectNr( MENUITEM_DELETE ) + + kontext "TabCustomizeMenu" + hUpdtToolsCustomizeScriptSelector( 3 ) + + printlog( CFN & "Check itemcount in SaveIn List" ) + kontext "TabCustomizeMenu" + select case gApplication + case "BACKGROUND" : brc = hToolsCustomizeTestSaveIn( APPLICATION_ONLY ) + case else : brc = hToolsCustomizeTestSaveIn( APPLICATION_AND_DOCUMENT ) + end select + if ( not brc ) then warnlog( "Incorrect itemcount in listbox, see above" ) + + printlog( CFN & "Down..." ) + BtnDown.click() + + printlog( CFN & "Up..." ) + BtnUp.click() + + printlog( CFN & "Click the Modify-Button and select item 1 (Add submenu)" ) + kontext "TabCustomizeMenu" + + if ( not hClickCommandButton( MENUITEM_ADDSUBMENU ) ) then + warnlog( CFN & "Something went wrong when accessing the command button" ) + exit function + endif + + printlog( CFN & "Give the submenu a name, accept with OK" ) + kontext "CustomizeMenuName" + call dialogtest( CustomizeMenuName ) + EingabeFeld.setText( ITEMNAME ) + CustomizeMenuName.ok() + + printlog( CFN & "Find the new submenu in the list and select it" ) + WaitSlot() + kontext "TabCustomizeMenu" + iEntriesListItems = Entries.getItemCount() + for iCurrentItem = 1 to iEntriesListItems + + Entries.select( iCurrentItem ) + if ( Entries.getSelText() = ITEMNAME ) then + exit for + endif + + next iCurrentItem + + + printlog( CFN & "Click the Modify-Button and select to rename the item" ) + kontext "TabCustomizeMenu" + + if ( not hClickCommandButton( 3 ) ) then + warnlog( CFN & "Something went wrong when accessing the command button" ) + exit function + endif + + printlog( CFN & "Rename the item, accept with OK" ) + kontext "CustomizeMenuReName" + call dialogtest( CustomizeMenuReName ) + EingabeFeld.setText( ITEMNAME & "1" ) + CustomizeMenuReName.ok() + + printlog( CFN & "Verify that the name has been updated" ) + kontext "TabCustomizeMenu" + if ( Entries.getSelText() <> ( ITEMNAME & "1" ) ) then + warnlog( "Names do not match" ) + endif + + printlog( CFN & "Click the Modify-Button and delete the current item" ) + kontext "TabCustomizeMenu" + + if ( not hClickCommandButton( MENUITEM_MODIFY_LARGE_MENU ) ) then + warnlog( CFN & "Something went wrong when accessing the command button" ) + exit function + endif + + printlog( CFN & "Click the Modify-Button and create a new group" ) + kontext "TabCustomizeMenu" + + if ( not hClickCommandButton( MENUITEM_MODIFY ) ) then + warnlog( CFN & "Something went wrong when accessing the command button" ) + exit function + endif + + ' Note: The current index for the delete-function is at pos 2. + printlog( CFN & "Click the Modify-Button and delete the new group" ) + kontext "TabCustomizeMenu" + + if ( not hClickCommandButton( MENUITEM_MODIFY ) ) then + warnlog( CFN & "Something went wrong when accessing the command button" ) + exit function + endif + +end function + +'******************************************************************************* + +function hUpdtToolsCustomizeToolbars() + + const CFN = "hUpdtToolsCustomizeToolbars::" + + const DOCUMENT_ONLY = 1 + const APPLICATION_AND_DOCUMENT = 2 + + const MENUITEM_RENAME = 1 + const MENUITEM_DELETE = 2 + const MENUITEM_MODIFY = 4 + + const DIALOG_DELAY = 1 + + dim brc as boolean + dim iCurrentItem as integer + + printlog( "" ) + printlog( "Toolbars" ) + + brc = hToolsCustomizeSelectTab( "Toolbars" ) + call DialogTest( TabCustomizeToolbars ) + + printlog( CFN & "Click New..." ) + kontext "TabCustomizeToolbars" + BtnNew.click() + + kontext "NewToolbar" + if ( NewToolbar.exists( DIALOG_DELAY ) ) then + printlog( CFN & "NewToolbar" ) + call DialogTest( NewToolbar ) + + select case gApplication + case "BACKGROUND" : brc = hToolsCustomizeTestSaveIn( DOCUMENT_ONLY ) + case else : brc = hToolsCustomizeTestSaveIn( APPLICATION_AND_DOCUMENT ) + end select + + if ( not brc ) then warnlog( "Incorrect itemcount in listbox, see above" ) + + printlog( CFN & "Name the new toolbar for further usage" ) + ToolbarName.setText( "tUpdtCustomize" ) + + printlog( CFN & "Close NewToolbar dialog with OK" ) + hCloseDialog( NewToolbar, "ok" ) + else + warnlog( CFN & "Could not access New Toolbar dialog" ) + endif + + printlog( CFN & "Rename the toolbar via Toolbar-Button" ) + kontext "TabCustomizeToolbars" + hOpenMenuButton( MenuBtn ) ' MenuBtn.OpenMenu() + + printlog( "Select rename" ) + hMenuSelectNr( MENUITEM_RENAME ) + + printlog( CFN & "Cancel the dialog" ) + kontext "RenameToolbar" + if ( RenameToolbar.exists( DIALOG_DELAY ) ) then + call dialogtest( RenameToolbar ) + hCloseDialog( RenameToolbar, "Cancel" ) + else + warnlog( CFN & "Could not access Toolbar renaming dialog" ) + endif + + printlog( CFN & "Delete the toolbar via Toolbar-Button" ) + kontext "TabCustomizeToolbars" + hOpenMenuButton( MenuBtn ) ' MenuBtn.OpenMenu() + + printlog( "Select delete" ) + hMenuSelectNr( MENUITEM_DELETE ) + + kontext "TabCustomizeToolbars" + hUpdtToolsCustomizeScriptSelector( 2 ) + + kontext "TabCustomizeToolbars" + select case gApplication + case "BACKGROUND" : brc = hToolsCustomizeTestSaveIn( DOCUMENT_ONLY ) + case else : brc = hToolsCustomizeTestSaveIn( APPLICATION_AND_DOCUMENT ) + end select + + if ( not brc ) then warnlog( "Incorrect itemcount in listbox, see above" ) + + printlog( CFN & "Down..." ) + if ( BtnDown.isEnabled() ) then + BtnDown.click() + else + qaerrorlog( "BtnDown is not enabled" ) + endif + + printlog( CFN & "Up..." ) + if ( BtnUp.isEnabled() ) then + BtnUp.click() + else + qaerrorlog( "BtnUp is not enabled" ) + endif + + kontext "TabCustomizeToolbars" + printlog( CFN & "Add command" ) + AddCommands.click() + + kontext "ScriptSelector" + if ( ScriptSelector.exists( DIALOG_DELAY ) ) then + printlog( "ScriptSelector open." ) + else + LibraryTreeList.typeKeys( "<HOME>" ) + for iCurrentItem = 1 to 5 + printlog( CFN & "LibraryTreeList: Moving down..." ) + LibraryTreeList.typeKeys( "<DOWN>" ) + if ( ScriptSelector.isEnabled() ) then exit for + next iCurrentItem + endif + + call dialogtest( ScriptSelector ) + + printlog( CFN & "Close the Script Selector, back to ToolsCustomize dialog" ) + hCloseDialog( ScriptSelector, "cancel" ) + + kontext "TabCustomizeToolbars" + printlog( CFN & "Click the Modify-button" ) + + if ( hClickCommandButton( 1 ) ) then + + printlog( CFN & "Command button clicked successfully" ) + kontext "CustomizeToolbarsRename" + UseBindings + wait( 100 ) + if ( CustomizeToolbarsRename.exists( DIALOG_DELAY ) ) then + + printlog( CFN & "Rename dialog is open" ) + call dialogtest( CustomizeToolbarsRename ) + EingabeFeld.setText( "Renamed item" ) + + printlog( CFN & "Close the dialog" ) + hCloseDialog( CustomizeToolbarsRename, "ok" ) + else + warnlog( CFN & "CustomizeToolbarsRename could not be accessed" ) + endif + else + warnlog( CFN & "Something went wrong when accessing the command button" ) + exit function + endif + + kontext "TabCustomizeToolbars" + if ( hClickCommandButton( 2 ) ) then + printlog( CFN & "Successfully clicked second item on the command button" ) + else + warnlog( CFN & "Something went wrong when accessing the command button" ) + exit function + endif + + kontext "TabCustomizeToolbars" + waitslot + printlog( CFN & "Deselect separator (if this is the current object)" ) + hDeselectSeparator() + + kontext "TabCustomizeToolbars" + if ( not hClickCommandButton( 3 ) ) then + warnlog( CFN & "Something went wrong when accessing the command button" ) + exit function + endif + + waitslot + kontext "TabCustomizeToolbars" + printlog( CFN & "Click the Modify-button" ) + if ( hClickCommandButton( MENUITEM_MODIFY ) ) then + printlog( CFN & "Successfully selected modify-item on the command button" ) + else + warnlog( CFN & "Something went wrong when accessing the command button" ) + exit function + endif + + WaitSlot + kontext "TabCustomizeToolbars" + printlog( CFN & "Click the Modify-button" ) + if ( hClickCommandButton( 1 ) ) then + printlog( CFN & "Successfully selected modify-item on the command button" ) + else + warnlog( CFN & "Something went wrong when accessing the command button" ) + exit function + endif + + waitslot + kontext "TabCustomizeToolbars" + printlog( CFN & "Click the Modify-button" ) + hDeselectSeparator() + + if ( hClickCommandButton( 5 ) ) then + printlog( CFN & "Successfully selected modify-item on the command button" ) + else + warnlog( CFN & "Something went wrong when accessing the command button" ) + exit function + endif + + kontext "ChangeIcon" + printlog( CFN & "On the Change Icon dialog: Click to import an icon" ) + if ( ChangeIcon.exists( DIALOG_DELAY ) ) then + call dialogtest( ChangeIcon ) + import.click() + + printlog( CFN & "Cancel the FileOpen-dialog" ) + kontext "OeffnenDlg" + call dialogtest( OeffnenDlg ) + hCloseDialog( OeffnenDlg, "cancel" ) + + printlog( CFN & "Close the Change Icon dialog with <ok>" ) + kontext "ChangeIcon" + hCloseDialog( ChangeIcon, "ok" ) + else + warnlog( CFN & "Could not access Change Icon dialog" ) + endif + + waitslot + kontext "TabCustomizeToolbars" + printlog( CFN & "Click the Modify-button" ) + if ( hClickCommandButton( 3 ) ) then + printlog( CFN & "Successfully selected modify-item on the command button" ) + else + warnlog( CFN & "Something went wrong when accessing the command button" ) + exit function + endif + +end function + + +'******************************************************************************* + +function hUpdtToolsCustomizeEvents() + + const CFN = "hUpdtToolsCustomizeEvents::" + const APPLICATION_ONLY = 1 + const APPLICATION_AND_DOCUMENT = 2 + const TAB_EVENTS = 1 + + dim brc as boolean + + printlog( "" ) + printlog( "Events" ) + + hToolsCustomizeSelectTab( "events" ) + if ( TabCustomizeEvents.exists() ) then + if ( TabCustomizeEvents.isVisible() ) then + call DialogTest( TabCustomizeEvents ) + + hUpdtToolsCustomizeScriptSelector( TAB_EVENTS ) + + kontext "TabCustomizeEvents" + select case gApplication + case "BACKGROUND" : brc = hToolsCustomizeTestSaveIn( APPLICATION_ONLY ) + case else : brc = hToolsCustomizeTestSaveIn( APPLICATION_AND_DOCUMENT ) + end select + + if ( not brc ) then warnlog( "Incorrect itemcount in listbox, see above" ) + + else + warnlog( "<TabCustomizeEvents> is not visible" ) + endif + else + warnlog( "<TabCustomizeEvents> did not open" ) + endif + +end function + +'******************************************************************************* + +function hUpdtToolsCustomizeKeyboard() as boolean + + const CFN = "hUpdtToolsCustomizeKeyboard::" + const FIRST_CHANGEABLE_ITEM = 2 + + printlog( "" ) + printlog( "Keyboard" ) + + if ( gApplication = "BACKGROUND" ) then + if ( not hToolsCustomizeSelectTab( "keyboard" ) ) then + qaerrorlog( "#i61765# TabTastatur is missing when called from Backing Window" ) + hUpdtToolsCustomizeKeyboard() = false + exit function + endif + endif + + hToolsCustomizeSelectTab( "keyboard" ) + + kontext "TabTastatur" + call DialogTest( TabTastatur ) + + ' no verification of functionality, this is an update test! + kontext "TabTastatur" + StarOffice.check() + hSelectNode( Tastatur , FIRST_CHANGEABLE_ITEM ) + hSelectTopNode( bereich ) + + ' Workaround: It might still happen that the currently selected accelerator + ' is "fixed" so we need to find another one that can be modified. + do while ( not Aendern.isEnabled() ) + printlog( "Moving selection down by one, Control is not enabled" ) + Tastatur.TypeKeys( "<DOWN>" ) + loop + + Aendern.click() + Zuruecksetzen.click() + hSelectNode( Tastatur , FIRST_CHANGEABLE_ITEM ) + + ' Workaround: It might still happen that the currently selected accelerator + ' is "fixed" so we need to find another one that can be modified. + do while ( not Aendern.isEnabled() ) + printlog( "Moving selection down by one, Control is not enabled" ) + Tastatur.TypeKeys( "<DOWN>" ) + loop + + Aendern.click() + Loeschen.click() + Speichern.click() + + kontext "SpeichernDlg" + hCloseDialog( SpeichernDlg, "cancel" ) + + kontext "TabTastatur" + Laden.click() + + kontext "OeffnenDlg" + hCloseDialog( OeffnenDlg, "cancel" ) + +end function + +'******************************************************************************* + +function hUpdtToolsCustomizeScriptSelector( iPageButton as integer ) as boolean + + const CFN = "hUpdtToolsCustomizeScriptSelector::" + + dim brc as boolean : brc = true + const TAB_EVENTS = 1 + const TAB_TOOLBARS = 2 + const TAB_MENU = 3 + const DIALOG_DELAY = 2 + + select case iPageButton + case TAB_EVENTS + kontext "TabCustomizeEvents" + printlog( CFN & "Assign Macro... (1)" ) + AssignMacro.click() + case TAB_TOOLBARS + kontext "TabCustomizeToolbars" + printlog( CFN & "Add... (2)" ) + AddCommands.click() + case TAB_MENU + kontext "TabCustomizeMenu" + printlog( CFN & "Add... (3)" ) + AddCommands.click() + case else + warnlog( CFN & "Invalid function parameter" ) + hUpdtToolsCustomizeScriptSelector() = false + exit function + end select + + kontext "ScriptSelector" + if ( ScriptSelector.exists( DIALOG_DELAY ) ) then + call DialogTest( ScriptSelector ) + + kontext "ScriptSelector" + hCloseDialog( ScriptSelector, "cancel" ) + else + warnlog( CFN & "Dialog <ScriptSelector> did not open" ) + endif + + select case iPageButton + case TAB_EVENTS : kontext "TabCustomizeEvents" + case TAB_TOOLBARS : kontext "TabCustomizeToolbars" + case TAB_MENU : kontext "TabCustomizeMenu" + end select + + hUpdtToolsCustomizeScriptSelector() = brc + +end function + +'******************************************************************************* + +function hToolsCustomizeTestSaveIn( iItems as integer ) as boolean + + const CFN = "hToolsCustomizeTestSaveIn::" + dim iPresentItems as integer + + iPresentItems = SaveIn.getItemCount() + + if ( iPresentItems <> iItems ) then + printlog( CFN & "Incorrect itemcount in SaveIn: " ) + printlog( CFN & "Expected: " & iItems ) + printlog( CFN & "Found...: " & iPresentItems ) + hToolsCustomizeTestSaveIn() = false + else + printlog( CFN & "Correct itemcount in SaveIn: " & iItems ) + hToolsCustomizeTestSaveIn() = true + endif + +end function + +'******************************************************************************* + +function hOpenMenuButton( oControl as object ) as integer + + ' This function is very evil. + ' It was written to hopefully workaround the infamous menubutton which is a button + ' that - when clicked - opens a menu. This feature is shaky and depends on + ' a lot of factors. There is a simple working implemantation in t_menu.inc + ' which has the drawback of being absolutely slow, costing the tools_customize + ' test a lot of time waiting for the control (30% of testtime spent waiting). + ' This approach tries to be dynamic: Machines that can do it the fast way + ' use it automatically, machines that are too slow get two retries with the + ' slower approach. + ' The menubutton is one of the last remaining places where none of the + ' speed optmizations and enhancements apply, so neither WaitSlot() nor + ' synchronous slot execution help here. + + dim iClick as integer + dim bUseSlowMethod as boolean : bUseSlowMethod = false + + const CFN = "hOpenMenuButton: " + const RC_FAILURE = -1 + const MAX_RETRIES = 3 + const DEFAULT_DELAY = 1000 + + hOpenMenuButton() = RC_FAILURE + + for iClick = 1 to MAX_RETRIES + + if ( bUseSlowMethod ) then + wait( DEFAULT_DELAY ) + oControl.OpenMenu() + wait( DEFAULT_DELAY * 3 ) + else + oControl.click() + endif + + try + hOpenMenuButton() = MenuGetItemCount + printlog( CFN & "Success on " & iClick & ". attempt" ) + exit function + catch + qaerrorlog( CFN & "#i96753 - Failed to retrieve itemcount from Menu-/Command-button" ) + bUseSlowMethod = true + endcatch + + next iClick + +end function + +'******************************************************************************* + +function hClickCommandButton( iItemToClick as integer ) as boolean + + const CFN = "hClickCommandButton::" + printlog( CFN & "Enter" ) + + dim brc as boolean 'a multi purpose boolean returnvalue + dim iMenuItems as integer + + iMenuItems = hOpenMenuButton( Command ) + + ' exit on error + if ( iMenuItems < 0 ) then + warnlog( CFN & "Menu apparently not open, giving up." ) + hClickCommandButton() = false + exit function + endif + + hMenuSelectNr( iItemToClick ) + wait( 500 ) + ' check for the rename dialog (menu) + kontext "CustomizeMenuReName" + if ( CustomizeMenuReName.exists() ) then + printlog( CFN & "Opened dialog: Rename Menu" ) + hClickCommandButton() = true + exit function + endif + + ' check for the rename dialog (toolbar) + kontext "CustomizeToolbarsRename" + if ( CustomizeToolbarsRename.exists() ) then + printlog( CFN & "Opened dialog: Rename Toolbar" ) + hClickCommandButton() = true + exit function + endif + + printlog( CFN & "Exit" ) + hClickCommandButton() = true + +end function diff --git a/testautomation/framework/required/includes/tools_options.inc b/testautomation/framework/required/includes/tools_options.inc new file mode 100755 index 000000000000..82d5ef6ae861 --- /dev/null +++ b/testautomation/framework/required/includes/tools_options.inc @@ -0,0 +1,90 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Verify that the applications appear in tools/options +'* +'\****************************************************************************** + +testcase tUpdtOptionItems + + printlog( "Verify that all applications are listed in tools/options" ) + + const DOCTYPES = 7 + dim iDocType as integer + dim cDocType as string + dim iAppItems as integer + dim iNodes as integer + + dim iAppCount( DOCTYPES ) as integer + iAppCount( 1 ) = 8 ' writer + iAppCount( 2 ) = 7 ' calc + iAppCount( 3 ) = 7 ' impress + iAppCount( 4 ) = 7 ' draw + iAppCount( 5 ) = 7 ' math + iAppCount( 6 ) = 8 ' masterdoc + iAppCount( 7 ) = 8 ' html + + for iDocType = 1 to DOCTYPES + + printlog( "" ) + printlog( hNumericDocType( iDocType ) ) + hCreateDocument() + + ToolsOptions + + kontext "ExtrasOptionenDlg" + if ( ExtrasOptionenDlg.exists( 2 ) ) then + + iAppItems = Optionsliste.getItemCount() + Optionsliste.typeKeys( "<HOME>" ) + for iNodes = 1 to iAppItems + Optionsliste.typeKeys( "-" ) + Optionsliste.typeKeys( "<DOWN>" ) + next iNodes + + iAppItems = Optionsliste.getItemCount() + if ( iAppItems <> iAppCount( iDocType ) ) then + warnlog( "#i68068# The number of top nodes in Tools/Options is incorrect." ) + printlog( "Found...: " & iAppItems ) + printlog( "Expected: " & iAppCount( iDocType ) ) + else + printlog( "The number of top nodes is correct." ) + endif + + hCloseDialog( ExtrasOptionenDlg, "Cancel" ) + else + warnlog( "Dialog <Tools/Options> did not open " ) + endif + + hDestroyDocument() + + next iDocType + +endcase + diff --git a/testautomation/framework/required/includes/topten.inc b/testautomation/framework/required/includes/topten.inc new file mode 100644 index 000000000000..9aea2b0ab8b6 --- /dev/null +++ b/testautomation/framework/required/includes/topten.inc @@ -0,0 +1,322 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Smoke test (load/save/clipboard) +'* +'\*********************************************************************** + +sub topten + + 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 + +end sub + +'******************************************************************************* + +testcase Top_ten_test +
dim sUserWorkDirectory as string + dim sFilename_native as String + dim sFilename_export as String + dim sFilter_native as string + dim sFilter_export as String + dim bExportFile as boolean + + sUserWorkDirectory = gOfficePath & "user\work\" + bExportFile = true + + printlog( "Current document type: " & gApplication ) + + ' set the filenames and their filters. HTML is not exported + if ( gApplication = "HTML" ) then + sFilename_native = "ls_test.html" + sFilename_export = "ls_test.htm" + bExportFile = FALSE + else + sFilename_native = "ls_test" & hGetSuffix( "current" ) + sFilename_export = "ls_test" & hGetSuffix( "569" ) + endif + + printlog( "File (current): " & sFilename_native ) + printlog( "File (src569).: " & sFilename_export ) + + ' Delete the workfiles, they might have been left over by prior incomplete testrun + hDeleteFile( sUserWorkDirectory & sFilename_native ) + hDeleteFile( sUserWorkDirectory & sFilename_export ) + + ' Set the API filternames for the current application (native XML format) + select case gApplication + case "WRITER" : sFilter_native = "writer8" + case "CALC" : sFilter_native = "calc8" + case "DRAW" : sFilter_native = "draw8" + case "IMPRESS" : sFilter_native = "impress8" + case "MATH" : sFilter_native = "math8" + case "MASTERDOCUMENT" : sFilter_native = "writerglobal8" + case "HTML" : sFilter_native = "HTML" + case else : warnlog "Invalid gApplication: " & gApplication + end select + + printlog( "Create a new document" ) + call hNewDocument + + printlog( "Clipboard" ) + call CutCopyPaste + + printlog( "Save (default-fileformat): " & sFilename_native ) + call hFileSaveAsKill ( sUserWorkDirectory & sFilename_native ) + + if ( bExportFile ) then + + ' Set the API filternames for the current application (StarOffice 5.2 binary format) + select case gApplication + case "WRITER" : sFilter_export = "StarWriter 5.0" + case "CALC" : sFilter_export = "StarCalc 5.0" + case "DRAW" : sFilter_export = "StarDraw 5.0" + case "IMPRESS" : sFilter_export = "StarImpress 5.0" + case "MATH" : sFilter_export = "StarMath 5.0" + case "MASTERDOCUMENT" : sFilter_export = "StarWriter 5.0/GlobalDocument" + case else : warnlog "Invalid gApplication: " & gApplication + end select + + printlog( "Save (5.2-fileformat): " & sFilename_export ) + hFileSaveAsWithFilterKill( sUserWorkDirectory & sFilename_export , sFilter_export ) + + printlog( "Close" ) + FileClose + + ' There should be no alien warning + kontext "active" + If ( active.exists( 1 ) ) then + warnlog( "Unexpected messagebox: '" & active.getText & "'" ) + Active.Yes + else + printlog( "No more alien warning on closing the document. Good." ) + endif + else + FileClose + + kontext "active" + if ( Active.Exists( 1 ) ) then + warnlog( "Unexpected Active after saving: '" & active.getText & "'" ) + try + Active.Yes() + catch + Active.No() + endcatch + endif + endif + + printlog( "Load (default-fileformat): " & sFilename_native ) + call hFileOpen( sUserWorkDirectory & sFilename_native ) + + if ( bExportFile ) then + printlog( "Change the document" ) + hChangeDoc() + printlog( "Save" ) + hFileSave() + endif + + printlog( "Close" ) + FileClose + + if ( bExportFile ) then + + printlog( "Load (5.2-fileformat): " & sFilename_export ) + call hFileOpen (sUserWorkDirectory & sFilename_export) + + if ( gApplication = "MATH" AND iSprache = 84 AND gPlatform="lin" ) then + try + kontext "DocumentMath" + DocumentMath.MouseDown(50,50) + DocumentMath.MouseUp(50,50) + qaErrorLog( "Use workaround focus problem for math and language vi/84" ) + ' Needed by AndreSchnabel, not manual reproduceable, only with TestTool + catch + qaErrorLog( "Workaround focus problem failed." ) + endcatch + endif + + ' Modify the export document to trigger the alien warning on next save + printlog( "Change the document" ) + hChangeDoc() + + printlog( "Save" ) + FileSave + + Kontext "AlienWarning" + if ( AlienWarning.exists( 3 ) ) then + printlog( "Closing expected alien warning. Good." ) + AlienWarning.OK() + else + warnlog( "Alien warning is missing" ) + endif + + kontext "active" + if ( Active.Exists( 3 ) ) then + warnlog( "Unexpected messagebox: '" & active.getText & "'" ) + Active.yes + else + printlog( "No unexpected messages on save. Good." ) + endif + + printlog( "Close" ) + FileClose + + kontext "active" + if ( Active.Exists() ) then + warnlog( "Unexpected messagebox: '" & active.getText & "'" ) + Active.Yes() + else + printlog( "No more alien warning to close. Good." ) + endif + endif + + hDeleteFile( sUserWorkDirectory & sFilename_native ) + hDeleteFile( sUserWorkDirectory & sFilename_export ) + +endcase + +'******************************************************************************* + +sub CutCopyPaste + dim sSelectAll as string + + ' In Spain Select All is CTRL+E; CTRL+A is FileOpen + if (iSprache=34) then + sSelectAll = "<Mod1 e>" + else + sSelectAll = "<Mod1 a>" + endif + + select case gApplication + case "WRITER", "HTML", "MASTERDOCUMENT" + kontext "documentwriter" + DocumentWriter.TypeKeys "This is a test.<Return>" + printlog( " cut" ) + DocumentWriter.TypeKeys sSelectAll + DocumentWriter.TypeKeys "<Mod1 x>" + Wait( 500 ) + printlog( " paste" ) + DocumentWriter.TypeKeys "<Mod1 v>" + Wait( 500 ) + printlog( " copy" ) + DocumentWriter.TypeKeys sSelectAll + DocumentWriter.TypeKeys "<Mod1 c>" + Wait( 500 ) + printlog( " paste" ) + DocumentWriter.TypeKeys "<Mod1 v>" + Wait( 500 ) + case "CALC" : Kontext "DocumentCalc" + DocumentCalc.TypeKeys "This is a test.<Return>" + DocumentCalc.TypeKeys "<Up>" + printlog( " cut" ) + DocumentCalc.TypeKeys "<Mod1 x>" + Wait( 500 ) + printlog( " paste" ) + DocumentCalc.TypeKeys "<Down>" + DocumentCalc.TypeKeys "<Mod1 v>" + Wait( 500 ) + printlog( " copy" ) + DocumentCalc.TypeKeys "<Mod1 c>" + Wait( 500 ) + printlog( " paste" ) + DocumentCalc.TypeKeys "<Down>" + DocumentCalc.TypeKeys "<Mod1 v>" + Wait( 500 ) + case "DRAW" : Kontext "DocumentDraw" + hRechteckErstellen ( 30, 30, 60, 60 ) + gMouseClick ( 1, 1 ) + printlog( " cut" ) + DocumentDraw.TypeKeys sSelectAll + DocumentDraw.TypeKeys "<Mod1 x>" + Wait( 500 ) + printlog( " paste" ) + DocumentDraw.TypeKeys "<Mod1 v>" + Wait( 500 ) + printlog( " copy" ) + gMouseClick ( 1, 1 ) + DocumentDraw.TypeKeys sSelectAll + DocumentDraw.TypeKeys "<Mod1 c>" + Wait( 500 ) + printlog( " paste" ) + gMouseClick ( 1, 1 ) + DocumentDraw.TypeKeys "<Mod1 v>" + case "IMPRESS": Kontext "DocumentImpress" + hRechteckErstellen ( 30, 30, 60, 60 ) + gMouseClick ( 1, 1 ) + printlog( " cut" ) + DocumentImpress.TypeKeys sSelectAll + DocumentImpress.TypeKeys "<Mod1 x>" + Wait( 500 ) + printlog( " paste" ) + DocumentImpress.TypeKeys "<Mod1 v>" + Wait( 500 ) + printlog( " copy" ) + gMouseClick ( 1, 1 ) + DocumentImpress.TypeKeys sSelectAll + DocumentImpress.TypeKeys "<Mod1 c>" + Wait( 500 ) + printlog( " paste" ) + gMouseClick ( 1, 1 ) + DocumentImpress.TypeKeys "<Mod1 v>" + case "MATH" : SchreibenInMathdok "a over b" + printlog( " cut" ) + hUseAsyncSlot( "EditSelectAllMath" ) + hUseAsyncSlot( "EditCut" ) + printlog( " paste" ) + hUseAsyncSlot( "EditPaste" ) + printlog( " copy" ) + hUseAsyncSlot( "EditSelectAllMath" ) + hUseAsyncSlot( "EditCopy" ) + printlog( " paste" ) + hUseAsyncSlot( "EditPaste" ) + + end select +end sub + + + diff --git a/testautomation/framework/required/includes/window_functions.inc b/testautomation/framework/required/includes/window_functions.inc new file mode 100644 index 000000000000..2adb42638d02 --- /dev/null +++ b/testautomation/framework/required/includes/window_functions.inc @@ -0,0 +1,310 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Window/Titlebar functionality +'* +'\****************************************************************************** + +testcase tWindowFunctions + + printlog( "Update test for window functions" ) + + if ( gtSysName = "Mac OS X" ) then + printlog( "No testing for Mac as some Window attributes do not exist" ) + goto endsub + endif + + + 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 + qaerrorlog( "#i32672# 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 + + printlog( "Window titles for the applications: " & gProductName ) + + printlog( "Writer" ) + gApplication = "WRITER" + call tCheckWindowTitle( "swriter", "Writer" ) + + printlog( "Master Document" ) + gApplication = "MASTERDOCUMENT" + call tCheckWindowTitle( "sglobal", "Writer" ) + + printlog( "HTML" ) + gApplication = "HTML" + call tCheckWindowTitle( "sweb", "Writer/Web" ) + + printlog( "Spreadsheet" ) + gApplication = "CALC" + call tCheckWindowTitle( "scalc", "Calc" ) + + printlog( "Presentation" ) + gApplication = "IMPRESS" + call tCheckWindowTitle( "simpress", "Impress" ) + + printlog( "Drawing" ) + gApplication = "DRAW" + call tCheckWindowTitle( "sdraw", "Draw" ) + + printlog( "Formula" ) + gApplication = "MATH" + call tCheckWindowTitle( "smath", "Math" ) + + printlog( "BASIC IDE" ) + gApplication = "WRITER" + call tCheckWindowTitle( "basic", "Basic" ) + + printlog( "Database" ) + gApplication = "DATABASE" + call tCheckWindowTitle( "database", "Base" ) + + printlog( "Backing Window / StartCenter" ) + gApplication = "BACKGROUND" + call tCheckWindowTitle( "soffice", "" ) + +end sub + +'******************************************************************************* + +testcase tCheckWindowTitle( sApplication as string, sReference as string ) + + printlog( "Update test for the office window titles" ) + + const BASIC_MODULE = "tCheckWindowTitle" + const STRING_NOT_FOUND = 0 + const STRING_LEFTMOST = 1 + + dim cWindowCaption as string + + dim iProductnamePosition as integer + dim iApplicationPosition as integer + + dim cProductNameString as string + dim cApplicationString as string + + ' hGetWindowCaption modifies it's function parameter, so we pass a copy instead + ' This is a thing that justifies the use of a four letter word for sure. + dim sApplicationTemp as string : sApplicationTemp = sApplication + + printlog( "Application: " & sApplication & "; Title should be: " & sReference ) + printlog( "Open the work windows (documents)" ) + hInitSingleDoc() + hCreateDocument() + + printlog( "Verify that the correct window is open" ) + select case sApplication + case "swriter" : + case "sglobal" : + case "sweb" : + case "scalc" : + case "simpress": + case "sdraw" : + case "smath" : + case "basic" : hInitBasicIDE( BASIC_MODULE ) + case "chart" : + case "database": + case "soffice" : hFileCloseAll() + end select + + ' Note: The Testtool connection string does not belong to the window caption + ' so we do not check for it here. + cWindowCaption = hGetWindowCaption( sApplicationTemp ) + printlog( "Caption is: " & cWindowCaption ) + + ' This prevents accidential matches like "base" in a document name like "database8.odb" + ' And we have a - (minus) as delimiter between the document name and the product name + cProductnameString = " - " & gProductName & " " + cApplicationString = " " & sReference + + ' Find out where in the caption the substrings are + iProductNamePosition = instr( cWindowCaption, cProductnameString ) + iApplicationPosition = instr( cWindowCaption, cApplicationString ) + + ' Verify that the productname is contained within the string + if ( iProductNamePosition = STRING_NOT_FOUND ) then + if ( lcase( gPlatform ) = "osx" ) then + printlog( "The product name is missing" ) + ' life is different on that platform compared to testtool world + else + warnlog( "The product name is missing" ) + endif + endif + + ' Verify that the application name (e.g. "Writer") is contained in the string + ' The StartCenter should not have any application name + if ( sApplication = "soffice" ) then + if ( iApplicationPosition > STRING_NOT_FOUND ) then + printlog( "The StartCenter should not have an application name" ) + endif + else + if ( iApplicationPosition = STRING_NOT_FOUND ) then + warnlog( "The application name is missing" ) + endif + endif + + if ( sApplication = "soffice" ) then + printlog( "Backing window should exclusively show the product name" ) + else + ' If one of Productname or application is leftmost in the string, we have a + ' missing document identifier. This can be different things - the filename, + ' the module name (BASIC) etc. + if ( ( iApplicationPosition = STRING_LEFTMOST ) OR _ + iProductnamePosition = STRING_LEFTMOST ) then + warnlog( "Current document identifier missing (like e.g. <Unknown 1>)" ) + endif + + ' Verify that the order is correct: Product name first, the application + if ( iProductNamePosition >= iApplicationPosition ) then + warnlog( "The order of the strings is incorrect" ) + printlog( "Expected: <Product Name> <Application>" ) + endif + endif + + printlog( "Cleanup after test" ) + select case sApplication + case "swriter" : + case "sglobal" : + case "sweb" : + case "scalc" : + case "simpress": + case "sdraw" : + case "smath" : + case "basic" : hDestroyDocument() + case "chart" : + case "database": + case "soffice" : hCreateDocument() + end select + + printlog( "Close all open documents" ) + hFileCloseAll() + +endcase + diff --git a/testautomation/framework/required/includes/wizard_agenda.inc b/testautomation/framework/required/includes/wizard_agenda.inc new file mode 100755 index 000000000000..d320234fd40b --- /dev/null +++ b/testautomation/framework/required/includes/wizard_agenda.inc @@ -0,0 +1,103 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Update test for agenda wizard +'* +'\****************************************************************************** + +testcase tUpdtWizardAgenda + + printlog( "Resource test for the agenda wizard" ) + + dim iErr as integer + dim brc as boolean + + dim cTemplateName as string + dim cTemplatePath as string + + ' Build the filename we want to save the template as. + cTemplateName = "FWK-Testtool-Template-AgendaWizard.ott" + cTemplatePath = gOfficePath & "user\template\" & cTemplateName + cTemplatePath = convertpath( cTemplatePath ) + + hInitSingleDoc() + + FileAutopilotAgenda + kontext "AutopilotAgenda" + if ( AutopilotAgenda.exists( 2 ) ) then + + printlog( " * Page 1 : Page Design" ) + Kontext "AutopilotAgenda" + call DialogTest( AutopilotAgenda, 1 ) + PageDesignList.select( 3 ) + hClickButton( NextButton ) + + Kontext "AutopilotAgenda" + call DialogTest( AutopilotAgenda, 2 ) + hClickButton( NextButton ) + + Kontext "AutopilotAgenda" + call DialogTest( AutopilotAgenda, 3 ) + hClickButton( NextButton ) + + Kontext "AutopilotAgenda" + call DialogTest( AutopilotAgenda, 4 ) + hClickButton( NextButton ) + + Kontext "AutopilotAgenda" + call DialogTest( AutopilotAgenda, 5 ) + hClickButton( NextButton ) + + Kontext "AutopilotAgenda" + call DialogTest( AutopilotAgenda, 6 ) + + printlog( " * name the template for further usage" ) + hWaitForObject( TemplateName, 3000 ) + TemplateName.setText( cTemplateName ) + hSetTemplateSavePath( cTemplatePath ) + + hFinishWizard( 1 ) + + iErr = hHandleSaveError() + if ( iErr = 1 ) then + kontext "AutopilotAgenda" + hFinishWizard( 1 ) + endif + + brc = hDestroyDocument() + if ( not brc ) then qaerrorlog( "#i59233# The wizard does not display the new template" ) + + hFileCloseAll() + hDeleteFile( cTemplatePath ) + else + warnlog ( "The Agenda wizard did not open/timelimit exceeded" ) + endif + +endcase + diff --git a/testautomation/framework/required/includes/wizard_documentconverter.inc b/testautomation/framework/required/includes/wizard_documentconverter.inc new file mode 100644 index 000000000000..7ba81116728b --- /dev/null +++ b/testautomation/framework/required/includes/wizard_documentconverter.inc @@ -0,0 +1,153 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Update test for documentconverter +'* +'\****************************************************************************** + +testcase tUpdtWizardDocumentConverter + + printlog( "Resource test for the document converter" ) + + dim irc as integer + dim brc as boolean + dim iDialog as integer + dim iDocumentType as integer + dim iWait as integer + dim sSourcePathWriter as string + sSourcePathWriter = gTesttoolpath & "framework\required\input\document_converter\" + sSourcePathWriter = convertpath( sSourcePathWriter ) + dim sTargetFile as string + dim sLogFile as string + dim aFileList( 100 ) as string + dim iCurrentFile as integer + + hInitSingleDoc() + + irc = hOpenWizardWithMenu( "DOCCONV" ) + if ( irc <> 0 ) then + warnlog( "Unable to open requested wizard, aborting test" ) + goto endsub + endif + + sTargetFile = hGetWorkPath() + sLogFile = sTargetFile & "Logfile.odt" + + stargetFile = sTargetFile & "docconv1" & hGetSuffix( "current" ) + + + Kontext "DocumentConverter" + hWaitForObject( CreateLogfile, 3000 ) + CreateLogfile.check() + + Call DialogTest ( DocumentConverter ) + + spreadsheet.check() + textdoc.check() + drawing.check() + master.check() + + + ' as we selected all documenttypes, the settings page for each + ' documenttype has to pop up + for iDocumentType = 1 to 4 + + ContinueButton.click() + + Kontext "DocumentConverter" + if ( template.isVisible() ) then + printlog( "Page " & 1 + iDocumentType & " is visible" ) + else + warnlog( "Cannot access page 2, aborting test" ) + hFinishWizard() + goto endsub + endif + + for iDialog = 1 to 4 + + select case iDialog + case 1 : ImportFormTemplatesSearch.click() + case 2 : SaveToTemplatesSearch.Click() + case 3 : ImportFormDocumentSearch.Click() + case 4 : SaveToDocumentSearch.Click() + end select + + Kontext "OeffnenDLG" + Call Dialogtest (OeffnenDlg) + OeffnenDLG.Cancel() + + Kontext "DocumentConverter" + ImportFormDocument.setText( sSourcePathWriter ) + + next iDialog + + next iDocumentType + + Kontext "DocumentConverter" + ContinueButton.click() + + Kontext "DocumentConverter" + if ( summary.isVisible() ) then + printlog( "Page 6 is visible" ) + else + warnlog( "Page 6 - Summary Page is missing" ) + endif + + Kontext "DocumentConverter" + ContinueButton.click() + + Kontext "DocumentConverter" + printlog( "Page 7" ) + + qaerrorlog( "#i54265# Show Logfile button has no HID, using accelerator instead" ) + + iWait = 0 + do while ( DocumentConverter.exists() ) + try + ContinueButton.click() + catch + endcatch + Wait( 1 ) + iWait = iWait + 1 + if ( iWait = 20000 ) then + warnlog( "Document not converted within 20 seconds" ) + exit do + endif + loop + + if ( getDocumentCount <> 1 ) then + warnlog( "Exactly one - the conversion result document - should be open" ) + endif + + hDestroyDocument() + hDeleteFile( sTargetFile ) + hDeleteFile( sLogFile ) + +endcase + diff --git a/testautomation/framework/required/includes/wizard_euroconverter.inc b/testautomation/framework/required/includes/wizard_euroconverter.inc new file mode 100644 index 000000000000..dd439ea4a3bd --- /dev/null +++ b/testautomation/framework/required/includes/wizard_euroconverter.inc @@ -0,0 +1,132 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Update test for the Euroconverter +'* +'\****************************************************************************** + +testcase tUpdtWizardEuroconverter + + printlog( "Resource test for the euro-converter" ) + + dim irc as integer + dim iWait as integer + dim cMsg as string + + dim iKnownCurrencies as integer + const KNOWN_CURRENCIES = 16 + const TARGET_FILE = "barfly.ods" + + + dim cSourceDir as string + cSourceDir = gTesttoolPath & "framework\required\input" + cSourceDir = convertpath( cSourceDir ) + + dim cTargetDir as string + cTargetDir = hGetWorkPath() + + hInitSingleDoc() + + irc = hOpenWizardWithMenu( "EUROCONV" ) + if ( irc <> 0 ) then + warnlog( "Failed to open the Euroconverter, aborting test" ) + hDestroyDocument() + goto endsub + endif + + kontext "AutopilotEuroKonverter" + call DialogTest( AutopilotEuroKonverter , 1 ) + + Kontext "AutopilotEuroKonverter" + iKnownCurrencies = Waehrungen.getItemCount() + if ( iKnownCurrencies <> KNOWN_CURRENCIES ) then + warnlog( "The number of currencies in the currencies listbox is incorrect." ) + printlog( "Found...: " & iKnownCurrencies ) + printlog( "Expected: " & KNOWN_CURRENCIES ) + endif + + if ( not Verzeichnis.isChecked() ) then + warnlog( "Converting entire directories should be default" ) + Verzeichnis.Check() + endif + + kontext "AutopilotEuroKonverter" + QuelleSuchen.click() + + kontext "FilePicker" + EFFilename.setText( cSourceDir ) + PBSelect.click() + + kontext "AutopilotEuroKonverter" + ZielSuchen.click() + + kontext "FilePicker" + EFFilename.setText( cTargetDir ) + PBSelect.click() + WaitSlot() + + kontext "AutopilotEuroKonverter" + Waehrungen.Select(1) 'Setting to first entry of listbox + + Konvertieren.click() + + iWait = 0 + do while( not Konvertieren.isEnabled() ) + + iWait = iWait + 1 + printlog( "Waiting for document to get converted..." ) + + if ( iWait = 20000 ) then + warnlog( "Document(s) were not converted within 20 seconds, aborting" ) + exit do + endif + + ' If the target file already exists we get an overwrite warning + kontext "Active" + if ( Active.exists() ) then + cMsg = active.getText() + cMsg = hRemoveLineBreaks( cMsg ) + warnlog( "Unexpected message: " & cMsg ) + active.yes() + endif + + Wait( 1 ) + kontext "AutopilotEuroKonverter" + + loop + + kontext "AutopilotEuroKonverter" + call DialogTest( AutopilotEuroKonverter , 2 ) + + hFinishWizard( 1 ) + hDestroyDocument() + hDeleteFile( cTargetDir & TARGET_FILE ) + +endcase + diff --git a/testautomation/framework/required/includes/wizard_fax.inc b/testautomation/framework/required/includes/wizard_fax.inc new file mode 100755 index 000000000000..b970d8754c5d --- /dev/null +++ b/testautomation/framework/required/includes/wizard_fax.inc @@ -0,0 +1,96 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Update Test for Fax Wizard +'* +'\****************************************************************************** + +testcase tUpdtWizardFax + + printlog( "Resource test for the fax wizard" ) + + dim iErr as integer + dim brc as boolean + + dim cTemplateName as string + dim cTemplatePath as string + + ' Build the filename we want to save the template as. + cTemplateName = "FWK-testtool-faxtemplate.ott" + cTemplatePath = gOfficePath & "user\template\" & cTemplateName + cTemplatePath = convertpath( cTemplatePath ) + + FileAutopilotFax + + kontext "AutopilotFax" + if ( AutopilotFax.exists( 2 ) ) then + + kontext "AutopilotFax" + call DialogTest( AutopilotFax, 1 ) + hClickButton( NextButton ) + + kontext "AutopilotFax" + call DialogTest( AutopilotFax, 2 ) + hClickButton( NextButton ) + + kontext "AutopilotFax" + call DialogTest( AutopilotFax, 3 ) + hClickButton( NextButton ) + + kontext "AutopilotFax" + call DialogTest( AutopilotFax, 4 ) + hClickButton( NextButton ) + + kontext "AutopilotFax" + call DialogTest( AutopilotFax, 5 ) + + printlog( "Name the template for further usage" ) + TemplateName.setText( cTemplateName ) + + hSetTemplateSavePath( cTemplatePath ) + + hFinishWizard( 1 ) + + kontext "StandardBar" + hWaitForObject( Speichern, 5000 ) + + brc = hDestroyDocument() + if ( not brc ) then qaerrorlog( "#i59233# The wizard does not display the new template" ) + + printlog( "Delete the user-template: " & cTemplatePath ) + hDeleteFile( cTemplatePath ) + + else + warnlog( "Fax wizard did not open/exceeded timeout" ) + endif + + hFileCloseAll() + + +endcase diff --git a/testautomation/framework/required/includes/wizard_firsttime.inc b/testautomation/framework/required/includes/wizard_firsttime.inc new file mode 100755 index 000000000000..e057ba09d2e8 --- /dev/null +++ b/testautomation/framework/required/includes/wizard_firsttime.inc @@ -0,0 +1,233 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Updatetest for the first time wizard +'* +'\****************************************************************************** + +testcase tUpdtWizardFirsttime + + printlog( "Resource test for the first start wizard" ) + + dim iClick as integer + dim cFirstName as string + dim cLastName as string + dim cInitials as string + + cFirstName = "Tom" + cLastName = "Cat" + cInitials = "TC" + + dim cQuickstarterPath as string + cQuickStarterPath = gNetzOfficePath & "program\quickstart.exe" + + + hInitSingleDoc() + + printlog( "Open the Wizard" ) + FirstTimeWizard + + ' give the wizard a maximum of 2 seconds to open, it's a serve-url and + ' should open almost instantly + kontext "WelcomeDialog" + if ( WelcomeDialog.exists( 2 ) ) then + printlog( "The Wizard is open" ) + call dialogtest( WelcomeDialog ) + + printlog( "click 'next'") + NextBtn.click() + endif + + + + + + printlog( "Check the license page" ) + kontext "TabFirstStartLicense" + if ( TabFirstStartLicense.exists( 2 ) ) then + printlog( "License page is visible" ) + call dialogtest( TabFirstStartLicense ) + + + printlog( "scroll down (button!) the licensetext to enable the >>-button" ) + for iClick = 1 to 50 + + kontext "TabFirstStartLicense" + if ( ScrollDown.isEnabled( 1 ) ) then + ScrollDown.click() + else + kontext "WelcomeDialog" + if ( NextBtn.isEnabled() ) then + printlog( "Needed " & iClick & " clicks on 'scroll down' " ) + exit for + else + warnlog( "Both Scroll-button and Next-button are disabled" ) + goto endsub + endif + endif + next iClick + + sleep( 1 ) + + kontext "WelcomeDialog" + if ( WelcomeDialog.exists( 2 ) ) then + NextBtn.click() + else + warnlog( "Cannot access welcome dialog" ) + endif + endif + + + + printlog( "Handle Data-Migration page" ) + kontext "TabPersonalDataMigration" + if ( TabPersonalDataMigration.exists( 2 ) ) then + call dialogtest( TabPersonalDataMigration ) + printlog( "The data migration page is visible" ) + TransferPersonalData.uncheck() + kontext "WelcomeDialog" + NextBtn.click() + endif + + + + printlog( "The personal data page should show up" ) + Kontext "TabFirstStartUser" + if ( TabFirstStartUser.exists( 2 ) ) then + + call dialogtest( TabFirstStartUser ) + + Kontext "TabFirstStartUser" + printlog( "Enter lastname, name and initials" ) + FirstName.setText( cFirstname ) + LastName.setText( cLastName ) + Initials.setText( cInitials ) + + kontext "WelcomeDialog" + NextBtn.click() + else + warnlog( "Could not access TabFirstStartUser" ) + endif + + if (gAutoUpdate) then + kontext "TabFirstStartOnlineUpdate" + if ( TabFirstStartOnlineUpdate.exists( 2 ) ) then + call dialogtest( TabFirstStartOnlineUpdate ) + CheckForUpdates.unCheck() + kontext "WelcomeDialog" + NextBtn.click() + else + warnlog( "Online Update Page is missing" ) + endif + else + qaErrorlog( "Online Update Page is missing" ) + endif + + + Kontext "TabFirstStartRegistration" + if ( TabFirstStartRegistration.exists( 3 ) ) then + printlog( "Registration page visible." ) + else + qaerrorlog( "An additional page appears on rerun of wizard" ) + kontext "WelcomeDialog" + NextBtn.click() + endif + + printlog( "Registration page: " ) + Kontext "TabFirstStartRegistration" + if ( TabFirstStartRegistration.exists( 2 ) ) then + printlog( "Page is present." ) + call dialogtest( TabFirstStartRegistration ) + printlog( "Choose not to register" ) + DoNotWantRegister.check() + + printlog( "close the wizard" ) + kontext "WelcomeDialog" + WelcomeDialog.ok() + endif + + printlog( "Verify that the userdata made it to tools/options" ) + ToolsOptions + hToolsOptions( "StarOffice" , "UserData" ) + + if ( Vorname.getText() <> cFirstname ) then + warnlog( "First name is not transferred to Tools/options/userdata" ) + endif + + if ( ZuName.getText() <> cLastName ) then + warnlog( "Last name is not transferred to Tools/options/userdata" ) + endif + + if ( Kuerzel.getText() <> cInitials ) then + warnlog( "Initials are not transferred to Tools/options/userdata" ) + endif + + hToolsOptions( "StarOffice", "Memory" ) + + if ( LoadQuickstarter.exists() ) then + if ( LoadQuickstarter.isEnabled() ) then + printlog( "Quickstarter checkbox is enabled" ) + if ( LoadQuickstarter.isChecked() ) then + printlog( "Quickstart is activated, turning it off." ) + LoadQuickstarter.unCheck() + printlog( "Closing Tools/Options" ) + Kontext "OptionenDlg" + OptionenDlg.cancel() + printlog( "Restarting program" ) + call ExitRestartTheOffice() + else + printlog( "Quickstarter is not turned on." ) + endif + else + printlog( "Quickstarter checkbox is not enabled for this system" ) + endif + else + if ( gPlatGroup <> "unx" ) then + if ( dir( cQuickStarterPath ) <> "" ) then + warnlog( "Quickstarter checkbox is missing on options page" ) + else + printlog( "Quickstarter is not installed/no checkbox present" ) + endif + endif + endif + + Kontext "OptionenDlg" + if ( OptionenDlg.exists() ) then + OptionenDlg.cancel() + endif + + ' due to issue i105248 the Quickstart disabler needs to get called again, because the First Start Wizard resets the veto + call hDisableQuickstarterAPI() + + do while( getDocumentCount() > 0 ) + call hCloseDocument() + loop + +endcase + diff --git a/testautomation/framework/required/includes/wizard_letter.inc b/testautomation/framework/required/includes/wizard_letter.inc new file mode 100755 index 000000000000..267efcefd18a --- /dev/null +++ b/testautomation/framework/required/includes/wizard_letter.inc @@ -0,0 +1,197 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Update Test for Letter Wizard +'* +'\****************************************************************************** + +testcase tUpdtWizardLetter + + printlog( "Resource test for the letter-wizard" ) + + dim iErr as integer + dim brc as boolean + dim irc as integer + + ' Build the filename we want to save the template as. + dim cTemplateName as string + cTemplateName = "FWK-Testtool-Template-letterWizard.ott" + + dim cTemplatePath as string + cTemplatePath = gOfficePath & "user\template\" & cTemplateName + cTemplatePath = convertpath( cTemplatePath ) + + hDeleteUserTemplates() + + hInitSingleDoc() + + FileAutopilotLetter + kontext "AutopilotLetter" + if ( AutopilotLetter.exists( 2 ) ) then + + if ( not autopilotletter.exists( 3 ) ) then + warnlog( "#i87733# Wizard does not start" ) + hCloseDocument() + goto endsub + endif + + printlog( " * Page: Page Design" ) + call DialogTest( AutopilotLetter, 1 ) + + printlog( " * select a business letter" ) + Business.check() + WaitSlot() + + kontext "active" + if ( active.exists( 1 ) ) then + warnlog( " * refusing to change the default template" ) + active.cancel() + endif + WaitSlot( 2000 ) + + kontext "Autopilotletter" + BusinessStyle.select( 2 ) + WaitSlot( 2000 ) + + kontext "active" + if ( active.exists( 1 ) ) then + warnlog( " * refusing to change the default template" ) + active.cancel() + endif + WaitSlot( 3000 ) + + kontext "AutopilotLetter" + LetterHead.Check() + + hClickButton( NextButton ) + + kontext "AutopilotLetter" + call DialogTest( AutopilotLetter, 2 ) + + printlog( " * check to add logo" ) + Logo.check() + + printlog( " * change the metrics of the logo" ) + LogoHeight.settext( "4" ) + LogoWidth.settext( "4" ) + LogoXpos.settext( "1" ) + LogoYpos.settext( "1" ) + + printlog( " * check to add own address" ) + ReturnAddress.check() + + printlog( " * change the metrics of the address-field" ) + AddressHeight.settext( "4" ) + AddressWidth.settext( "4" ) + AddressXpos.settext( "1" ) + AddressYpos.settext( "1" ) + + printlog( " * check to show return-address in envelope window" ) + ReturnAddressCompany.check() + + printlog( " * UNcheck to add a footer" ) + IncludeFooter.unCheck() + + printlog( " * change the height" ) + if ( FooterHeight.isEnabled() ) then + warnlog( "FooterHeight should not be enabled in this configuration" ) + endif + + hClickButton( NextButton ) + + kontext "AutopilotLetter" + call DialogTest( AutopilotLetter, 3 ) + + printlog( " * change letterformat to the second entry" ) + LetterPageNorm.select( 2 ) + + printlog( " * change salutation to the second entry" ) + ListSalutation.select( 2 ) + + printlog( " * change Complimentary Close to second entry" ) + ListGreetings.select( 2 ) + hClickButton( NextButton ) + + kontext "AutopilotLetter" + call DialogTest( AutopilotLetter, 4 ) + hClickButton( NextButton ) + + kontext "AutopilotLetter" + call DialogTest( AutopilotLetter, 5 ) + + printlog( " * enter some text as footer" ) + TextFooter.settext( "Some non-offending text" ) + + printlog( " * check Include only on second ..." ) + IncludeFromPage2.check() + hClickButton( NextButton ) + + kontext "AutopilotLetter" + call DialogTest( AutopilotLetter, 6 ) + + printlog( " * name the template for further usage" ) + TemplateName.setText( cTemplateName ) + hSetTemplateSavePath( cTemplatePath ) + + hFinishWizard( 1 ) + + if ( gOOo ) then + kontext "UseOfThisTemplate" + if ( UseOfThisTemplate.exists( 2 ) ) then + printlog( "cancelling UseOfThisTemplate-dialog for OOo" ) + UseOfThisTemplate.cancel() + else + qaerrorlog( "UseOfThisTemplate-dialog not present" ) + endif + endif + + iErr = hHandleSaveError() + if ( iErr = 1 ) then + kontext "AutopilotLetter" + hFinishWizard( 1 ) + endif + + brc = hDestroyDocument() + if ( not brc ) then qaerrorlog( "#i59233# The wizard does not display the new template" ) + else + warnlog( "Autopilot Letter not open/exceeded timeout" ) + endif + + hDeleteFile( cTemplatePath ) + + irc = hDeleteUserTemplates() + if ( irc <> 0 ) then + printlog( "Unexpectedly deleted user template(s), please check") + endif + + hFileCloseAll() + +endcase + + diff --git a/testautomation/framework/required/includes/wizard_mailmerge.inc b/testautomation/framework/required/includes/wizard_mailmerge.inc new file mode 100755 index 000000000000..45b8947eec38 --- /dev/null +++ b/testautomation/framework/required/includes/wizard_mailmerge.inc @@ -0,0 +1,1211 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* 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() + + + const CFN = "hUpdtMMWpage3::" + + dim cDatabase as string + cDatabase = gTesttoolpath & "framework\required\input\mailmerge_data.odb" + cDatabase = convertpath( cDatabase ) + + Kontext "TabMailMergeAddressBlock" + if ( not TabMailMergeAddressBlock.exists( 2 ) ) then + warnlog( CFN & "Page 3 could not be accessed" ) + exit function + endif + + call Dialogtest( TabMailMergeAddressBlock ) + + Kontext "TabMailMergeAddressBlock" + hSelectDifferentAddressList( cDatabase ) + + Kontext "TabMailMergeAddressBlock" + if ( AddressBlock.exists( 2 ) ) then + + + if( not AddressBlock.isChecked() ) then + warnlog( CFN & "AddressBlock Checkbox not checked" ) + AddressBlock.check() + endif + + hSelectAddressBlock() + + hUpdtMailmergeMatchFields() + else + warnlog( CFN & "AddressBlock-Checkbox missing, skipping dialogs" ) + endif + + +end function + +'******************************************************************************* + +function hUpdtMMWpage4() + + + const CFN = "hUpdtMMWpage4::" + dim brc as boolean + + brc = false + + Kontext "TabMailMergeGreetingsPage" + if ( not TabMailMergeGreetingsPage.exists( 2 ) ) then + warnlog( CFN & "Page 4 could not be accessed" ) + exit function + endif + + call dialogtest( TabMailMergeGreetingsPage ) + + ' the salutation checkbox must be checked, otherwise the buttons are not + ' available + if ( not GreetingPersonalized.isEnabled() ) then + warnlog( CFN & "CheckBox Salutation not in HID.LST, it should be checked" ) + exit function + endif + + Kontext "TabMailMergeGreetingsPage" + printlog( CFN & "GreetingButtonFemale" ) + if ( GreetingButtonFemale.isEnabled() ) then + hNewEditAddressBlock( 3 ) + else + warnlog( CFN & "GreetingButtonFemale is not enabled" ) + endif + + Kontext "TabMailMergeGreetingsPage" + printlog( CFN & "GreetingButtonMale" ) + if ( GreetingButtonMale.isEnabled() ) then + hNewEditAddressBlock( 4 ) + else + warnlog( CFN & "GreetingButtonMale is not enabled" ) + endif + + Kontext "TabMailMergeGreetingsPage" + +end function + + +'************************************************************************** + +function hUpdtMMWpage5() + + + const CFN = "hUpdtMMWpage5::" + + kontext "TabMailMergeLayoutPage" + if ( not TabMailMergeLayoutPage.exists( 2 ) ) then + warnlog( CFN & "Page 5 could not be accessed" ) + exit function + endif + + call DialogTest( TabMailMergeLayoutPage ) + + printlog( CFN ) + +end function + +'************************************************************************** + +function hUpdtMMWpage6() + + + const CFN = "hUpdtMMWpage6::" + + printlog( CFN ) + + kontext "TabMailMergePrepare" + if ( not TabMailMergePrepare.exists( 2 ) ) then + warnlog( CFN & "Page 6 could not be accessed" ) + exit function + endif + + call DialogTest( TabMailMergePrepare ) + + qaerrorlog( "Skipping preview button" ) + +end function + +'************************************************************************** + +function hUpdtMMWpage7() + + + const CFN = "hUpdtMMWpage7::" + + printlog( CFN ) + + kontext "TabMailMergePersonalize" + hWaitForObject( EditIndividualButton, 8000 ) + 'if ( not TabMailMergePersonalize.exists( 2 ) ) then + ' warnlog( CFN & "Page 7 could not be accessed" ) + ' exit function + 'endif + + call DialogTest( TabMailMergePersonalize ) + + qaerrorlog( "Skipping Preview-Button" ) + +end function + +'************************************************************************** + +function hUpdtMMWpage8() + + + const CFN = "hUpdtMMWpage8::" + + kontext "TabMailMergeOutputPage" + if ( not TabMailMergeOutputPage.exists( 2 ) ) then + warnlog( CFN & "Page 8 could not be accessed" ) + exit function + endif + + printlog( CFN ) + + call DialogTest( TabMailMergeOutputPage ) + + kontext "TabMailMergeOutputPage" + hSaveStartingDocument() + + kontext "TabMailMergeOutputPage" + hSaveMailMergeDocument() + + kontext "TabMailMergeOutputPage" + hPrintMailMergeDocument() + + kontext "TabMailMergeOutputPage" + hSendMailMergeDocument() + +end function + +'******************************************************************************* + +function hSelectDifferentAddressList( cDatabase as string ) as boolean + + + const CFN = "hSelectDifferentAddressList::" + + dim brc as boolean + + dim iAddressList as integer + dim cAddressList as string + + Kontext "TabMailMergeAddressBlock" + SelectAddressListButton.click() + + Kontext "SelectAddressList" + if ( SelectAddressList.exists( 2 ) ) then + printlog( CFN & "Select Address List Dialog" ) + call dialogtest( SelectAddressList ) + else + warnlog( CFN & "SelectAddressList dialog is not open" ) + hSelectDifferentAddressList() = false + exit function + endif + + Kontext "SelectAddressList" + brc = hAddDatabase( cDatabase ) + + + Kontext "SelectAddressList" + if ( SelectAddressList.exists( 2 ) ) then + if ( AddressList.getItemCount() < 2 ) then + brc = hAddDatabase( cDatabase ) + endif + + Kontext "SelectAddressList" + brc = hEditCreateAddressList( 1 ) + + Kontext "SelectAddressList" + brc = hFilterDialog() + + Kontext "SelectAddressList" + brc = hEditCreateAddressList( 2 ) + + Kontext "SelectAddressList" + for iAddressList = 1 to AddressList.getItemCount() + + AddressList.select( iAddressList ) + cAddressList = AddressList.getText() + printlog( CFN & "Current address list: " & cAddressList ) + + try + SelectAddressList.ok() + brc = true + exit for + catch + qaerrorlog( CFN & "Ok-Button disabled for <" & cAddressList & ">" ) + brc = false + endcatch + + next iAddressList + + if ( not brc ) then + warnlog( "#i84250# OK button not enabled for any address list." ) + endif + else + warnlog( CFN & "Select Address List dialog is not open" ) + brc = false + endif + + + + Kontext "TabMailMergeAddressBlock" + hSelectDifferentAddressList() = brc + +end function + +'******************************************************************************* + +function hWaitForBackToWizardFloat() as boolean + + + const CFN = "hWaitForBackToWizardFloat::" + dim brc as boolean + + printlog( CFN & "Enter" ) + + Kontext "MailMergeFloat" + if ( MailMergeFloat.exists( 20 ) ) then + printlog( CFN & "Back to document float is open" ) + ReturnToMailMergeWizard.click() + + Kontext "MailMergeWizard" + if ( MailMergeWizard.exists( 5 ) ) then + printlog( CFN & "Successfully returned to Mail Merge Wizard" ) + brc = true + else + warnlog( CFN & "Could not return to Mail Merge Wizard" ) + brc = false + endif + else + warnlog( CFN & "Unable to access Mail Merge Float" ) + brc = false + endif + + printlog( CFN & "Exit with result = " & brc ) + hWaitForBackToWizardFloat() = brc + +end function + +'******************************************************************************* + +function hAddDatabase( cDatabase as string ) as boolean + + + const CFN = "hAddDatabase::" + + dim brc as boolean + brc = false + + dim iWait as integer + + add.click() + + Kontext "OeffnenDlg" + if ( OeffnenDlg.exists( 2 ) ) then + printlog( CFN & "File Open Dialog" ) + DateiName.setText( cDatabase ) + Oeffnen.click() + brc = true + else + warnlog( CFN & "FileOpen is missing" ) + endif + + ' When a new addressdatabase is imported it might take some time before we + ' get back to the SelectAddressList dialog + hWaitForSelectAddressListDialog() + + hAddDatabase() = brc + +end function + +'****************************************************************************** + +function hEditCreateAddressList( iMode as integer ) as boolean + + const CFN = "hEditCreateAddressList::" + + dim brc as boolean + brc = false + + dim iWait as integer + + Kontext "SelectAddressList" + select case iMode + case 1 : create.click() + case 2 : edit.click() + end select + + Kontext "NewAddressList" + if ( NewAddressList.exists( 2 ) ) then + printlog( CFN & "New/Edit Address List Dialog is open" ) + call dialogtest( NewAddressList ) + brc = true + else + warnlog( CFN & "New/EditAddressList does not exist" ) + endif + + if ( not brc ) then + hEditCreateAddressList() = brc + exit function + endif + + + ' Try to use the Find-dialog, do not evaluate the returncode, + ' the test should continue even if the dialog does not come up. + brc = hFindDialog() + + ' Try to use the Customize-dialog, don't evaluate the rc either + brc = hCustomizeAddressList() + + ' Return to "NewAddressList" + Kontext "NewAddressList" + NewAddressList.ok() + + ' only save when a new list has been created, editing saves automatically + if ( iMode = 1 ) then + hSaveNewAddressList() + endif + + hWaitForSelectAddressListDialog() + + Kontext "SelectAddressList" + hEditCreateAddressList() = brc + +end function + +'******************************************************************************* + +function hFindDialog() as boolean + + + const CFN = "hFindDialog::" + + dim brc as boolean + brc = false + + printlog( CFN ) + + Kontext "NewAddressList" + find.click() + + kontext "FindEntry" + if ( FindEntry.exists( 2 ) ) then + call dialogtest( FindEntry ) + printlog( CFN & "Find Entry Dialog is open" ) + FindEntry.cancel() + brc = true + else + warnlog( CFN & "Dialog is not open" ) + endif + + Kontext "NewAddressList" + hFindDialog() = brc + +end function + +'****************************************************************************** + +function hCustomizeAddressList() as boolean + + + + const CFN = "hCustomizeAddressList::" + + dim brc as boolean + brc = false + + printlog( CFN ) + + Kontext "NewAddressList" + if ( Customize.exists( 2 ) ) then + if ( Customize.isEnabled() ) then + Customize.click() + + kontext "CustomizeAddressList" + if ( CustomizeAddressList.exists( 2 ) ) then + printlog( CFN & "Customize Address List Dialog" ) + call dialogtest( CustomizeAddressList ) + + kontext "CustomizeAddressList" + hAddRenameElement( "NewElement" , 1 ) + + kontext "CustomizeAddressList" + hAddRenameElement( "Renamed" , 2 ) + + kontext "CustomizeAddressList" + printlog( CFN & "Delete" ) + delete.click() + + kontext "CustomizeAddressList" + CustomizeAddressList.cancel() + brc = true + else + warnlog( CFN & "Dialog is not open" ) + endif + else + warnlog( CFN & "Button is not enabled" ) + endif + else + warnlog( CFN & "Button does not exist" ) + endif + + Kontext "NewAddressList" + hCustomizeAddressList() = brc + +end function + +'************************************************************************************ + +function hAddRenameElement( cElementName as string , iMode as integer ) as boolean + + const CFN = "hAddRenameElement::" + dim brc as boolean + brc = false + + select case iMode + case 1 : Add.click() + case 2 : Rename.click() + end select + + Kontext "RenameElement" + if ( RenameElement.exists( 2 ) ) then + printlog( CFN & "Add/Rename Element Dialog" ) + call Dialogtest( RenameElement ) + + FieldTitle.setText( cElementName ) + RenameElement.ok() + brc = true + else + warnlog( CFN & "Dialog is not open" ) + endif + + hAddRenameElement() = brc + +end function + +'******************************************************************************* + +function hFilterDialog() as integer + + + const CFN = "hFilterDialog::" + + dim brc as boolean + brc = false + + Kontext "SelectAddressList" + if ( Filter.exists( 2 ) ) then + if ( Filter.isEnabled() ) then + Filter.click() + + kontext "FilterDialog" + if ( FilterDialog.exists( 2 ) ) then + printlog( CFN & "Filter Dialog" ) + call Dialogtest( FilterDialog ) + + FilterDialog.cancel() + brc = true + else + warnlog( "#i54150 " & CFN & "Filter dialog is not open" ) + endif + else + warnlog( CFN & "Filter Button is not enabled" ) + endif + else + warnlog( CFN & "Filter Button is missing" ) + endif + + hWaitForSelectAddressListDialog() + hFilterDialog() = brc + +end function + +'**************************************************************************** + +function hSelectAddressBlock() as boolean + + const CFN = "hSelectAddressBlock::" + + dim brc as boolean + brc = false + + printlog( CFN & "More..." ) + + Kontext "TabMailMergeAddressBlock" + if ( more.exists( 2 ) ) then + + ' A dynamic delay (function borrowed from toolbar_tools.inc) + hWaitForObject( more , 3000 ) + + if ( more.isEnabled() ) then + more.click() + + Kontext "SelectAddressBlock" + if ( SelectAddressBlock.exists( 2 ) ) then + printlog( CFN & "SelectAddressBlock dialog is open" ) + call DialogTest( SelectAddressBlock ) + + Kontext "SelectAddressBlock" + hNewEditAddressBlock( 1 ) + + Kontext "SelectAddressBlock" + hNewEditAddressBlock( 2 ) + + Kontext "SelectAddressBlock" + SelectAddressBlock.ok() + brc = true + else + warnlog( CFN & "Dialog is not open" ) + endif + else + warnlog( CFN & "Button is disabled" ) + endif + else + warnlog( CFN & "Button does not exist" ) + endif + + hSelectAddressBlock() = brc + +end function + +'******************************************************************************* + +function hNewEditAddressBlock( iMode as integer ) as boolean + + const CFN = "hNewEditAddressBlock::" + + select case iMode + case 1 : NewBtn.click() + case 2 : Customize.click() + case 3 : GreetingButtonFemale.click() + case 4 : GreetingButtonMale.click() + end select + + Kontext "NewAddressBlock" + if ( NewAddressBlock.exists( 2 ) ) then + printlog( cfn & "Dialog is open" ) + NewAddressBlock.cancel() + hNewEditAddressBlock() = true + else + warnlog( cfn & "Dialog is not open" ) + hNewEditAddressBlock() = false + endif + +end function + +'******************************************************************************* + +function hSaveStartingDocument() as boolean + + const CFN = "hSaveStartingDocument::" + + dim brc as boolean + brc = false + + if ( RBSaveStartDoc.exists( 2 ) ) then + if ( RBSaveStartDoc.isEnabled ) then + RBSaveStartDoc.check() + brc = true + else + warnlog( CFN & "Cannot set radiobutton" ) + endif + else + warnlog( CFN & "Radiobutton is missing" ) + endif + + ' save file + if ( PBSaveStartDoc.exists( 2 ) ) then + if ( PBSaveStartDoc.isEnabled ) then + PBSaveStartDoc.click() + + Kontext "SpeichernDlg" + if ( SpeichernDlg.exists( 2 ) ) then + printlog( CFN & "Save As Dialog is open" ) + SpeichernDlg.cancel() + brc = true + else + warnlog( CFN & "FileSave dialog is missing" ) + endif + else + warnlog( CFN & "SaveStartDoc is disabled" ) + endif + else + warnlog( CFN & "SaveStartDoc is missing" ) + endif + + hSaveStartingDocument() = brc + +end function + +'******************************************************************************* + +function hSaveMailMergeDocument() as boolean + + const CFN = "hSaveMailMergeDocument::" + + dim brc as boolean + brc = false + + if ( RBSaveMergedDoc.exists( 2 ) ) then + if ( RBSaveMergedDoc.isEnabled() ) then + RBSaveMergedDoc.check() + brc = true + else + warnlog( CFN & "Cannot set radiobutton" ) + endif + else + warnlog( CFN & "Radiobutton is missing" ) + endif + + ' save file + if ( PBSaveNow.exists( 2 ) ) then + if ( PBSaveNow.isEnabled() ) then + PBSaveNow.click() + + Kontext "SpeichernDlg" + if ( SpeichernDlg.exists( 2 ) ) then + printlog( CFN & "Save As Dialog is open" ) + SpeichernDlg.cancel() + brc = true + else + warnlog( CFN & "FileSave dialog is missing" ) + endif + else + warnlog( CFN & "Save Now is disabled" ) + endif + else + warnlog( CFN & "Save Now is missing" ) + endif + + hSaveMailMergeDocument() = brc + +end function + +'******************************************************************************* + +function hPrintMailMergeDocument() as boolean + + const CFN = "hPrintMailMergeDocument::" + + dim brc as boolean + brc = false + + if ( RBPrintMerged.exists( 2 ) ) then + if ( RBPrintMerged.isEnabled() ) then + RBPrintMerged.check() + brc = true + else + warnlog( CFN & "Cannot set radiobutton" ) + endif + else + warnlog( CFN & "Radiobutton is missing" ) + endif + + if ( instr( gtSYSName , "win" ) > 0 ) then + printlog( CFN & "Skipping printer dialog on windows" ) + hPrintMailMergeDocument() = true + exit function + endif + + if ( lcase( gPlatform ) = "osx" ) then + qaerrorlog( "#i81545# No printer settings on MacOS X" ) + hPrintMailMergeDocument() = true + exit function + endif + + ' printer settings + if ( PBPrinterSettings.exists( 2 ) ) then + if ( PBPrinterSettings.isEnabled() ) then + PBPrinterSettings.click() + + Kontext "TabSPAPaper" + if ( TabSPAPaper.exists() ) then + printlog( CFN & "Printer Settings Dialog" ) + TabSPAPaper.OK + brc = true + else + warnlog( "#i89114# Printer Settings dialog is missing" ) + endif + else + warnlog( CFN & "Printer Settings is disabled" ) + endif + else + warnlog( CFN & "Printer Settings is missing" ) + endif + + hPrintMailMergeDocument() = brc + +end function + +'******************************************************************************* + +function hSendMailMergeDocument() as boolean + + const CFN = "hSendMailMergeDocument::" + + dim brc as boolean + brc = false + + if ( RBSendAsMail.exists( 2 ) ) then + if ( RBSendAsMail.isEnabled() ) then + RBSendAsMail.check() + else + warnlog( CFN & "Cannot set radiobutton" ) + endif + else + warnlog( CFN & "Radiobutton is missing" ) + endif + + ' send copy to + if ( PBCopyTo.exists( 2 ) ) then + if ( PBCopyTo.isEnabled() ) then + PBCopyTo.click() + + Kontext "CopyToDialog" + if ( CopyToDialog.exists( 2 ) ) then + printlog( CFN & "CopyToDialog is open" ) + call DialogTest( CopyToDialog ) + CopyToDialog.OK() + else + warnlog( CFN & "CopyToDialog dialog is missing" ) + endif + else + warnlog( CFN & "PBCopyTo is disabled" ) + endif + else + warnlog( CFN & "PBCopyTo is missing" ) + endif + + kontext "TabMailMergeOutputPage" + if ( PBSendDocuments.exists( 2 ) ) then + if ( PBSendDocuments.isEnabled() ) then + PBSendDocuments.click() + Kontext "Active" + if ( active.exists( 2 ) ) then + printlog( CFN & "Dialog asking for EMail-account is open" ) + call Dialogtest( active ) + active.yes() + + kontext "TabMailMergeEmail" + hMailMergeEmailDialog() + else + warnlog( CFN & "Dialog asking for EMail-account is missing" ) + endif + else + warnlog( CFN & "Send documents Button is disabled" ) + endif + else + warnlog( CFN & "Send Documents Button is missing" ) + endif + + hSendMailMergeDocument() = brc + +end function + +'******************************************************************************* + +function hMailMergeEmailDialog() as boolean + + const CFN = "hMailMergeEmailDialog::" + dim brc as boolean + brc = false + + if ( TabMailMergeEmail.exists( 2 ) ) then + printlog( CFN & "EMail Account Dialog is open" ) + brc = true + else + warnlog( CFN & "EMail Account Dialog is not open" ) + exit function + endif + + ' server authentication + if ( ServerAuthentication.exists( 2 ) ) then + if ( ServerAuthentication.isEnabled() ) then + ServerAuthentication.click() + + Kontext "ServerAuthentication" + if ( ServerAuthentication.exists( 2 ) ) then + printlog( CFN & "Server Authentication dialog is open" ) + call DialogTest( ServerAuthentication ) + ServerAuthentication.cancel() + else + warnlog( CFN & "ServerAuthentication is not open" ) + endif + else + warnlog( CFN & "ServerAuthentication-Button is not enabled" ) + endif + else + warnlog( CFN & "ServerAuthentication-Button does not exist" ) + brc = false + endif + + ' Test settings + kontext "TabMailMergeEmail" + if ( TestSettings.exists( 2 ) ) then + if ( TestSettings.isEnabled() ) then + TestSettings.click() + + kontext "TestAccountSettings" + if ( TestAccountSettings.exists( 2 ) ) then + printlog( CFN & "Test Account Settings Dialog is open" ) + call DialogTest( TestAccountSettings ) + TestAccountSettings.cancel() + else + warnlog( CFN & "Test Account Settings Dialog is not open" ) + endif + else + warnlog( CFN & "Test Settings-button is disabled" ) + endif + else + warnlog( CFN & "Test Settings-button is missing" ) + endif + + kontext "TabMailMergeEmail" + TabMailMergeEmail.cancel() + + hMailMergeEmailDialog() = brc + +end function + +'******************************************************************************* + +function hWaitForSelectAddressListDialog() as boolean + + Kontext "SelectAddressList" + if ( SelectAddressList.exists( 5 ) ) then + hWaitForSelectAddressListDialog() = true + else + hWaitForSelectAddressListDialog() = false + endif + + +end function + +'******************************************************************************* + +function hSaveNewAddressList() + + const CFN = "hSaveNewAddressList::" + + Kontext "SpeichernDlg" + if ( SpeichernDlg.exists( 2 ) ) then + + DateiName.setText( CSV_DATABASE ) + Speichern.click() + + kontext "active" + if ( active.exists( 2 ) ) then + warnlog( active.getText() ) + active.yes() + endif + + printlog( CFN & "File saved" ) + else + warnlog( CFN & "FileSave did not come up" ) + endif + +end function + +'******************************************************************************* + +function hRemoveDatabaseConnections() as integer + + const CFN = "hRemoveDatabaseConnections()::" + const DEFAULT_DATABASE = "Bibliography" + + dim iConnectionCount as integer + dim iCurrentConnection as integer + dim cConnectionName as string + dim bOptionsOpen as boolean : bOptionsOpen = true + + kontext "OptionenDlg" + if ( not OptionenDlg.exists() ) then + bOptionsOpen = false + ToolsOptions + endif + + hToolsOptions( "DataSources", "Databases" ) + + kontext "TabRegisteredDatabase" + iConnectionCount = RegisteredDatabases.getItemCount() + + for iCurrentConnection = iConnectionCount to 1 step -1 + + kontext "TabRegisteredDatabase" + if ( TabRegisteredDatabase.exists( 2 ) ) then + + RegisteredDatabases.select( iCurrentConnection ) + cConnectionName = RegisteredDatabases.getSelText() + printlog( CFN & "Current database: " & cConnectionName ) + + if ( cConnectionName <> DEFAULT_DATABASE ) then + DeleteBtn.click() + kontext "active" + if ( active.exists( 2 ) ) then + active.yes() + else + warnlog( CFN & "Confirmation dialog for delete is missing" ) + endif + else + printlog( CFN & "Not deleting default database connection" ) + endif + else + warnlog( CFN & "Failed to set context to Registered Databases Tab" ) + endif + + next iCurrentConnection + + if ( not bOptionsOpen ) then + kontext "OptionenDlg" + OptionenDlg.ok() + endif + + hRemoveDatabaseConnections() = iConnectionCount - 1 + +end function + +'******************************************************************************* + +function hUpdtMailmergeMatchFields() as boolean + + + const CFN = "hUpdtMailmergeMatchFields::" + dim brc as boolean + + printlog( CFN & "Accessing Match Fields Dialog" ) + Kontext "TabMailMergeAddressBlock" + MatchFieldsButton.click() + + kontext "MatchFields" + if ( not MatchFields.exists( 2 ) ) then + warnlog( CFN & "Unable to access Match Fields dialog" ) + brc = false + else + + Title.select( 2 ) + FirstName.select( 3 ) + LastName.select( 4 ) + Company.select( 5 ) + Address1.select( 6 ) + Address2.select( 7 ) + City.select( 8 ) + State.select( 2 ) + ZIP.select( 3 ) + Country.select( 4 ) + PhonePrivate.select( 1 ) + PhoneBusiness.select( 2 ) + EMail.select( 5 ) + Gender.select( 4 ) + + MatchFields.OK() + printlog( CFN & "Leaving Match Fields Dialog" ) + brc = true + + endif + + hUpdtMailmergeMatchFields() = brc + +end function + + diff --git a/testautomation/framework/required/includes/wizard_presentation.inc b/testautomation/framework/required/includes/wizard_presentation.inc new file mode 100755 index 000000000000..59544e0fb48e --- /dev/null +++ b/testautomation/framework/required/includes/wizard_presentation.inc @@ -0,0 +1,71 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Update test for the presentation wizard +'* +'\****************************************************************************** + +testcase tUpdtWizardPresentation + + printlog( "Resource test for the presentation wizard" ) + + dim irc as integer + dim brc as boolean + + hInitSingleDoc() + + FileAutopilotPresentation + kontext "AutopilotPraesentation1" + if ( AutopilotPraesentation1.exists( 2 ) ) then + + + printlog( "Page 1" ) + call Dialogtest( AutopilotPraesentation1 ) + hClickButton( NextButton ) + + printlog( "Page 2" ) + kontext "AutopilotPraesentation2" + call DialogTest( AutopilotPraesentation2 ) + hClickButton( NextButton ) + + printlog( "Page 3" ) + kontext "AutopilotPraesentation3" + call DialogTest( AutopilotPraesentation3 ) + + hFinishWizard( 1 ) + else + warnlog( "Presentation wizard not open/exceeded timeout" ) + endif + + hFileCloseAll() + + gApplication = "WRITER" + +endcase + diff --git a/testautomation/framework/required/includes/wizard_webpage.inc b/testautomation/framework/required/includes/wizard_webpage.inc new file mode 100644 index 000000000000..6200079c8025 --- /dev/null +++ b/testautomation/framework/required/includes/wizard_webpage.inc @@ -0,0 +1,212 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : Resource test of Web Page Wizard +'* +'\************************************************************************ + +testcase tUpdtWizardWebpage + + printlog( "Resource test for the webpage wizard" ) + + dim i as integer + dim a as integer + a = getDocumentCount + FileWizardsWebPage + + Kontext "WebWizard" + if WebWizard.exists(20) then + + printlog " 1. Introduction" + Call DialogTest (WebWizard,1) + IntroductionChooseSettings.getItemCount + IntroductionChooseSettings.getSelText + NextButton.click + + printlog " 2. Documents" + Call DialogTest (WebWizard,2) + DocumentsAdd.click + + Kontext "OeffnenDlg" + if OeffnenDlg.exists(5) then + Dateiname.setText ConvertPath ( gTesttoolPath + "global\input\graf_inp\borabora.jpg" + Oeffnen.click + else + warnlog "File Dialog didn't came up" + endif + WaitSlot( 5000 ) + + Kontext "WebWizard" + DocumentsWebSiteContent.getSelText + DocumentsWebSiteContent.getItemcount + DocumentsExportFileFormat.getItemCount + DocumentsExportFileFormat.getSelText + DocumentsInformationTitle.getText + DocumentsInformationsummary.setText "A" + DocumentsInformationAuthor.setText "B" + NextButton.click + + printlog " 3. Main Layout" + Call DialogTest (WebWizard,3) + MainLayoutLayout2.typeKeys "<space>" + NextButton.click + + printlog " 4. Layout details" + Call DialogTest (WebWizard,4) + LayoutDetailsFileName.isChecked + LayoutDetailsDescription.isChecked + LayoutDetailsAuthor.isChecked + LayoutDetailsCreationDate.isChecked + LayoutDetailsLastChangeDate.isChecked + LayoutDetailsFileFormat.isChecked + LayoutDetailsFileFormatIcon.isChecked + LayoutDetailsNumberOfPages.isChecked + LayoutDetailsSizeInKB.isChecked + LayoutDetails640x480.isChecked + LayoutDetails800x600.isChecked + LayoutDetails1024x768.isChecked + NextButton.click + + printlog " 5. Style" + Call DialogTest (WebWizard,5) + StyleStyle.getItemCount + StyleStyle.getSelText + StyleBackgroundImage.click + Kontext "BackgroundImages" + if BackgroundImages.exists(10) then + Call Dialogtest (BackgroundImages) + Forward.click + Back.click + Other.click + Kontext "OeffnenDlg" + if OeffnenDlg.exists(5) then + OeffnenDlg.cancel + else + warnlog "File Dialog didn't came up" + endif + WaitSlot( 5000 ) + + Kontext "BackgroundImages" + None.click + cancelB.click + else + warnlog "Dialog Background images didn't came up" + endif + Kontext "WebWizard" + StyleIconSet.click + Kontext "IconSets" + if IconSets.exists(5) then + Call Dialogtest (IconSets) + None.click + cancelB.click + else + warnlog "File Dialog didn't came up" + endif + Kontext "WebWizard" + NextButton.click + + printlog " 6. Web site information" + Call DialogTest (WebWizard,6) + WebSiteInformationTitle.getText + WebSiteInformationDescription.getText + WebSiteInformationEmail.getText + WebSiteInformationCopyrightNotice.getText + WebSiteInformationCreated.getText + WebSiteInformationCreated.more + WebSiteInformationCreated.getText + WebSiteInformationCreated.toMax + WebSiteInformationCreated.getText + WebSiteInformationModified.getText + NextButton.click + + printlog " 7. Preview" + Call DialogTest (WebWizard,7) + PreviewToALocalFolderCB.unCheck + PreviewToALocalFolderTF.getText + PublishToALocalFolderB.click + Kontext "OeffnenDlg" + if OeffnenDlg.exists(5) then + OeffnenDlg.cancel + else + warnlog "File Dialog didn't came up" + endif + WaitSlot( 5000 ) + Kontext "WebWizard" + PublishToAZIPArchiveCB.isChecked + PublishToAZIPArchiveTF.getText + PublishToAZIPArchiveB.click + Kontext "SpeichernDlg" + if SpeichernDlg.exists(5) then + SpeichernDlg.cancel + else + warnlog "File Dialog didn't came up" + endif + WaitSlot( 5000 ) + Kontext "WebWizard" + PublishToAWebServer.isChecked + try + PublishFTPConfigure.click + Kontext "FTPConnection" + if FTPConnection.exists(5) then + Call Dialogtest (FTPConnection) + ServerName.getText + UserName.getText + Password.getText + Connect.isEnabled + ChooseARemoteDirectory.getText + ChooseARemoteDirectoryB.isEnabled + CancelB.click + endif + catch + printlog "no ftp" + endcatch + + Kontext "WebWizard" + if ( webwizard.exists( 10 ) ) then + PublishSaveSettings.check() + PublishSaveAs.getItemCount + PublishSaveAs.getSelText + CancelB.click + i = 0 + while ((getdocumentcount > a) AND (i<30)) + printlog "waiting for closing of wizard (max 30 sec): " + i + inc i + sleep 1 + wend + if i > 29 then + qaErrorlog "Wizard performance issue; takes longer than 30 sec to close." + endif + else + warnlog( "Cannot access webwizard" ) + endif + else + warnlog "Web page wizard didn't come up" + endif +endcase + |