diff options
Diffstat (limited to 'testautomation/framework/required/includes')
30 files changed, 7063 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 100755 index 000000000000..251efa7ac02a --- /dev/null +++ b/testautomation/framework/required/includes/basic_dialog_export.inc @@ -0,0 +1,116 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_dialog_export.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:19:03 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : 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 + + 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..4947b72fa37b --- /dev/null +++ b/testautomation/framework/required/includes/basic_dialog_i18n.inc @@ -0,0 +1,145 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_dialog_i18n.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:19:03 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Update test for Basic IDE / Dialog i18n-feature +'* +'\****************************************************************************** + +testcase tUpdtBasicDialogI18n + + printlog( "BASIC IDE Dialog i18n." ) + + dim brc as boolean + + hCloseNavigator() + hCreateDocument()' + + brc = hInitFormControls( "tDialogI18n" ) + if ( not brc ) then + warnlog( "Failed to open Basic IDE / Dialogs / ToolsCollectionBar" ) + goto endsub + endif + + printlog( "Click Manage Languages on ToolsCollectionBar") + kontext "ToolsCollectionBar" + if ( ToolsCollectionBar.exists() ) then + ManageLanguage.click() + else + warnlog( "<ToolsCollectionBar> is not open, is the test environment dirty?" ) + endif + + kontext "ManageUILanguages" + if ( ManageUILanguages.exists( 2 ) ) then + call dialogtest( ManageUILanguages ) + + printlog( "Add default language, choose preselection") + kontext "ManageUILanguages" + Add.click() + + kontext "SetDefaultLanguage" + if ( SetDefaultLanguage.exists( 2 ) ) then + call dialogtest( SetDefaultLanguage ) + + kontext "SetDefaultLanguage" + DefaultLanguageListbox.select( 3 ) + + kontext "SetDefaultLanguage" + SetDefaultLanguage.ok() + else + warnlog( "Dialog <SetDefaultLanguage> did not open" ) + endif + + printlog( "Back on Manage UI Languages Dialog we click <Add>") + kontext "ManageUILanguages" + Add.click() + + kontext "AddUserInterface" + if ( AddUserInterface.exists( 2 ) ) 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" + 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" + Delete.click() + + printlog( "Confirm delete") + kontext "active" + if ( Active.exists( 1 ) ) then + call dialogtest( active ) + + kontext "active" + active.ok() + else + warnlog( "Confirm delete messagebox is missing" ) + endif + + printlog( "Leave Manage UI Languages Dialog") + kontext "ManageUILanguages" + 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" ) + endif + + kontext "ToolsCollectionBar" + if ( not ToolsCollectionBar.exists() ) then + warnlog( "The ToolsCollectionBar is not visible" ) + endif + + printlog( "Cleanup" ) + 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 100755 index 000000000000..8c26ab0d6bed --- /dev/null +++ b/testautomation/framework/required/includes/basic_dialog_i18n_import.inc @@ -0,0 +1,147 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_delete_modules.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $ +'* +'* 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 ) + + const LANGUAGE_COUNT = 5 + + printlog( "Open BASIC-IDE" ) + hCreateDocument() + hInitFormControls( "tDialogI18nImport" ) + + kontext "ToolsCollectionBar" + if ( ToolsCollectionBar.exists() ) then + ToolsCollectionBar.close() + endif + + Kontext "DialogBar" + if ( DialogBar.exists() ) then + + printlog( "Click on <Import> button on <DialogBar>" ) + Import.click() + + kontext "OeffnenDlg" + if ( OeffnenDlg.exists( 2 ) ) then + + printlog( "Enter path to test dialog" ) + DateiName.setText( cDialogPath ) + Oeffnen.click() + + printlog( "Test messagebox" ) + kontext "active" + if ( Active.exists( 2 ) ) then + + printlog( "Messagebox: " & Active.getText() ) + if ( Active.getButtonCount() <> 4 ) then + warnlog( "Incorrect messagebox, expected locale clash warning" ) + endif + + call DialogTest( Active ) + + printlog( "Accept with yes" ) + Active.Yes() + + Kontext "TranslationBar" + if ( TranslationBar.exists() ) then + + printlog( "Check number of imported languages" ) + if ( CurrentLanguage.getItemCount() <> LANGUAGE_COUNT ) then + warnlog( "Incorrect language count in listbox <CurrentLanguage>" ) + printlog( "Expected: " & LANGUAGE_COUNT ) + printlog( "Found...: " & CurrentLanguage.getItemCount() ) + endif + + Kontext "DialogBar" + if ( DialogBar.exists() ) then + + printlog( "Click on <Import> button on <DialogBar>" ) + Import.click() + + kontext "OeffnenDlg" + if ( OeffnenDlg.exists( 2 ) ) then + + printlog( "Enter path to test dialog" ) + DateiName.setText( cDialogPath ) + Oeffnen.click() + + printlog( "Test messagebox" ) + kontext "Active" + if ( Active.exists( 2 ) ) then + + printlog( "Messagebox: " & Active.getText() ) + if ( Active.getButtonCount() <> 3 ) then + warnlog( "Incorrect messagebox, expected dialog replace warning" ) + endif + + call DialogTest( Active ) + + Printlog( "Rename the new dialog" ) + 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..92c88f7ace17 --- /dev/null +++ b/testautomation/framework/required/includes/basic_macroassignment.inc @@ -0,0 +1,139 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_macroassignment.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:19:03 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Update-Test for some dialogs in Basic-IDE +'* +'\****************************************************************************** + +testcase tUpdtMacroAssignment + + printlog( "Update-Test for some dialogs in Basic-IDE" ) + + dim brc as boolean + + hCreateDocument() + + printlog( "Create a new BASIC-module for this document" ) + + brc = hOpenBasicOrganizerFromDoc() + + brc = hCreateModuleForDoc( "tUpdtBasicIde" ) + if ( not brc ) then + warnlog( "Failed to create a new BASIC module for this document" ) + brc = hDestroyDocument() + goto endsub + endif + + printlog( "Create a new BASIC-dialog" ) + brc = hNewDialog() + if ( not brc ) then + warnlog( "Failed to create a new BASIC-dialog" ) + hCloseBasicIde() + brc = hDestroyDocument() + goto endsub + endif + + printlog( "Select the Dialog-Pane from the DialogWindow" ) + brc = hSelectDialogPane() + if ( not brc ) then + warnlog( "Selecting failed: ToolsCollectionBar is in the way." ) + hCloseBasicIde() + else + + printlog( "Show ToolsCollectionBar" ) + brc = hShowMacroControls() + if ( not brc ) then + warnlog( "ToolsCollectionBar is not open" ) + endif + + printlog( "Open the Property-Browser: TabGeneralControl" ) + brc = hOpenPropertyBrowser() + if ( brc ) then + call dialogtest( TabGeneralControl ) + else + warnlog( "Property-Browser is not open, skipping further testing" ) + endif + + if ( brc ) then + brc = hSetPBTabPage( 2 ) + endif + + if ( brc ) then + + printlog( "Current Dialog: Property-Browser / Events-Page" ) + call dialogtest( TabEventsControl ) + + Kontext "TabEventsControl" + printlog( "Click the button for the FocusGained-Event" ) + try + PBFocusGained.click() + catch + warnlog( "#i64196# - Events missing on properties tab-page" ) + goto skipevents + endcatch + + Kontext "AssignMacro" + printlog( "Current Dialog: Assign Macro" ) + call dialogtest( AssignMacro ) + printlog( "Click the Assign-Button on the Macro-Assignment-Dialog" ) + AssignButton.click() + + Kontext "ScriptSelector" + printlog( "Current Dialog: ScriptSelector" ) + call dialogtest( ScriptSelector ) + printlog( "Cancel the scriptselector" ) + ScriptSelector.cancel() + + Kontext "AssignMacro" + printlog( "Current Dialog: Assign Macro" ) + printlog( "Cancel the Script-Assignement-Dialog" ) + AssignMacro.cancel() + + endif + + skipevents: + + printlog( "Current Dialog: Property-Browser" ) + printlog( "Close the Property-Browser, return to the document" ) + brc = hClosePropertyBrowser() + + brc = hCloseBasicIde() + + endif + + brc = hDestroyDocument() + +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..64a30b406832 --- /dev/null +++ b/testautomation/framework/required/includes/basic_organizer.inc @@ -0,0 +1,236 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: basic_organizer.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:19:03 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Update test for the Basic Organizer dialog +'* +'\****************************************************************************** + +testcase tUpdtBasicOrganizer + + printlog( "Update test for the Basic Organizer dialog" ) + + dim brc as boolean + 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" ) + brc = 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() + brc = 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( "zzzz" ) + 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( "zzzz" ) + 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 = "zzzz" ) 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" ) + brc = hDestroyDocument() + + +endcase + diff --git a/testautomation/framework/required/includes/first.inc b/testautomation/framework/required/includes/first.inc new file mode 100755 index 000000000000..d0ce71f775df --- /dev/null +++ b/testautomation/framework/required/includes/first.inc @@ -0,0 +1,338 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: first.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:19:03 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : 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" + 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() +end function + +'******************************************************************************* + +testcase tHelpRegistration + + ' 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/graphics_import.inc b/testautomation/framework/required/includes/graphics_import.inc new file mode 100755 index 000000000000..0322e9668002 --- /dev/null +++ b/testautomation/framework/required/includes/graphics_import.inc @@ -0,0 +1,320 @@ +'encoding UTF-8 Do not remove or change this line! +'******************************************************************************* +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: graphics_import.inc,v $ +'* +'* $Revision: 1.2 $ +'* +'* last change: $Author: obo $ $Date: 2008-07-25 08:03:02 $ +'* +'* 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 : Graphic import (2nd file for the first.bas) +'* +'\****************************************************************************** + + +testcase tQuickInsertGraphNotAsLink + + printlog( "Load files of all known graphics formats" ) + + dim iCurrentFile as integer + dim GraphicFile as String + dim Filtername as String + + printlog( "Insert a sample of commonly used file formats into a writer document (not linked)" ) + + if ( gUseSysDlg ) then + warnlog( "This test needs the OpenOffice.org filepicker to be set as default" ) + goto endsub + endif + + gApplication = "WRITER" + Call hNewDocument + + for iCurrentFile = 1 to 25 + + ' MODIFY and ENABLE this SAMPLE snippet to exclude one fileformat from testing + ' if ( iCurrentFile = 7 ) AND (gtPlatform="x86") then + ' qaErrorLog("#<issue-id># crash on <platform> on loading <image-file>") + ' goto skipformat + ' endif + ' Note: Can be locale dependent! + if (iCurrentFile = 4) AND (gPlatform="osx") then + qaerrorlog("#i100253# crash on MacOS X on loading ball.eps") + goto skipformat + endif + + Kontext "GrafikEinfuegenDlg" + if ( not GrafikEinfuegenDlg.exists() ) then + InsertGraphicsFromFile + Kontext "GrafikEinfuegenDlg" + endif + + if ( GrafikEinfuegenDlg.Exists( 2 ) ) then + ' the list of files expected to be found in the samples directory + select case iCurrentFile + case 1 : GraphicFile = "desp.bmp" + case 2 : GraphicFile = "columbia.dxf" + case 3 : GraphicFile = "extrud.emf" + case 4 : GraphicFile = "ball.eps" + case 5 : GraphicFile = "airshw.met" + case 6 : GraphicFile = "eface.gif" + case 7 : GraphicFile = "purzel.gif" ' Animated Gif + case 8 : GraphicFile = "borabora.jpg" + case 9 : GraphicFile = "grafix1.pbm" + case 10 : GraphicFile = "circle.pcx" + case 11 : GraphicFile = "papagei1.pcd" + case 12 : GraphicFile = "newtonme.pct" + case 13 : GraphicFile = "grafix2.pgm" + case 14 : GraphicFile = "obst.png" + case 15 : GraphicFile = "london.ppm" + case 16 : GraphicFile = "tiger.psd" + case 17 : GraphicFile = "grafix3.ras" + case 18 : GraphicFile = "mickym.sgf" + case 19 : GraphicFile = "faxpfeil.sgv" + case 20 : GraphicFile = "picture.svm" + case 21 : GraphicFile = "pilz.tga" + case 22 : GraphicFile = "stabler.tif" + case 23 : GraphicFile = "krokodil.wmf" + case 24 : GraphicFile = "grafix4.xbm" + case 25 : GraphicFile = "papagei2.xpm" + end select + + GraphicFile = ConvertPath (gTesttoolPath & "global\input\graf_inp\" & GraphicFile) + printlog( "Current file " + iCurrentFile + ": " & GraphicFile ) + printlog( " * Set filter to <All formats>" ) + DateiName.SetText( GraphicFile ) + DateiTyp.Select( 1 ) + WaitSlot() + + printlog( " * Uncheck Preview- and Link-checkbox, load the file" ) + Vorschau.unCheck + Verknuepfen.unCheck() + Oeffnen.click() + WaitSlot( 2000 ) + + Kontext "Active" + if ( Active.Exists() ) then + Warnlog( "Unexpected messagebox: " & Active.GetText() ) + Warnlog( "Affected file: " & GraphicFile ) + Active.OK + else + try + EditCopy + WaitSlot( 2000 ) + EditDeleteContents + WaitSlot( 2000 ) + catch + Warnlog( "Graphic file not selected/Copy or Delete is disabled: " & GraphicFile ) + gMouseClick (90, 90) + endcatch + endif + else + warnlog( "Insert Graphics Dialog is not open, aborting" ) + goto endsub + endif + + skipformat: + next iCurrentFile + + printlog( "" ) + printlog( "Test the PCD-Filters directly (3 samples)" ) + + for iCurrentFile = 1 to 3 + + printlog( "" ) + + Kontext "GrafikEinfuegenDlg" + if ( not GrafikEinfuegenDlg.exists() ) then + InsertGraphicsFromFile + Kontext "GrafikEinfuegenDlg" + endif + + if ( GrafikEinfuegenDlg.exists( 2 ) ) then + + select case iCurrentFile + case 1 : Filtername = "PCD - Kodak Photo CD (768x512) (*.pcd)" + case 2 : Filtername = "PCD - Kodak Photo CD (384x256) (*.pcd)" + case 3 : Filtername = "PCD - Kodak Photo CD (192x128) (*.pcd)" + end select + + GraphicFile = ConvertPath( gTesttoolPath & "global\input\graf_inp\papagei1.pcd" ) + + printlog( "Current filter: " & Filtername ) + printlog( "Current file..: " & GraphicFile ) + DateiName.SetText ( GraphicFile ) + DateiTyp.Select( Filtername ) + + printlog( " * Uncheck Preview- and Link-checkbox, load the file" ) + Vorschau.Uncheck() + Verknuepfen.unCheck() + Oeffnen.click() + WaitSlot( 2000 ) + + Kontext "Active" + if ( Active.Exists() )then + Warnlog( "Unexpected messagebox: " & Active.GetText() ) + Warnlog( "Affected file..: " & GraphicFile ) + Warnlog( "Affected filter: " & Filtername ) + Active.OK() + else + try + EditCopy + WaitSlot( 2000 ) + EditDeleteContents + WaitSlot( 2000 ) + catch + Warnlog( "Problems with filtertype : " & Filtername ) + gMouseClick (90, 90) + endcatch + endif + else + warnlog( "Insert Graphics Dialog is not open. Aborting" ) + goto endsub + endif + + next iCurrentFile + + Kontext "GrafikEinfuegenDlg" + if GrafikEinfuegenDlg.Exists then + GrafikEinfuegenDlg.Cancel + endif + + Call hCloseDocument + +endcase + +'******************************************************************************* + +testcase tInFilterCountCompare() + + printlog( "Check filterlist (filterstring) for graphics files" ) + + if ( gUseSysDlg ) then + warnlog( "This test needs the OpenOffice.org filepicker to be set as default" ) + goto endsub + endif + + 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() ) + if ( irc <> 0 ) then + warnlog( "The list of graphic format filters has changed" ) + endif + + 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..2b4ee6270fda --- /dev/null +++ b/testautomation/framework/required/includes/help_browser.inc @@ -0,0 +1,165 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: help_browser.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:19:03 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : global update/resource test +'* +'\****************************************************************************** + +testcase tHelp_DialogTest + + printlog( "Resource test for the Help Browser" ) + + Dim i as Integer + dim brc as boolean + printlog "- open the help" + + 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 + + + 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 + + Dim i as Integer + 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 + + + kontext "starofficehelp" + printlog "- Index -> on" + Index.Click() + waitslot + + printlog "- Index -> off" + Index.Click() + + ' Backward- and Forward-button + printlog "- activate 'Index'-page" + brc = hSelectHelpTab( "index" ) + sleep( 2 ) + + 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 + + if Active.getRT() = 304 then + qaerrorlog "- Printing failed: Did you define a default printer?" + Active.OK() + + Kontext "DruckenDlg" + if ( druckenDlg.exists() ) then + printlog( "Printer dialog is still open, closing with cancel" ) + druckenDlg. cancel() + endif + + endif + + else + kontext "druckendlg" + if DruckenDlg.NotExists (2) then + warnlog "No print-dialog is open. => direct printing? - bug 93788!" + else + DruckenDlg.Cancel() + endif + + endif + + printlog "- Set Bookmark" + + kontext "tb_help" + SetBookmarks.Click() + + kontext "addbookmark" + call DialogTest ( AddBookmark ) + AddBookmark.Cancel() + + brc = hCloseHelp() + +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..921afb4d6a3d --- /dev/null +++ b/testautomation/framework/required/includes/printer_administration.inc @@ -0,0 +1,317 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: printer_administration.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:19:03 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : 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 + + call TestFonts( 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 + + + 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 + +'******************************************************************************* + +sub TestFonts( cPrinter as string ) + + + printlog( " * Open 'Fonts...' dialog" ) + + Kontext "SpAdmin" + if ( PBFonts.isEnabled() ) then + PBFonts.click() + waitslot + + printlog( " * Test the font-dialog" ) + Kontext "SPFontNameDLG" + call dialogtest( SPFontNameDLG ) + + printlog( " * Press 'Add ...'" ) + PBAdd.click() + waitslot + + printlog( " * Test the import-dialog" ) + kontext "SPFontImportDLG" + call dialogtest( SPFontImportDLG ) + + printlog( " * close import dialog" ) + SPFontImportDLG.cancel() + + Kontext "SPFontNameDLG" + printlog( " * close fonts-dialog" ) + SPFontNameDLG.ok() + waitslot + else + printlog( "Fonts... not available, skipping." ) + endif + + +end sub diff --git a/testautomation/framework/required/includes/script_organizers.inc b/testautomation/framework/required/includes/script_organizers.inc new file mode 100755 index 000000000000..83bbf6ed6eeb --- /dev/null +++ b/testautomation/framework/required/includes/script_organizers.inc @@ -0,0 +1,122 @@ +'encoding UTF-8 Do not remove or change this line! +'******************************************************************************* +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: script_organizers.inc,v $ +'* +'* $Revision: 1.3 $ +'* +'* last change: $Author: rt $ $Date: 2008-09-04 09:16:12 $ +'* +'* 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 + + printlog( "Resource test for macros and scripts / related dialogs" ) + + const SCRIPTING_DIALOGS = 5 + dim aScriptCount( SCRIPTING_DIALOGS ) + aScriptCount( 1 ) = 10 + aScriptCount( 2 ) = 14 + aScriptCount( 3 ) = 10 + aScriptCount( 4 ) = 585 + aScriptCount( 5 ) = 601 + + dim iCurrentDialog as integer + dim iCurrentScriptCount as integer + + + + do while ( getDocumentCount > 0 ) + hDestroyDocument() + loop + + hNewDocument() + + for iCurrentDialog = 1 to SCRIPTING_DIALOGS + + printlog( "" ) + select case iCurrentDialog + case 1: printlog( "JavaScript" ) + ToolsMacrosOrganizeMacrosJavaScript + kontext "ScriptOrganizer" + iCurrentScriptCount = hExpandAllNodes( ScriptTreeList ) + ScriptOrganizer.cancel() + case 2: printlog( "BeanShell" ) + ToolsMacrosOrganizeMacrosBeanShell + kontext "ScriptOrganizer" + iCurrentScriptCount = hExpandAllNodes( ScriptTreeList ) + ScriptOrganizer.cancel() + case 3: printlog( "Python" ) + ToolsMacrosOrganizeMacrosPython + kontext "ScriptOrganizer" + iCurrentScriptCount = hExpandAllNodes( ScriptTreeList ) + ScriptOrganizer.cancel() + case 4: printlog( "Makro Organizer" ) + ToolsMacro_uno + Kontext "Makro" + hExpandAllNodes( MakroAus ) + iCurrentScriptCount = hGetScriptCount( MakroAus, MakroListe ) + Makro.close() + case 5: printlog( "Run Macro" ) + ToolsMacrosRunMacro + kontext "ScriptSelector" + hExpandAllNodes( LibraryTreeList ) + iCurrentScriptCount = hGetScriptCount( LibraryTreeList, ScriptList ) + ScriptSelector.cancel() + end select + + if ( aScriptCount( iCurrentDialog ) <> iCurrentScriptCount ) then + warnlog( "Incorrect number of scripts for this dialog: " & iCurrentScriptCount ) + else + printlog( "Number of scripts is ok" ) + endif + + next iCurrentDialog + + hCloseDocument() + + +endcase + +'******************************************************************************* + +function hGetScriptCount( oTree as object, oList as object ) as integer + + dim iTreeItem as integer + dim iScript as integer : iScript = 0 + + for iTreeItem = 1 to oTree.getItemCount() + oTree.select( iTreeItem ) + iScript = iScript + oList.getItemCount() + next iTreeItem + hGetScriptCount() = iScript + +end function diff --git a/testautomation/framework/required/includes/security_dialogs.inc b/testautomation/framework/required/includes/security_dialogs.inc new file mode 100755 index 000000000000..026fdb5587eb --- /dev/null +++ b/testautomation/framework/required/includes/security_dialogs.inc @@ -0,0 +1,192 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: security_dialogs.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:19:03 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : 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 100755 index 000000000000..3cb47e2144e8 --- /dev/null +++ b/testautomation/framework/required/includes/smoketest.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 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: smoketest.inc,v $ +'* +'* $Revision: 1.2 $ +'* +'* last change: $Author: rt $ $Date: 2008-07-10 15:39:30 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : 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 100755 index 000000000000..5de0c82132f2 --- /dev/null +++ b/testautomation/framework/required/includes/standard_toolbar_1.inc @@ -0,0 +1,83 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: standard_toolbar_1.inc,v $ +'* +'* $Revision: 1.2 $ +'* +'* last change: $Author: rt $ $Date: 2008-09-04 09:16:28 $ +'* +'* 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 100755 index 000000000000..66fa5ce43435 --- /dev/null +++ b/testautomation/framework/required/includes/standard_toolbar_3.inc @@ -0,0 +1,262 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: standard_toolbar_3.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:19:03 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : 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..b4da83b51879 --- /dev/null +++ b/testautomation/framework/required/includes/standard_toolbar_4.inc @@ -0,0 +1,63 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: standard_toolbar_4.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:19:03 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Invisible items on the standardbar +'* +'\****************************************************************************** + +testcase tStandardBar_4 + + printlog( "Invisible items on the standardbar" ) + + dim brc as boolean + + hResetStandardBar() + + hInitSingleDoc() + DocumentWriter.maximize() ' Needed to avoid toolbar clipping on resolutions < 1024x768 or small windows. + hStandardbarItemGetCount() + + hStandardbarLoadUrl() + + hStandardbarNewDialog() + + hStandardbarSaveAs() + + brc = hInitBackingMode() + + +endcase + + diff --git a/testautomation/framework/required/includes/standard_toolbar_5.inc b/testautomation/framework/required/includes/standard_toolbar_5.inc new file mode 100755 index 000000000000..198c9286da9b --- /dev/null +++ b/testautomation/framework/required/includes/standard_toolbar_5.inc @@ -0,0 +1,84 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: standard_toolbar_5.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:19:03 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : 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..cefde7e900e8 --- /dev/null +++ b/testautomation/framework/required/includes/standard_toolbar_6.inc @@ -0,0 +1,145 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: standard_toolbar_6.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:19:03 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : 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" ) + + hCloseNavigator() + hDestroyDocument() + + hCloseNavigator() + 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..d64f461eaeed --- /dev/null +++ b/testautomation/framework/required/includes/tools_customize.inc @@ -0,0 +1,736 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: tools_customize.inc,v $ +'* +'* $Revision: 1.2 $ +'* +'* last change: $Author: jsk $ $Date: 2008-06-20 08:03:53 $ +'* +'* 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" ) + const CLOSE_METHOD = 1 ' 1 = Cancel button + + if ( hCreateDocument() ) then + if ( hToolsCustomizeOpen() ) then + hUpdtToolsCustomizeKeyboard() + hUpdtToolsCustomizeMenu() + hUpdtToolsCustomizeToolbars() + hUpdtToolsCustomizeEvents() + hToolsCustomizeClose( CLOSE_METHOD ) + 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 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" ) + + brc = hToolsCustomizeSelectTab( "Menu" ) + call DialogTest( TabCustomizeMenu ) + + printlog( CFN & "Click New..." ) + kontext "TabCustomizeMenu" + BtnNew.click() + + Kontext "MenuOrganiser" + 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" ) + MenuOrganiser.ok() + + printlog( CFN & "Click the menu listbutton" ) + kontext "TabCustomizeMenu" + hOpenMenuButton( MenuBtn ) ' MenuBtn.OpenMenu() + + printlog( CFN & "Select Move..." ) + hMenuSelectNr( 1 ) + + kontext "MenuOrganiser" + printlog( CFN & "Click UP" ) + ButtonUp.click() + + kontext "MenuOrganiser" + printlog( CFN & "Click DOWN" ) + ButtonDown.click() + + printlog( CFN & "Cancel the dialog" ) + MenuOrganiser.cancel() + + printlog( CFN & "Click the menu listbutton" ) + kontext "TabCustomizeMenu" + hOpenMenuButton( MenuBtn ) ' MenuBtn.OpenMenu() + + printlog( CFN & "Select Rename..." ) + hMenuSelectNr( 2 ) + + 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( 3 ) + + kontext "TabCustomizeMenu" + hUpdtToolsCustomizeScriptSelector( 3 ) + + printlog( CFN & "Check itemcount in SaveIn List" ) + kontext "TabCustomizeMenu" + select case gApplication + case "BACKGROUND" : brc = hToolsCustomizeTestSaveIn( 1 ) + case else : brc = hToolsCustomizeTestSaveIn( 2 ) + end select + if ( not brc ) then + warnlog( "Incorrect itemcount in listbox, see above" ) + endif + + printlog( CFN & "Down..." ) + BtnDown.click() + + printlog( CFN & "Up..." ) + BtnUp.click() + + printlog( CFN & "Click the Modify-Button and select item 1 (Add submenu)" ) + kontext "TabCustomizeMenu" + brc = hClickCommandButton( 1 ) + if ( not brc ) 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" + brc = hClickCommandButton( 3 ) + if ( not brc ) 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" + brc = hClickCommandButton( 4 ) + if ( not brc ) 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" + brc = hClickCommandButton( 2 ) + if ( not brc ) 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" + brc = hClickCommandButton( 2 ) + if ( not brc ) then + warnlog( CFN & "Something went wrong when accessing the command button" ) + exit function + endif + +end function + +'******************************************************************************* + +function hUpdtToolsCustomizeToolbars() + + + + + + const CFN = "hUpdtToolsCustomizeToolbars::" + 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( 2 ) ) then + printlog( CFN & "NewToolbar" ) + call DialogTest( NewToolbar ) + + select case gApplication + case "BACKGROUND" : brc = hToolsCustomizeTestSaveIn( 1 ) + case else : brc = hToolsCustomizeTestSaveIn( 2 ) + end select + if ( not brc ) then + warnlog( "Incorrect itemcount in listbox, see above" ) + endif + + printlog( CFN & "Name the new toolbar for further usage" ) + ToolbarName.setText( "tUpdtCustomize" ) + + printlog( CFN & "Close NewToolbar dialog with OK" ) + 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( 1 ) + + printlog( CFN & "Cancel the dialog" ) + kontext "RenameToolbar" + if ( RenameToolbar.exists( 2 ) ) then + call dialogtest( RenameToolbar ) + 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( 2 ) + + kontext "TabCustomizeToolbars" + hUpdtToolsCustomizeScriptSelector( 2 ) + + kontext "TabCustomizeToolbars" + select case gApplication + case "BACKGROUND" : brc = hToolsCustomizeTestSaveIn( 1 ) + case else : brc = hToolsCustomizeTestSaveIn( 2 ) + end select + if ( not brc ) then + warnlog( "Incorrect itemcount in listbox, see above" ) + endif + + 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( 5 ) ) then + + call dialogtest( ScriptSelector ) + + ' This is a workaround that applies when - for some reason - the menu + ' (menubutton: AddCommands) is not open. In this case the ScriptSelector + ' will not open. Before this hack the office was left in an unstable state + ' and the following tests would have failed. Now we get a warning + ' instead. + + printlog( CFN & "Add the default item" ) + try + kontext "ScriptSelector" + ScriptSelector.ok() + catch + qaerrorlog( "#i79207# Could not access ok button on ScriptSelector" ) + kontext "ScriptSelector" + if ( ScriptSelector.exists( 2 ) ) then + printlog( "Scriptselector is open" ) + endif + + endcatch + + else + LibraryTreeList.typeKeys( "<HOME>" ) + for iCurrentItem = 1 to 5 + printlog( CFN & "LibraryTreeList: Moving down..." ) + LibraryTreeList.typeKeys( "<DOWN>" ) + if ( ScriptSelector.isEnabled() ) then + exit for + endif + next iCurrentItem + endif + + ' Note: The Customize dialog in the background is updated immediately. This + ' means that the cancel-button is active but blocked for a moment + WaitSlot( 2000 ) + + printlog( CFN & "Close the Script Selector, back to ToolsCustomize dialog" ) + ScriptSelector.cancel() + + ' make sure the dialog is really closed. At times it just refuses to do so?? + if ( ScriptSelector.exists( 1 ) ) then + ScriptSelector.close() + endif + + kontext "TabCustomizeToolbars" + printlog( CFN & "Click the Modify-button" ) + brc = hClickCommandButton( 1 ) + if ( not brc ) then + warnlog( CFN & "Something went wrong when accessing the command button" ) + exit function + endif + + printlog( CFN & "Rename the item" ) + kontext "CustomizeToolbarsRename" + if ( CustomizeToolbarsRename.exists( 2 ) ) then + call dialogtest( CustomizeToolbarsRename ) + EingabeFeld.setText( "Renamed item" ) + + printlog( CFN & "Close the dialog" ) + CustomizeToolbarsRename.ok() + else + warnlog( CFN & "CustomizeToolbarsRename could not be accessed" ) + endif + + kontext "TabCustomizeToolbars" + brc = hClickCommandButton( 2 ) + if ( not brc ) then + warnlog( CFN & "Something went wrong when accessing the command button" ) + exit function + endif + + kontext "TabCustomizeToolbars" + waitslot + printlog( CFN & "Click the Modify-button" ) + printlog( "******************** 1 ********************" ) + hDeselectSeparator() + printlog( "******************** 2 ********************" ) + brc = hClickCommandButton( 3 ) + if ( not brc ) then + warnlog( CFN & "Something went wrong when accessing the command button" ) + exit function + endif + + kontext "TabCustomizeToolbars" + waitslot + printlog( CFN & "Click the Modify-button" ) + brc = hClickCommandButton( 4 ) + if ( not brc ) then + warnlog( CFN & "Something went wrong when accessing the command button" ) + exit function + endif + + kontext "TabCustomizeToolbars" + WaitSlot + printlog( CFN & "Click the Modify-button" ) + brc = hClickCommandButton( 1 ) + if ( not brc ) then + warnlog( CFN & "Something went wrong when accessing the command button" ) + exit function + endif + + kontext "TabCustomizeToolbars" + waitslot + printlog( CFN & "Click the Modify-button" ) + printlog( "******************** 3 ********************" ) + hDeselectSeparator() + printlog( "******************** 4 ********************" ) + brc = hClickCommandButton( 5 ) + if ( not brc ) then + warnlog( CFN & "Something went wrong when accessing the command button" ) + exit function + endif + + printlog( CFN & "On the Change Icon dialog: Click to import an icon" ) + kontext "ChangeIcon" + if ( ChangeIcon.exists( 2 ) ) then + call dialogtest( ChangeIcon ) + import.click() + + printlog( CFN & "Cancel the FileOpen-dialog" ) + kontext "OeffnenDlg" + call dialogtest( OeffnenDlg ) + OeffnenDlg.cancel() + + printlog( CFN & "Cancel the Change Icon dialog" ) + kontext "ChangeIcon" + ChangeIcon.ok() + else + warnlog( CFN & "Could not access Change Icon dialog" ) + endif + + kontext "TabCustomizeToolbars" + waitslot + printlog( CFN & "Click the Modify-button" ) + brc = hClickCommandButton( 3 ) + if ( not brc ) then + warnlog( CFN & "Something went wrong when accessing the command button" ) + exit function + endif + +end function + + +'******************************************************************************* + +function hUpdtToolsCustomizeEvents() + + + + + + const CFN = "hUpdtToolsCustomizeEvents::" + dim brc as boolean + + printlog( "" ) + printlog( "Events" ) + + brc = hToolsCustomizeSelectTab( "events" ) + call DialogTest( TabCustomizeEvents ) + + hUpdtToolsCustomizeScriptSelector( 1 ) + + kontext "TabCustomizeEvents" + select case gApplication + case "BACKGROUND" : brc = hToolsCustomizeTestSaveIn( 1 ) + case else : brc = hToolsCustomizeTestSaveIn( 2 ) + end select + if ( not brc ) then + warnlog( "Incorrect itemcount in listbox, see above" ) + endif + +end function + +'******************************************************************************* + +function hUpdtToolsCustomizeKeyboard() as boolean + + + + + + const CFN = "hUpdtToolsCustomizeKeyboard::" + dim brc as boolean + + printlog( "" ) + printlog( "Keyboard" ) + + brc = hToolsCustomizeSelectTab( "keyboard" ) + if ( not brc and gApplication = "BACKGROUND" ) then + qaerrorlog( "#i61765# TabTastatur is missing when called from Backing Window" ) + exit function + endif + + call DialogTest( TabTastatur ) + + ' no verification of functionality, this is an update test! + StarOffice.check() + hSelectNode( Tastatur , 2 ) + hSelectTopNode( bereich ) + waitslot + + ' 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 , 2 ) + waitslot + + ' 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" + SpeichernDlg.cancel() + + kontext "TabTastatur" + Laden.click() + + kontext "OeffnenDlg" + OeffnenDlg.cancel() + + +end function + +'******************************************************************************* + +function hUpdtToolsCustomizeScriptSelector( iBtn as integer ) as boolean + + + + + + const CFN = "hUpdtToolsCustomizeScriptSelector::" + + dim brc as boolean + brc = true + + select case iBtn + case 1 : kontext "TabCustomizeEvents" + printlog( CFN & "Assign Macro... (1)" ) + AssignMacro.click() + case 2 : kontext "TabCustomizeToolbars" + printlog( CFN & "Add... (2)" ) + AddCommands.click() + case 3 : kontext "TabCustomizeMenu" + printlog( CFN & "Add... (3)" ) + AddCommands.click() + case else + warnlog( CFN & "Invalid function parameter" ) + brc = false + end select + + if ( brc ) then + kontext "ScriptSelector" + call DialogTest( ScriptSelector ) + + kontext "ScriptSelector" + ScriptSelector.cancel() + + endif + + select case iBtn + case 1 : kontext "TabCustomizeEvents" + case 2 : kontext "TabCustomizeToolbars" + case 3 : 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: " + + hOpenMenuButton() = -1 ' this is the general failure returnvalue + + for iClick = 1 to 3 + + if ( bUseSlowMethod ) then + wait( 1000 ) + oControl.OpenMenu() + wait( 3000 ) + 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..cdfabf37cb4e --- /dev/null +++ b/testautomation/framework/required/includes/tools_options.inc @@ -0,0 +1,91 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: tools_options.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:19:04 $ +'* +'* 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" + + 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 + + ExtrasOptionenDlg.cancel() + hDestroyDocument() + + next iDocType + +endcase + diff --git a/testautomation/framework/required/includes/topten.inc b/testautomation/framework/required/includes/topten.inc new file mode 100755 index 000000000000..8fc5ac835af4 --- /dev/null +++ b/testautomation/framework/required/includes/topten.inc @@ -0,0 +1,328 @@ +'encoding UTF-8 Do not remove or change this line!
+'**************************************************************************
+'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'*
+'* Copyright 2008 by Sun Microsystems, Inc.
+'*
+'* OpenOffice.org - a multi-platform office productivity suite
+'*
+'* $RCSfile: topten.inc,v $
+'*
+'* $Revision: 1.1 $
+'*
+'* last change: $Author: jsi $ $Date: 2008-06-16 12:19:04 $
+'*
+'* 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 100755 index 000000000000..ae672ee4274b --- /dev/null +++ b/testautomation/framework/required/includes/window_functions.inc @@ -0,0 +1,347 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: window_functions.inc,v $ +'* +'* $Revision: 1.2 $ +'* +'* last change: $Author: rt $ $Date: 2008-09-04 09:16:41 $ +'* +'* 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" ) + + 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") + + qaerrorlog( "Excluded BASE and BACKINGWINDOW" ) + + 'gApplication = "DATABASE" + 'call tCheckWindowTitle("DATABASE","Base") + + 'fileclose + 'call tCheckWindowTitle("soffice","") + +end sub + +'******************************************************************************* + +testcase tCheckWindowTitle(sApplication as string, sReference as string) + + printlog( "Update test for the office window titles" ) + '<u>Input</u>: + '<ol> + '+<li>Name of application (string), case sensitive. Valid options are:</li> + '<ol> + '+<li>"swriter"</li> + '+<li>"sglobal"</li> + '+<li>"sweb"</li> + '+<li>"scalc"</li> + '+<li>"simpress"</li> + '+<li>"sdraw"</li> + '+<li>"smath"</li> + '+<li>"insight" * Currently disabled</li> + '+<li>"soffice" * Currently disabled</li> + '</ol> + '+<li>Reference name (string), matches name of application</li> + '<ol> + '+<li>"Writer"</li> + '+<li>"Writer/Web"</li> + '+<li>"Calc"</li> + '+<li>"Impress"</li> + '+<li>"Draw"</li> + '+<li>"Math"</li> + '+<li>"Base" * Currently disabled</li> + '+<li>"" * Currently disabled</li> + '</ol> + '</ol> + '<u>Returns</u>: + '<ol> + '+<li>Nothing</li> + '</ol> + '<u>Description</u>: + '<ul> + + + dim sTemp as string + dim saTemp() as string + dim brc as boolean + gApplication = UCase (gApplication) + printlog " - Application: " + sApplication + "; Title should be: " + sReference + + printlog( "Ensure that exactly one document is open" ) + hInitSingleDoc() + + printlog( "Open another document as specified by gApplication" ) + 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": + ToolsMacroMacro + + kontext "makro" + + if Makro.exists(5) then + MakroAus.typeKeys "<end>" + + if (Neu.isEnabled) then + Neu.click + + kontext "basicide" + + if BasicIDE.exists(5) then + printlog( "Basic IDE open. Good." ) + else + warnlog( "Basic IDE not open. This is unexpected" ) + endif + + else + warnlog( "New-button is unexpectedly disabled." ) + endif + + + try + + kontext "neuesmodul" + + if NeuesModul.exists(5) then + NeuesModul.OK + else + warnlog( "New module naming dialog is not open" ) + endif + + catch + warnlog( "Accessing <New module> dialog failed" ) + endcatch + + else + warnlog( "Couldn't open Tools->Macros->Organize Macros...->StarOffice Basic..." ) + endif + + case"chart": + case"DATABASE": + case"soffice": + brc = hDestroyDocument() + end select + + printlog( "Retrieve the caption from the window" ) + sTemp = hGetWindowCaption(sApplication) + printlog( "Caption is: " & sTemp ) + + printlog( "Split up the string to isolate the desired part" ) + saTemp() = fSplitWindowTitle(sTemp) + printlog "Filename/Untitled: '" & saTemp(0) & "'" + + printlog( "Compare the string to a reference" ) + if (ubound(saTemp()) > 0) then + + if (saTemp(1) <> sReference) then + warnlog "Applicationname not as expected. Sould be: '" & sReference & "', is: '" & saTemp(1) & "'" + endif + + printlog "Productname: '" & saTemp(2) & "'" + else + warnlog "#i36173# - Applicationname not as expected. Should be: '" & sReference & "', is: '" & "'" + endif + + printlog( "Cleanup after test" ) + select case sApplication + case"swriter": + case"sglobal": + case"sweb": + case"scalc": + case"simpress": + case"sdraw": + case"smath": + case"basic": + brc = hDestroyDocument() + case"chart": + case"DATABASE": + case"soffice": + hCreateDocument() + 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..a331c9178e85 --- /dev/null +++ b/testautomation/framework/required/includes/wizard_agenda.inc @@ -0,0 +1,115 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: wizard_agenda.inc,v $ +'* +'* $Revision: 1.2 $ +'* +'* last change: $Author: rt $ $Date: 2008-08-01 09:48:01 $ +'* +'* 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 ) + hClickNextButton() + + Kontext "AutopilotAgenda" + call DialogTest( AutopilotAgenda, 2 ) + hClickNextButton() + + Kontext "AutopilotAgenda" + call DialogTest( AutopilotAgenda, 3 ) + hClickNextButton() + + Kontext "AutopilotAgenda" + call DialogTest( AutopilotAgenda, 4 ) + hClickNextButton() + + Kontext "AutopilotAgenda" + call DialogTest( AutopilotAgenda, 5 ) + hClickNextButton() + + 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" ) + endif + + do while( getDocumentCount() > 0 ) + call hCloseDocument() + loop + + + 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 100755 index 000000000000..6749601393ad --- /dev/null +++ b/testautomation/framework/required/includes/wizard_documentconverter.inc @@ -0,0 +1,158 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: wizard_documentconverter.inc,v $ +'* +'* $Revision: 1.2 $ +'* +'* last change: $Author: rt $ $Date: 2008-08-01 09:48:16 $ +'* +'* 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 sKeys as string + 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" ) + + sKeys = hGetAccel( "DocumentConverter_ShowLog" ) + qaerrorlog( "#i54265# Show Logfile button has no HID, using accelerator instead" ) + + iWait = 0 + do while ( DocumentConverter.exists() ) + DocumentConverter.TypeKeys( sKeys ) + 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 100755 index 000000000000..381384feb32f --- /dev/null +++ b/testautomation/framework/required/includes/wizard_euroconverter.inc @@ -0,0 +1,138 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: wizard_euroconverter.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:19:04 $ +'* +'* 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..c36cbc1421be --- /dev/null +++ b/testautomation/framework/required/includes/wizard_fax.inc @@ -0,0 +1,106 @@ +'encoding UTF-8 Do not remove or change this line!
+'**************************************************************************
+'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'*
+'* Copyright 2008 by Sun Microsystems, Inc.
+'*
+'* OpenOffice.org - a multi-platform office productivity suite
+'*
+'* $RCSfile: wizard_fax.inc,v $
+'*
+'* $Revision: 1.2 $
+'*
+'* last change: $Author: rt $ $Date: 2008-09-04 09:16:59 $
+'*
+'* 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 )
+ hClickNextButton()
+
+ kontext "AutopilotFax"
+ call DialogTest( AutopilotFax, 2 )
+ hClickNextButton()
+
+ kontext "AutopilotFax"
+ call DialogTest( AutopilotFax, 3 )
+ hClickNextButton()
+
+ kontext "AutopilotFax"
+ call DialogTest( AutopilotFax, 4 )
+ hClickNextButton()
+
+ 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" )
+ endif
+
+ printlog( "Delete the user-template: " & cTemplatePath )
+ hDeleteFile( cTemplatePath )
+
+ else
+ warnlog( "Fax wizard did not open/exceeded timeout" )
+ endif
+
+ while( getDocumentCount() > 0 )
+ hDestroyDocument()
+ wend
+
+
+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..104f683b8442 --- /dev/null +++ b/testautomation/framework/required/includes/wizard_firsttime.inc @@ -0,0 +1,235 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: wizard_firsttime.inc,v $ +'* +'* $Revision: 1.2 $ +'* +'* last change: $Author: rt $ $Date: 2008-08-01 09:48:30 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : 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 + + kontext "TabFirstStartOnlineUpdate" + if ( TabFirstStartOnlineUpdate.exists( 2 ) ) then + call dialogtest( TabFirstStartOnlineUpdate ) + CheckForUpdates.unCheck() + kontext "WelcomeDialog" + NextBtn.click() + else + warnlog( "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..c57cb9588f90 --- /dev/null +++ b/testautomation/framework/required/includes/wizard_letter.inc @@ -0,0 +1,207 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: wizard_letter.inc,v $ +'* +'* $Revision: 1.2 $ +'* +'* last change: $Author: rt $ $Date: 2008-08-01 09:48:44 $ +'* +'* 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() + + hClickNextButton() + + 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 + + hClickNextButton() + + 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 ) + hClickNextButton() + + kontext "AutopilotLetter" + call DialogTest( AutopilotLetter, 4 ) + hClickNextButton() + + 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() + hClickNextButton() + + 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" ) + endif + 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 + + do while( getDocumentCount() > 0 ) + call hCloseDocument() + loop + +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..c3002e62352e --- /dev/null +++ b/testautomation/framework/required/includes/wizard_mailmerge.inc @@ -0,0 +1,1217 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: wizard_mailmerge.inc,v $ +'* +'* $Revision: 1.2 $ +'* +'* last change: $Author: rt $ $Date: 2008-09-04 09:17:13 $ +'* +'* 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" + brc = hClickNextButton() + hUpdtMMWPage2() + + Kontext "MailMergeWizard" + brc = hClickNextButton() + hUpdtMMWpage3() + + Kontext "MailMergeWizard" + brc = hClickNextButton() + hUpdtMMWPage4() + + Kontext "MailMergeWizard" + brc = hClickNextButton() + hUpdtMMWPage5() + + Kontext "MailMergeWizard" + brc = hClickNextButton() + hUpdtMMWPage6() + + Kontext "MailMergeWizard" + brc = hClickNextButton() + hUpdtMMWPage7() + + Kontext "MailMergeWizard" + brc = hClickNextButton() + hUpdtMMWPage8() + + printlog( "close the wizard" ) + Kontext "MailMergeWizard" + 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..5dae9956d035 --- /dev/null +++ b/testautomation/framework/required/includes/wizard_presentation.inc @@ -0,0 +1,81 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: wizard_presentation.inc,v $ +'* +'* $Revision: 1.2 $ +'* +'* last change: $Author: rt $ $Date: 2008-08-01 09:48:58 $ +'* +'* 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 ) + + hClickNextButton() + + printlog( "Page 2" ) + kontext "AutopilotPraesentation2" + call DialogTest( AutopilotPraesentation2 ) + + hClickNextButton() + + printlog( "Page 3" ) + kontext "AutopilotPraesentation3" + call DialogTest( AutopilotPraesentation3 ) + + hFinishWizard( 1 ) + else + warnlog( "Presentation wizard not open/exceeded timeout" ) + endif + + do while( getDocumentCount() > 0 ) + call hCloseDocument() + loop + + gApplication = "WRITER" + +endcase + diff --git a/testautomation/framework/required/includes/wizard_webpage.inc b/testautomation/framework/required/includes/wizard_webpage.inc new file mode 100755 index 000000000000..01c5ead92197 --- /dev/null +++ b/testautomation/framework/required/includes/wizard_webpage.inc @@ -0,0 +1,218 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: wizard_webpage.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 12:19:04 $ +'* +'* 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 + |