diff options
Diffstat (limited to 'testautomation/framework/required/includes')
19 files changed, 758 insertions, 931 deletions
diff --git a/testautomation/framework/required/includes/basic_dialog_i18n.inc b/testautomation/framework/required/includes/basic_dialog_i18n.inc index bb1f0cf496ce..590c45a5f58a 100644..100755 --- a/testautomation/framework/required/includes/basic_dialog_i18n.inc +++ b/testautomation/framework/required/includes/basic_dialog_i18n.inc @@ -34,54 +34,53 @@ testcase tUpdtBasicDialogI18n printlog( "BASIC IDE Dialog i18n." ) + const MODULE_NAME = "tUpdtBasicDialogI18n" + const DIALOG_DEFAULT_TIMEOUT = 2 - dim brc as boolean + kontext "Navigator" + hCloseDialog( Navigator, "close,optional" ) + hCreateDocument() - hCloseNavigator() - hCreateDocument()' - - brc = hInitFormControls( "tDialogI18n" ) - if ( not brc ) then + if ( not hInitFormControls( MODULE_NAME ) ) then warnlog( "Failed to open Basic IDE / Dialogs / ToolsCollectionBar" ) goto endsub endif printlog( "Click Manage Languages on ToolsCollectionBar") kontext "ToolsCollectionBar" - sleep(1) - if ( ToolsCollectionBar.exists() ) then - ManageLanguage.click() + if ( ToolsCollectionBar.exists( DIALOG_DEFAULT_TIMEOUT ) ) then + hClickButton( ManageLanguage ) else warnlog( "<ToolsCollectionBar> is not open, is the test environment dirty?" ) endif kontext "ManageUILanguages" - if ( ManageUILanguages.exists( 2 ) ) then + if ( ManageUILanguages.exists( DIALOG_DEFAULT_TIMEOUT ) ) then call dialogtest( ManageUILanguages ) printlog( "Add default language, choose preselection") kontext "ManageUILanguages" - Add.click() + hClickButton( Add ) kontext "SetDefaultLanguage" - if ( SetDefaultLanguage.exists( 2 ) ) then + if ( SetDefaultLanguage.exists( DIALOG_DEFAULT_TIMEOUT ) ) then call dialogtest( SetDefaultLanguage ) kontext "SetDefaultLanguage" DefaultLanguageListbox.select( 3 ) kontext "SetDefaultLanguage" - SetDefaultLanguage.ok() + hCloseDialog( SetDefaultLanguage, "ok" ) else warnlog( "Dialog <SetDefaultLanguage> did not open" ) - endif + endif printlog( "Back on Manage UI Languages Dialog we click <Add>") kontext "ManageUILanguages" - Add.click() + hClickButton( Add ) kontext "AddUserInterface" - if ( AddUserInterface.exists( 2 ) ) then + if ( AddUserInterface.exists( DIALOG_DEFAULT_TIMEOUT ) ) then call dialogtest( AddUserInterface ) printlog( "Add just another language at random") @@ -90,7 +89,7 @@ testcase tUpdtBasicDialogI18n AddNewControl.typeKeys( "<SPACE>" ) ' check it kontext "AddUserInterface" - AddUserInterface.ok() + hCloseDialog( AddUserInterface, "ok" ) else warnlog( "Dialog <AddUserInterface> did not open" ) endif @@ -100,39 +99,32 @@ testcase tUpdtBasicDialogI18n printlog( "Back on Manage UI Languages Dialog, delete selected language") kontext "ManageUILanguages" - Delete.click() - sleep(1) + hClickButton( Delete ) + printlog( "Confirm delete") kontext "active" - if ( Active.exists( 1 ) ) then + if ( Active.exists( DIALOG_DEFAULT_TIMEOUT ) ) then call dialogtest( active ) kontext "active" - active.ok() + hCloseDialog( active, "ok" ) else warnlog( "Confirm delete messagebox is missing" ) endif printlog( "Leave Manage UI Languages Dialog") kontext "ManageUILanguages" - ManageUILanguages.ok() + hCloseDialog( ManageUILanguages, "ok" ) else warnlog( "Manage UI languages did not open" ) endif printlog( "Verify that the translationbar is visible") kontext "TranslationBar" - if ( not TranslationBar.exists() ) then - warnlog( "The IDE Translation Toolbar is not visible" ) - endif + if ( not TranslationBar.exists() ) then warnlog( "The IDE Translation Toolbar is not visible" ) kontext "ToolsCollectionBar" - if ( not ToolsCollectionBar.exists() ) then - warnlog( "The ToolsCollectionBar is not visible" ) - endif - - printlog( "Cleanup" ) - ToolsCollectionBar.Close + hCloseDialog( ToolsCollectionBar, "close" ) hClosebasicIDE() hDestroyDocument() diff --git a/testautomation/framework/required/includes/basic_dialog_i18n_import.inc b/testautomation/framework/required/includes/basic_dialog_i18n_import.inc index d4069484a0ab..db72863173b8 100644 --- a/testautomation/framework/required/includes/basic_dialog_i18n_import.inc +++ b/testautomation/framework/required/includes/basic_dialog_i18n_import.inc @@ -43,15 +43,19 @@ testcase tBasicDialogI18nImport dim iTry as integer const LANGUAGE_COUNT = 5 + const MAX_RETRIES = 5 + const WAIT_TIME = 100 + const MODULE_NAME = "tDialogI18nImport" + const DIALOG_WAIT_TIMEOUT = 2 + const MSG_LOCALE_CLASH_WARNING_BUTTONCOUNT = 4 + const MSG_DIALOG_REPLACE_WARNING_BUTTONCOUNT = 3 printlog( "Open BASIC-IDE" ) hCreateDocument() - hInitFormControls( "tDialogI18nImport" ) + hInitFormControls( MODULE_NAME ) kontext "ToolsCollectionBar" - if ( ToolsCollectionBar.exists() ) then - ToolsCollectionBar.close() - endif + if ( ToolsCollectionBar.exists() ) then ToolsCollectionBar.close() Kontext "DialogBar" if ( DialogBar.exists() ) then @@ -60,7 +64,7 @@ testcase tBasicDialogI18nImport Import.click() kontext "OeffnenDlg" - if ( OeffnenDlg.exists( 2 ) ) then + if ( OeffnenDlg.exists( DIALOG_WAIT_TIMEOUT ) ) then printlog( "Enter path to test dialog" ) DateiName.setText( cDialogPath ) @@ -68,27 +72,25 @@ testcase tBasicDialogI18nImport printlog( "Test messagebox" ) kontext "active" - if ( Active.exists( 2 ) ) then + if ( Active.exists( DIALOG_WAIT_TIMEOUT ) ) then printlog( "Messagebox: " & Active.getText() ) - if ( Active.getButtonCount() <> 4 ) then + if ( Active.getButtonCount() <> MSG_LOCALE_CLASH_WARNING_BUTTONCOUNT ) then warnlog( "Incorrect messagebox, expected locale clash warning" ) endif call DialogTest( Active ) printlog( "Accept with yes" ) - Active.Yes() - sleep(1) + hCloseDialog( Active, "yes" ) + Kontext "TranslationBar" if ( TranslationBar.exists() ) then - for iTry = 1 to 5 + for iTry = 1 to MAX_RETRIES iNumberOfLanguages = CurrentLanguage.getItemCount() - if ( iNumberOfLanguages = LANGUAGE_COUNT ) then - exit for - endif - wait( 100 ) + if ( iNumberOfLanguages = LANGUAGE_COUNT ) then exit for + wait( WAIT_TIME ) next iTry printlog( "Check number of imported languages" ) @@ -105,7 +107,7 @@ testcase tBasicDialogI18nImport Import.click() kontext "OeffnenDlg" - if ( OeffnenDlg.exists( 2 ) ) then + if ( OeffnenDlg.exists( DIALOG_WAIT_TIMEOUT ) ) then printlog( "Enter path to test dialog" ) DateiName.setText( cDialogPath ) @@ -113,17 +115,17 @@ testcase tBasicDialogI18nImport printlog( "Test messagebox" ) kontext "Active" - if ( Active.exists( 2 ) ) then + if ( Active.exists( DIALOG_WAIT_TIMEOUT ) ) then printlog( "Messagebox: " & Active.getText() ) - if ( Active.getButtonCount() <> 3 ) then + if ( Active.getButtonCount() <> MSG_DIALOG_REPLACE_WARNING_BUTTONCOUNT ) then warnlog( "Incorrect messagebox, expected dialog replace warning" ) endif call DialogTest( Active ) Printlog( "Rename the new dialog" ) - Active.Yes() + hCloseDialog( Active, "yes" ) else warnlog( "Overwrite warning missing" ) endif diff --git a/testautomation/framework/required/includes/basic_macroassignment.inc b/testautomation/framework/required/includes/basic_macroassignment.inc index 2db0c680967c..05967fcfd008 100644..100755 --- a/testautomation/framework/required/includes/basic_macroassignment.inc +++ b/testautomation/framework/required/includes/basic_macroassignment.inc @@ -33,109 +33,94 @@ testcase tUpdtMacroAssignment - printlog( "Update-Test for some dialogs in Basic-IDE" ) - - dim brc as boolean + printlog( "Update test all dialogs from plain document via assign macro dialog to scriptselector" ) + const TABPAGE_EVENTS = 2 + const BASIC_MODULE = "tUpdtMacroAssignment" + const DEFAULT_DIALOG_TIMEOUT = 1 + const RC_TIMEOUT = -1 + + printlog( "New document" ) hCreateDocument() printlog( "Create a new BASIC-module for this document" ) - - 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 + hInitBasicIDE( BASIC_MODULE ) 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" ) - if ( AssignMacro.exists( 1 ) ) then - call dialogtest( AssignMacro ) - printlog( "Click the Assign-Button on the Macro-Assignment-Dialog" ) - AssignButton.click() - - Kontext "ScriptSelector" - printlog( "Current Dialog: ScriptSelector" ) - if ( ScriptSelector.exists( 1 ) ) then - call dialogtest( ScriptSelector ) - printlog( "Cancel the scriptselector" ) - ScriptSelector.cancel() + if ( hNewDialog() ) then + + printlog( "Select the Dialog-Pane from the DialogWindow" ) + if ( hSelectDialogPane() ) then + + printlog( "Show ToolsCollectionBar" ) + if ( hShowMacroControls() ) then + + printlog( "Open the Property-Browser" ) + if ( hOpenPropertyBrowser() ) then + + kontext "TabGeneralControl" + call dialogtest( TabGeneralControl ) + + printlog( "Switch to events-tab" ) + if ( hSetPBTabPage( TABPAGE_EVENTS ) ) then + + printlog( "Current Dialog: Property-Browser / Events-Page" ) + call dialogtest( TabEventsControl ) + + Kontext "TabEventsControl" + printlog( "Click the button for the FocusGained-Event" ) + if ( hClickButton( PBFocusGained ) <> RC_TIMEOUT ) then + + Kontext "AssignMacro" + printlog( "Current Dialog: Assign Macro" ) + if ( AssignMacro.exists( DEFAULT_DIALOG_TIMEOUT ) ) then + + call dialogtest( AssignMacro ) + + printlog( "Click the Assign-Button on the Macro-Assignment-Dialog to open Script Selector" ) + if ( hClickButton( AssignButton ) <> RC_TIMEOUT ) then + + Kontext "ScriptSelector" + if ( ScriptSelector.exists( DEFAULT_DIALOG_TIMEOUT ) ) then + + call dialogtest( ScriptSelector ) + + printlog( "Close Script Selector" ) + hCloseDialog( ScriptSelector, "cancel" ) + + printlog( "Close all remaining dialogs and documents" ) + Kontext "AssignMacro" + hCloseDialog( AssignMacro, "cancel" ) + hClosePropertyBrowser() + hCloseBasicIDE() + hDestroyDocument() + else + warnlog( "Failed to open/access <ScriptSelector>" ) + endif + else + warnlog( "Assign-button is not enabled" ) + endif + else + warnlog( "Failed to open/access <AssignMacro> dialog" ) + endif + else + warnlog( "#i64196# - Events missing on properties tab-page" ) + endif + else + warnlog( "Failed to switch tabpage to Tab-Events" ) + endif else - warnlog( "Failed to open/access <ScriptSelector>" ) + warnlog( "Property-Browser is not open, skipping further testing" ) endif - - Kontext "AssignMacro" - printlog( "Current Dialog: Assign Macro" ) - printlog( "Cancel the Script-Assignement-Dialog" ) - AssignMacro.cancel() else - warnlog( "Failed to open/access <AssignMacro> dialog" ) + warnlog( "ToolsCollectionBar is not open" ) endif - + else + warnlog( "Selecting failed: ToolsCollectionBar is in the way." ) endif - - skipevents: - - printlog( "Current Dialog: Property-Browser" ) - printlog( "Close the Property-Browser, return to the document" ) - brc = hClosePropertyBrowser() - - brc = hCloseBasicIde() - + else + warnlog( "Failed to create a new BASIC-dialog" ) endif - - brc = hDestroyDocument() endcase diff --git a/testautomation/framework/required/includes/basic_organizer.inc b/testautomation/framework/required/includes/basic_organizer.inc index eb33d3a554e3..789d870cb9a6 100644..100755 --- a/testautomation/framework/required/includes/basic_organizer.inc +++ b/testautomation/framework/required/includes/basic_organizer.inc @@ -35,7 +35,6 @@ testcase tUpdtBasicOrganizer printlog( "Update test for the Basic Organizer dialog" ) - dim brc as boolean dim cTempString as string const TESTLIB = "zzzz" @@ -48,7 +47,7 @@ testcase tUpdtBasicOrganizer kontext "Makro" if ( not makro.exists() ) then warnlog( "Macro Organizer is not open, aborting test" ) - brc = hDestroyDocument() + hDestroyDocument() goto endsub else printlog( "Successfully opened the MacroOrganizer" ) @@ -68,7 +67,7 @@ testcase tUpdtBasicOrganizer printlog( "TabModule is not open, the test cannot continue" ) kontext "Makro" Makro.cancel() - brc = hDestroyDocument() + hDestroyDocument() goto endsub endif @@ -125,7 +124,7 @@ testcase tUpdtBasicOrganizer Neu.click() kontext "NeueBibliothek" call DialogTest( NeueBibliothek ) - Bibliotheksname.setText( "zzzz" ) + Bibliotheksname.setText( TESTLIB ) NeueBibliothek.ok() else warnlog( "There is a problem accessing the New Libraries dialog" ) @@ -138,7 +137,7 @@ testcase tUpdtBasicOrganizer Neu.click() kontext "NeueBibliothek" call DialogTest( NeueBibliothek ) - Bibliotheksname.setText( "zzzz" ) + Bibliotheksname.setText( TESTLIB ) NeueBibliothek.ok() else warnlog( "There is a problem accessing the New Libraries dialog" ) @@ -192,7 +191,7 @@ testcase tUpdtBasicOrganizer printlog( "Try to delete the library" ) cTempString = BibliotheksListe.getSelText() - if ( cTempString = "zzzz" ) then + if ( cTempString = TESTLIB ) then printlog( "Delete" ) Loeschen.click() Kontext "Active" @@ -223,8 +222,7 @@ testcase tUpdtBasicOrganizer Makro.cancel() printlog( "Close the document" ) - brc = hDestroyDocument() - + hDestroyDocument() endcase diff --git a/testautomation/framework/required/includes/first.inc b/testautomation/framework/required/includes/first.inc index 0c0b737ffe5d..700cee374104 100644..100755 --- a/testautomation/framework/required/includes/first.inc +++ b/testautomation/framework/required/includes/first.inc @@ -271,62 +271,129 @@ endcase '******************************************************************************* -function fDocumentCheck (SollFilter as String) as boolean +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 + if ( SpeichernDlg.exists( 1 ) ) then + sFiltername = DateiTyp.GetItemText (1) + if (Instr(lcase(sFiltername), lcase (SollFilter)) <> 0) then + fDocumentCheck() = TRUE + else + printlog("Filter names do not match:") + printlog("Found: [" & sFilterName & "]") + printlog("Expected: [" & SollFilter & "]") + SollFilter = sFiltername + fDocumentCheck() = FALSE + end if + SpeichernDlg.Cancel() else - printlog("Filter names do not match:") - printlog("Found: [" & sFilterName & "]") - printlog("Expected: [" & SollFilter & "]") - SollFilter = sFiltername + warnlog( "Dialog <File Save As> did not open" ) fDocumentCheck() = FALSE - end if - SpeichernDlg.Cancel() + endif end function '******************************************************************************* -testcase tHelpRegistration +testcase tInFilterCountCompare() - ' Check i69670 which was a showstopper in OOo 2.0.4 - ' Menu-entry "Help / Registration" is disabled + printlog( "Check filterlist (filterstring) for graphics files" ) - 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 + const FILE_NAME = "graphic_filters.txt" + const SUFFIX_STRING_LENGTH = 178 + +' List of filter suffixes for verification in case of error +' *.bmp;*.dxf;*.emf;*.eps;*.gif;*.jpg;*.jpeg;*.jfif;*.jif;*.met;*.pbm;*.pcd; +' *.pct;*.pcx;*.pgm;*.png;*.ppm;*.psd;*.ras;*.sgf;*.sgv;*.svm;*.tga;*.tif; +' *.tiff;*.wmf;*.xbm;*.xpm;*.pict + + dim caUIFilters( 30 ) as string + + dim cReferencePath as string + cReferencePath = gTesttoolPath & "global/input/filters/" + cReferencePath = convertpath ( cReferencePath & FILE_NAME ) + + dim cUIFiltersPath as string + cUIFiltersPath = hGetWorkPath() & FILE_NAME + + dim iCurrentFilter as integer + dim iFilterCount as integer + + dim cAllFormats as string + + dim irc as integer + dim iBegin as integer + dim iEnd as integer + + printlog( "" ) + printlog( "Verify filternames listed on the Insert Graphics dialog" ) + + hCreateDocument() + hChangeDoc() + + InsertGraphicsFromFile + + kontext "GrafikEinfuegenDlg" + if ( GrafikEinfuegenDlg.exists( 1 ) ) then + iFilterCount = DateiTyp.getItemCount() + + 'Make list compatible with listfunctions + caUIFilters( 0 ) = iFilterCount - 1 + + for iCurrentFilter = 2 to iFilterCount + + caUIFilters( iCurrentFilter - 1 ) = DateiTyp.getItemText( iCurrentFilter ) + + next iCurrentFilter + + irc = hManageComparisionList( cReferencePath, cUIFiltersPath, caUIFilters() ) + hListResultEvaluation( irc , 0 ) + + printlog( "" ) + printlog( "Verify <All formats>-string" ) + cAllFormats = DateiTyp.getItemText( 1 ) + + iBegin = instr( cAllFormats, "<" ) + if ( iBegin <> 1 ) then + warnlog( "The opening bracket < is missing in <All formats> string" ) + endif + + iEnd = instr( cAllFormats, ">" ) + if ( iEnd = 0 ) then + warnlog( "The closing bracket > is missing in <All formats> string" ) + endif + + if ( ( iEnd - iBegin ) < 2 ) then + warnlog( "<All formats> string is shorter than expected, please check" ) + printlog( "String is: " & cAllFormats & ", length (" & len( cAllFormats ) & ")" ) endif - next iCurrentMenuEntry - hMenuClose() - call hCloseDocument -endcase + 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/graphics_import.inc b/testautomation/framework/required/includes/graphics_import.inc deleted file mode 100644 index a2a92f961274..000000000000 --- a/testautomation/framework/required/includes/graphics_import.inc +++ /dev/null @@ -1,314 +0,0 @@ -'encoding UTF-8 Do not remove or change this line! -'******************************************************************************* -' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -' -' Copyright 2000, 2010 Oracle and/or its affiliates. -' -' OpenOffice.org - a multi-platform office productivity suite -' -' This file is part of OpenOffice.org. -' -' OpenOffice.org is free software: you can redistribute it and/or modify -' it under the terms of the GNU Lesser General Public License version 3 -' only, as published by the Free Software Foundation. -' -' OpenOffice.org is distributed in the hope that it will be useful, -' but WITHOUT ANY WARRANTY; without even the implied warranty of -' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -' GNU Lesser General Public License version 3 for more details -' (a copy is included in the LICENSE file that accompanied this code). -' -' You should have received a copy of the GNU Lesser General Public License -' version 3 along with OpenOffice.org. If not, see -' <http://www.openoffice.org/license.html> -' for a copy of the LGPLv3 License. -' -'/****************************************************************************** -'* -'* owner : joerg.skottke@sun.com -'* -'* short description : 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 index 0b8b80bcbdaf..62438373dc37 100644..100755 --- a/testautomation/framework/required/includes/help_browser.inc +++ b/testautomation/framework/required/includes/help_browser.inc @@ -154,3 +154,42 @@ testcase tHelp_ToolBar brc = hCloseHelp() endcase + +'******************************************************************************* + +testcase tHelp_Registration + + ' Check i69670 which was a showstopper in OOo 2.0.4 + ' Menu-entry "Help / Registration" is disabled + + dim iCurrentMenuEntry as integer + dim iMenuEntryCount as integer + + printlog "Check if all entries in Help Menu are enabled" + call hNewDocument + + printlog "Open menu" + hUseMenu() + iMenuEntryCount = hMenuItemGetCount + + printlog "Select the last entry 'Help'" + hMenuSelectNr( iMenuEntryCount ) + iMenuEntryCount = hMenuItemGetCount + for iCurrentMenuEntry = 1 to iMenuEntryCount + if ( hMenuItemIsEnabled( iCurrentMenuEntry ) ) then + printlog "(" & iCurrentMenuEntry & "/" & iMenuEntryCount & _ + "): Menu entry is enabled: Help-> " & hMenuItemGetText( iCurrentMenuEntry ) + else + if (lcase(gPlatform) = "osx") then + warnlog "#i86247# Help->Registration is disabled on MacOS X" + else + warnlog "(" & iCurrentMenuEntry & "/" & iMenuEntryCount & _ + "): Menu entry is not enabled: Help-> " & hMenuItemGetText( iCurrentMenuEntry ) + endif + endif + next iCurrentMenuEntry + hMenuClose() + call hCloseDocument + +endcase + diff --git a/testautomation/framework/required/includes/script_organizers.inc b/testautomation/framework/required/includes/script_organizers.inc index 6d14b7f77f6e..6082a3313ce0 100755 --- a/testautomation/framework/required/includes/script_organizers.inc +++ b/testautomation/framework/required/includes/script_organizers.inc @@ -37,39 +37,32 @@ testcase tUpdtScriptCount printlog( "Resource test for macros and scripts / related dialogs" ) const SCRIPTING_DIALOGS = 5 + dim aScriptCount( SCRIPTING_DIALOGS ) - ' JavaScript - aScriptCount( 1 ) = 10 - ' BeanShell - aScriptCount( 2 ) = 14 - if ( lcase( gPlatform ) = "osx" ) then - ' Python - aScriptCount( 3 ) = 8 - else - ' Python - aScriptCount( 3 ) = 10 - endif - if ( lcase( gPlatform ) = "osx" ) then - ' Run Macro - aScriptCount( 5 ) = 600 - else - ' Run Macro - aScriptCount( 5 ) = 602 - endif - if ( gOOo ) then - ' Makro Organizer - aScriptCount( 4 ) = 585 - ' Run Macro - aScriptCount( 5 ) = aScriptCount( 5 ) - 1 - else - ' Makro Organizer - aScriptCount( 4 ) = 586 - endif + + aScriptCount( 1 ) = 10 ' JavaScript + aScriptCount( 2 ) = 14 ' BeanShell + + if ( lcase( gPlatform ) = "osx" ) then + aScriptCount( 3 ) = 8 ' Python + aScriptCount( 5 ) = 600 ' Run Macro + else + aScriptCount( 3 ) = 10 ' Python + aScriptCount( 5 ) = 602 ' Run Macro + endif + + if ( gOOo ) then + aScriptCount( 4 ) = 585 ' Makro Organizer + aScriptCount( 5 ) = aScriptCount( 5 ) - 1 ' Run Macro + else + ' Makro Organizer + aScriptCount( 4 ) = 586 + endif dim iCurrentDialog as integer dim iCurrentScriptCount as integer - hInitSingleDoc() + hInitSingleDoc() for iCurrentDialog = 1 to SCRIPTING_DIALOGS @@ -104,7 +97,7 @@ testcase tUpdtScriptCount ScriptSelector.cancel() end select - printlog sDialog + printlog( sDialog ) if ( aScriptCount( iCurrentDialog ) <> iCurrentScriptCount ) then warnlog( "Incorrect number of scripts for this dialog: '" + sDialog + "' expected:" + aScriptCount( iCurrentDialog ) + ", but is:" & iCurrentScriptCount ) @@ -122,13 +115,13 @@ endcase function hGetScriptCount( oTree as object, oList as object ) as integer - dim iTreeItem as integer - dim iScript as integer : iScript = 0 + dim iCurrentTreeItem as integer + dim iScriptCount as integer : iScriptCount = 0 - for iTreeItem = 1 to oTree.getItemCount() - oTree.select( iTreeItem ) - iScript = iScript + oList.getItemCount() - next iTreeItem - hGetScriptCount() = iScript + for iCurrentTreeItem = 1 to oTree.getItemCount() + oTree.select( iCurrentTreeItem ) + iScriptCount = iScriptCount + oList.getItemCount() + next iCurrentTreeItem + hGetScriptCount() = iScriptCount end function diff --git a/testautomation/framework/required/includes/scripting_basics.inc b/testautomation/framework/required/includes/scripting_basics.inc new file mode 100755 index 000000000000..d5377c4873bd --- /dev/null +++ b/testautomation/framework/required/includes/scripting_basics.inc @@ -0,0 +1,74 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Quick short test for the scripting framework +'* +'\****************************************************************************** + +testcase tScripting + + printlog( "Verify that the nodes <My Macros> and <OOo Macros> are present" ) + + const ORGANIZER_ITEMS = 2 + const MAX_DIALOG_DELAY = 5 + + hFileCloseAll() + + ToolsMacrosOrganizeMacrosBeanShell + + Kontext "ScriptOrganizer" + if ( ScriptOrganizer.exists( MAX_DIALOG_DELAY ) ) then + printlog( "Beanshell Script Organizer is present. Good" ) + if ( ScriptTreeList.getItemCount() <> ORGANIZER_ITEMS ) then + warnlog( "The Treelist does not contain the expected number " & _ + "of items. Please verify that exactly " & ORGANIZER_ITEMS & " top-nodes exist" ) + endif + hCloseDialog( ScriptOrganizer, "cancel" ) + else + warnlog( "Script Organizer for Beanshell is missing" ) + endif + + ToolsMacrosOrganizeMacrosJavaScript + + Kontext "ScriptOrganizer" + if ( ScriptOrganizer.exists( MAX_DIALOG_DELAY ) ) then + printlog( "JavaScript Script Organizer is present. Good" ) + if ( ScriptTreeList.getItemCount() <> ORGANIZER_ITEMS ) then + warnlog( "The Treelist does not contain the expected number " & _ + "of items. Please verify that exactly " & ORGANIZER_ITEMS & " top-nodes exist" ) + endif + hCloseDialog( ScriptOrganizer, "cancel" ) + else + warnlog( "Script Organizer for JavaScript is missing" ) + endif + +endcase + + + diff --git a/testautomation/framework/required/includes/standard_toolbar_4.inc b/testautomation/framework/required/includes/standard_toolbar_4.inc index d853e98d0b03..3f393ff3291a 100644..100755 --- a/testautomation/framework/required/includes/standard_toolbar_4.inc +++ b/testautomation/framework/required/includes/standard_toolbar_4.inc @@ -34,24 +34,32 @@ testcase tStandardBar_4 printlog( "Invisible items on the standardbar" ) - - dim brc as boolean - + + printlog( "Reset standardbar to defaults" ) hResetStandardBar() - + + gApplication = "WRITER" + printlog( "Open one single Writer document" ) hInitSingleDoc() + + kontext "DocumentWriter" DocumentWriter.maximize() ' Needed to avoid toolbar clipping on resolutions < 1024x768 or small windows. + + printlog( "Check item count on toolbar" ) hStandardbarItemGetCount() - + + printlog( "Load URL" ) hStandardbarLoadUrl() - + + printlog( "<NEW> dialog" ) hStandardbarNewDialog() - + + printlog( "<Save As>" ) hStandardbarSaveAs() - - brc = hInitBackingMode() - + printlog( "Close all open documents" ) + hFileCloseAll() + endcase diff --git a/testautomation/framework/required/includes/standard_toolbar_6.inc b/testautomation/framework/required/includes/standard_toolbar_6.inc index a72d8df3a36f..c3ff6be6e849 100644..100755 --- a/testautomation/framework/required/includes/standard_toolbar_6.inc +++ b/testautomation/framework/required/includes/standard_toolbar_6.inc @@ -116,10 +116,12 @@ testcase tStandardBar_6 kontext "documentwriter" DocumentWriter.TypeKeys( "Hallo" ) - hCloseNavigator() + kontext "Navigator" + hCloseDialog( Navigator, "close,optional" ) hDestroyDocument() - hCloseNavigator() + kontext "Navigator" + hCloseDialog( Navigator, "close,optional" ) hDestroyDocument() printlog " - Math" diff --git a/testautomation/framework/required/includes/tools_customize.inc b/testautomation/framework/required/includes/tools_customize.inc index 0db4af9fc487..6bf31e391f99 100644..100755 --- a/testautomation/framework/required/includes/tools_customize.inc +++ b/testautomation/framework/required/includes/tools_customize.inc @@ -34,7 +34,6 @@ testcase tUpdtCustomize( cApp as string ) printlog( "Tools/Customize dialog" ) - const CLOSE_METHOD = 1 ' 1 = Cancel button if ( hCreateDocument() ) then if ( hToolsCustomizeOpen() ) then @@ -42,7 +41,7 @@ testcase tUpdtCustomize( cApp as string ) hUpdtToolsCustomizeMenu() hUpdtToolsCustomizeToolbars() hUpdtToolsCustomizeEvents() - hToolsCustomizeClose( CLOSE_METHOD ) + hCloseDialog( TabCustomizeEvents, "cancel" ) else warnlog( "Tools/Customize dialog did not open" ) endif @@ -57,10 +56,19 @@ endcase function hUpdtToolsCustomizeMenu() - - const CFN = "hUpdtToolsCustomizeMenu::" + + const MENUITEM_MOVE = 1 + const MENUITEM_ADDSUBMENU = 1 + const MENUITEM_RENAME = 2 + const MENUITEM_DELETE = 3 + const MENUITEM_MODIFY = 2 + const MENUITEM_MODIFY_LARGE_MENU = 4 + + const APPLICATION_ONLY = 1 + const APPLICATION_AND_DOCUMENT = 2 const ITEMNAME = "tUpdtCustomize" + dim brc as boolean dim iItems as integer @@ -71,7 +79,7 @@ function hUpdtToolsCustomizeMenu() printlog( "" ) printlog( "Menu" ) - brc = hToolsCustomizeSelectTab( "Menu" ) + hToolsCustomizeSelectTab( "Menu" ) call DialogTest( TabCustomizeMenu ) printlog( CFN & "Click New..." ) @@ -79,48 +87,56 @@ function hUpdtToolsCustomizeMenu() 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() + if ( MenuOrganiser.exists( 2 ) ) then + printlog( CFN & "MenuOrganiser" ) + call DialogTest( MenuOrganiser ) + + printlog( CFN & "Down..." ) + ButtonDown.click() + + printlog( CFN & "Up..." ) + ButtonUp.click() + + printlog( CFN & "Name the new menu" ) + MenuName.setText( "tUpdtCustomize" ) + + 'qaerrorlog( "#i60609# Undeclared listbox in menu organiser" ) + printlog( "TODO: Access the listbox in menuorganizer" ) + + printlog( CFN & "Close the menu with ok" ) + hCloseDialog( MenuOrganiser, "ok" ) + else + warnlog( "Dialog <MenuOrganiser> did not open" ) + endif printlog( CFN & "Click the menu listbutton" ) kontext "TabCustomizeMenu" hOpenMenuButton( MenuBtn ) ' MenuBtn.OpenMenu() printlog( CFN & "Select Move..." ) - hMenuSelectNr( 1 ) + hMenuSelectNr( MENUITEM_MOVE ) kontext "MenuOrganiser" - printlog( CFN & "Click UP" ) - ButtonUp.click() - - kontext "MenuOrganiser" - printlog( CFN & "Click DOWN" ) - ButtonDown.click() + if ( MenuOrganiser.exists( 2 ) ) then + printlog( CFN & "Click UP" ) + ButtonUp.click() - printlog( CFN & "Cancel the dialog" ) - MenuOrganiser.cancel() + kontext "MenuOrganiser" + printlog( CFN & "Click DOWN" ) + ButtonDown.click() + + printlog( CFN & "Cancel the dialog" ) + hCloseDialog( MenuOrganiser, "cancel" ) + else + warnlog( "Dialog <MenuOrganizer> did not open" ) + endif printlog( CFN & "Click the menu listbutton" ) kontext "TabCustomizeMenu" hOpenMenuButton( MenuBtn ) ' MenuBtn.OpenMenu() printlog( CFN & "Select Rename..." ) - hMenuSelectNr( 2 ) + hMenuSelectNr( MENUITEM_RENAME ) printlog( CFN & "Cancel the renaming-dialog" ) kontext "RenameMenu" @@ -131,7 +147,7 @@ function hUpdtToolsCustomizeMenu() hOpenMenuButton( MenuBtn ) ' MenuBtn.OpenMenu() printlog( CFN & "Select Delete" ) - hMenuSelectNr( 3 ) + hMenuSelectNr( MENUITEM_DELETE ) kontext "TabCustomizeMenu" hUpdtToolsCustomizeScriptSelector( 3 ) @@ -139,12 +155,10 @@ function hUpdtToolsCustomizeMenu() printlog( CFN & "Check itemcount in SaveIn List" ) kontext "TabCustomizeMenu" select case gApplication - case "BACKGROUND" : brc = hToolsCustomizeTestSaveIn( 1 ) - case else : brc = hToolsCustomizeTestSaveIn( 2 ) + case "BACKGROUND" : brc = hToolsCustomizeTestSaveIn( APPLICATION_ONLY ) + case else : brc = hToolsCustomizeTestSaveIn( APPLICATION_AND_DOCUMENT ) end select - if ( not brc ) then - warnlog( "Incorrect itemcount in listbox, see above" ) - endif + if ( not brc ) then warnlog( "Incorrect itemcount in listbox, see above" ) printlog( CFN & "Down..." ) BtnDown.click() @@ -154,8 +168,8 @@ function hUpdtToolsCustomizeMenu() printlog( CFN & "Click the Modify-Button and select item 1 (Add submenu)" ) kontext "TabCustomizeMenu" - brc = hClickCommandButton( 1 ) - if ( not brc ) then + + if ( not hClickCommandButton( MENUITEM_ADDSUBMENU ) ) then warnlog( CFN & "Something went wrong when accessing the command button" ) exit function endif @@ -182,8 +196,8 @@ function hUpdtToolsCustomizeMenu() printlog( CFN & "Click the Modify-Button and select to rename the item" ) kontext "TabCustomizeMenu" - brc = hClickCommandButton( 3 ) - if ( not brc ) then + + if ( not hClickCommandButton( 3 ) ) then warnlog( CFN & "Something went wrong when accessing the command button" ) exit function endif @@ -202,16 +216,16 @@ function hUpdtToolsCustomizeMenu() printlog( CFN & "Click the Modify-Button and delete the current item" ) kontext "TabCustomizeMenu" - brc = hClickCommandButton( 4 ) - if ( not brc ) then + + if ( not hClickCommandButton( MENUITEM_MODIFY_LARGE_MENU ) ) then warnlog( CFN & "Something went wrong when accessing the command button" ) exit function endif printlog( CFN & "Click the Modify-Button and create a new group" ) kontext "TabCustomizeMenu" - brc = hClickCommandButton( 2 ) - if ( not brc ) then + + if ( not hClickCommandButton( MENUITEM_MODIFY ) ) then warnlog( CFN & "Something went wrong when accessing the command button" ) exit function endif @@ -219,8 +233,8 @@ function hUpdtToolsCustomizeMenu() ' 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 + + if ( not hClickCommandButton( MENUITEM_MODIFY ) ) then warnlog( CFN & "Something went wrong when accessing the command button" ) exit function endif @@ -231,13 +245,18 @@ end function function hUpdtToolsCustomizeToolbars() + const CFN = "hUpdtToolsCustomizeToolbars::" + const DOCUMENT_ONLY = 1 + const APPLICATION_AND_DOCUMENT = 2 + const MENUITEM_RENAME = 1 + const MENUITEM_DELETE = 2 + const MENUITEM_MODIFY = 4 + const DIALOG_DELAY = 3 - const CFN = "hUpdtToolsCustomizeToolbars::" dim brc as boolean - dim iCurrentItem as integer printlog( "" ) @@ -251,23 +270,22 @@ function hUpdtToolsCustomizeToolbars() BtnNew.click() kontext "NewToolbar" - if ( NewToolbar.exists( 2 ) ) then + if ( NewToolbar.exists( DIALOG_DELAY ) ) then printlog( CFN & "NewToolbar" ) call DialogTest( NewToolbar ) select case gApplication - case "BACKGROUND" : brc = hToolsCustomizeTestSaveIn( 1 ) - case else : brc = hToolsCustomizeTestSaveIn( 2 ) + case "BACKGROUND" : brc = hToolsCustomizeTestSaveIn( DOCUMENT_ONLY ) + case else : brc = hToolsCustomizeTestSaveIn( APPLICATION_AND_DOCUMENT ) end select - if ( not brc ) then - warnlog( "Incorrect itemcount in listbox, see above" ) - endif + + if ( not brc ) then warnlog( "Incorrect itemcount in listbox, see above" ) printlog( CFN & "Name the new toolbar for further usage" ) ToolbarName.setText( "tUpdtCustomize" ) printlog( CFN & "Close NewToolbar dialog with OK" ) - NewToolbar.ok() + hCloseDialog( NewToolbar, "ok" ) else warnlog( CFN & "Could not access New Toolbar dialog" ) endif @@ -277,13 +295,13 @@ function hUpdtToolsCustomizeToolbars() hOpenMenuButton( MenuBtn ) ' MenuBtn.OpenMenu() printlog( "Select rename" ) - hMenuSelectNr( 1 ) + hMenuSelectNr( MENUITEM_RENAME ) printlog( CFN & "Cancel the dialog" ) kontext "RenameToolbar" - if ( RenameToolbar.exists( 2 ) ) then + if ( RenameToolbar.exists( DIALOG_DELAY ) ) then call dialogtest( RenameToolbar ) - RenameToolbar.Cancel() + hCloseDialog( RenameToolbar, "Cancel" ) else warnlog( CFN & "Could not access Toolbar renaming dialog" ) endif @@ -293,19 +311,18 @@ function hUpdtToolsCustomizeToolbars() hOpenMenuButton( MenuBtn ) ' MenuBtn.OpenMenu() printlog( "Select delete" ) - hMenuSelectNr( 2 ) + hMenuSelectNr( MENUITEM_DELETE ) kontext "TabCustomizeToolbars" hUpdtToolsCustomizeScriptSelector( 2 ) kontext "TabCustomizeToolbars" select case gApplication - case "BACKGROUND" : brc = hToolsCustomizeTestSaveIn( 1 ) - case else : brc = hToolsCustomizeTestSaveIn( 2 ) + case "BACKGROUND" : brc = hToolsCustomizeTestSaveIn( DOCUMENT_ONLY ) + case else : brc = hToolsCustomizeTestSaveIn( APPLICATION_AND_DOCUMENT ) end select - if ( not brc ) then - warnlog( "Incorrect itemcount in listbox, see above" ) - endif + + if ( not brc ) then warnlog( "Incorrect itemcount in listbox, see above" ) printlog( CFN & "Down..." ) if ( BtnDown.isEnabled() ) then @@ -326,7 +343,7 @@ function hUpdtToolsCustomizeToolbars() AddCommands.click() kontext "ScriptSelector" - if ( ScriptSelector.exists( 5 ) ) then + if ( ScriptSelector.exists( DIALOG_DELAY ) ) then call dialogtest( ScriptSelector ) @@ -339,14 +356,11 @@ function hUpdtToolsCustomizeToolbars() printlog( CFN & "Add the default item" ) try kontext "ScriptSelector" - ScriptSelector.ok() + hCloseDialog( ScriptSelector, "ok" ) catch qaerrorlog( "#i79207# Could not access ok button on ScriptSelector" ) kontext "ScriptSelector" - if ( ScriptSelector.exists( 2 ) ) then - printlog( "Scriptselector is open" ) - endif - + if ( ScriptSelector.exists( DIALOG_DELAY ) ) then printlog( "Scriptselector is open" ) endcatch else @@ -354,47 +368,41 @@ function hUpdtToolsCustomizeToolbars() for iCurrentItem = 1 to 5 printlog( CFN & "LibraryTreeList: Moving down..." ) LibraryTreeList.typeKeys( "<DOWN>" ) - if ( ScriptSelector.isEnabled() ) then - exit for - endif + if ( ScriptSelector.isEnabled() ) then exit for 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 ) + '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 + hCloseDialog( ScriptSelector, "cancel" ) kontext "TabCustomizeToolbars" printlog( CFN & "Click the Modify-button" ) - brc = hClickCommandButton( 1 ) - if ( not brc ) then + + if ( not hClickCommandButton( 1 ) ) then warnlog( CFN & "Something went wrong when accessing the command button" ) exit function endif printlog( CFN & "Rename the item" ) + UseBindings kontext "CustomizeToolbarsRename" - if ( CustomizeToolbarsRename.exists( 2 ) ) then + if ( CustomizeToolbarsRename.exists( DIALOG_DELAY ) ) then call dialogtest( CustomizeToolbarsRename ) EingabeFeld.setText( "Renamed item" ) printlog( CFN & "Close the dialog" ) - CustomizeToolbarsRename.ok() + hCloseDialog( CustomizeToolbarsRename, "ok" ) else warnlog( CFN & "CustomizeToolbarsRename could not be accessed" ) endif kontext "TabCustomizeToolbars" - brc = hClickCommandButton( 2 ) - if ( not brc ) then + + if ( not hClickCommandButton( 2 ) ) then warnlog( CFN & "Something went wrong when accessing the command button" ) exit function endif @@ -405,8 +413,8 @@ function hUpdtToolsCustomizeToolbars() printlog( "******************** 1 ********************" ) hDeselectSeparator() printlog( "******************** 2 ********************" ) - brc = hClickCommandButton( 3 ) - if ( not brc ) then + + if ( not hClickCommandButton( 3 ) ) then warnlog( CFN & "Something went wrong when accessing the command button" ) exit function endif @@ -414,8 +422,8 @@ function hUpdtToolsCustomizeToolbars() kontext "TabCustomizeToolbars" waitslot printlog( CFN & "Click the Modify-button" ) - brc = hClickCommandButton( 4 ) - if ( not brc ) then + +if ( not hClickCommandButton( MENUITEM_MODIFY ) ) then warnlog( CFN & "Something went wrong when accessing the command button" ) exit function endif @@ -423,8 +431,8 @@ function hUpdtToolsCustomizeToolbars() kontext "TabCustomizeToolbars" WaitSlot printlog( CFN & "Click the Modify-button" ) - brc = hClickCommandButton( 1 ) - if ( not brc ) then + + if ( not hClickCommandButton( 1 ) ) then warnlog( CFN & "Something went wrong when accessing the command button" ) exit function endif @@ -435,26 +443,26 @@ function hUpdtToolsCustomizeToolbars() printlog( "******************** 3 ********************" ) hDeselectSeparator() printlog( "******************** 4 ********************" ) - brc = hClickCommandButton( 5 ) - if ( not brc ) then + + if ( not hClickCommandButton( 5 ) ) 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 + if ( ChangeIcon.exists( DIALOG_DELAY ) ) then call dialogtest( ChangeIcon ) import.click() printlog( CFN & "Cancel the FileOpen-dialog" ) kontext "OeffnenDlg" call dialogtest( OeffnenDlg ) - OeffnenDlg.cancel() + hCloseDialog( OeffnenDlg, "cancel" ) - printlog( CFN & "Cancel the Change Icon dialog" ) + printlog( CFN & "Close the Change Icon dialog with <ok>" ) kontext "ChangeIcon" - ChangeIcon.ok() + hCloseDialog( ChangeIcon, "ok" ) else warnlog( CFN & "Could not access Change Icon dialog" ) endif @@ -462,8 +470,8 @@ function hUpdtToolsCustomizeToolbars() kontext "TabCustomizeToolbars" waitslot printlog( CFN & "Click the Modify-button" ) - brc = hClickCommandButton( 3 ) - if ( not brc ) then + + if ( not hClickCommandButton( 3 ) ) then warnlog( CFN & "Something went wrong when accessing the command button" ) exit function endif @@ -475,59 +483,68 @@ end function function hUpdtToolsCustomizeEvents() - - - - const CFN = "hUpdtToolsCustomizeEvents::" + const APPLICATION_ONLY = 1 + const APPLICATION_AND_DOCUMENT = 2 + const TAB_EVENTS = 1 + dim brc as boolean printlog( "" ) printlog( "Events" ) - 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 + hToolsCustomizeSelectTab( "events" ) + if ( TabCustomizeEvents.exists() ) then + if ( TabCustomizeEvents.isVisible() ) then + call DialogTest( TabCustomizeEvents ) -end function + hUpdtToolsCustomizeScriptSelector( TAB_EVENTS ) -'******************************************************************************* + kontext "TabCustomizeEvents" + select case gApplication + case "BACKGROUND" : brc = hToolsCustomizeTestSaveIn( APPLICATION_ONLY ) + case else : brc = hToolsCustomizeTestSaveIn( APPLICATION_AND_DOCUMENT ) + end select -function hUpdtToolsCustomizeKeyboard() as boolean + if ( not brc ) then warnlog( "Incorrect itemcount in listbox, see above" ) + else + warnlog( "<TabCustomizeEvents> is not visible" ) + endif + else + warnlog( "<TabCustomizeEvents> did not open" ) + endif +end function +'******************************************************************************* +function hUpdtToolsCustomizeKeyboard() as boolean const CFN = "hUpdtToolsCustomizeKeyboard::" - dim brc as boolean + const FIRST_CHANGEABLE_ITEM = 2 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 + + if ( gApplication = "BACKGROUND" ) then + if ( not hToolsCustomizeSelectTab( "keyboard" ) ) then + qaerrorlog( "#i61765# TabTastatur is missing when called from Backing Window" ) + hUpdtToolsCustomizeKeyboard() = false + exit function + endif endif - + + hToolsCustomizeSelectTab( "keyboard" ) + + kontext "TabTastatur" call DialogTest( TabTastatur ) ' no verification of functionality, this is an update test! + kontext "TabTastatur" StarOffice.check() - hSelectNode( Tastatur , 2 ) + hSelectNode( Tastatur , FIRST_CHANGEABLE_ITEM ) 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. @@ -537,12 +554,8 @@ function hUpdtToolsCustomizeKeyboard() as boolean loop Aendern.click() - - Zuruecksetzen.click() - - hSelectNode( Tastatur , 2 ) - waitslot + hSelectNode( Tastatur , FIRST_CHANGEABLE_ITEM ) ' Workaround: It might still happen that the currently selected accelerator ' is "fixed" so we need to find another one that can be modified. @@ -552,64 +565,65 @@ function hUpdtToolsCustomizeKeyboard() as boolean loop Aendern.click() - Loeschen.click() - Speichern.click() kontext "SpeichernDlg" - SpeichernDlg.cancel() + hCloseDialog( SpeichernDlg, "cancel" ) kontext "TabTastatur" Laden.click() kontext "OeffnenDlg" - OeffnenDlg.cancel() - + hCloseDialog( OeffnenDlg, "cancel" ) end function '******************************************************************************* -function hUpdtToolsCustomizeScriptSelector( iBtn as integer ) as boolean - - - - +function hUpdtToolsCustomizeScriptSelector( iPageButton 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() + dim brc as boolean : brc = true + const TAB_EVENTS = 1 + const TAB_TOOLBARS = 2 + const TAB_MENU = 3 + const DIALOG_DELAY = 2 + + select case iPageButton + case TAB_EVENTS + kontext "TabCustomizeEvents" + printlog( CFN & "Assign Macro... (1)" ) + AssignMacro.click() + case TAB_TOOLBARS + kontext "TabCustomizeToolbars" + printlog( CFN & "Add... (2)" ) + AddCommands.click() + case TAB_MENU + kontext "TabCustomizeMenu" + printlog( CFN & "Add... (3)" ) + AddCommands.click() case else - warnlog( CFN & "Invalid function parameter" ) - brc = false + warnlog( CFN & "Invalid function parameter" ) + hUpdtToolsCustomizeScriptSelector() = false + exit function end select - if ( brc ) then - kontext "ScriptSelector" + kontext "ScriptSelector" + if ( ScriptSelector.exists( DIALOG_DELAY ) ) then call DialogTest( ScriptSelector ) - + kontext "ScriptSelector" - ScriptSelector.cancel() - + hCloseDialog( ScriptSelector, "cancel" ) + else + warnlog( CFN & "Dialog <ScriptSelector> did not open" ) endif - select case iBtn - case 1 : kontext "TabCustomizeEvents" - case 2 : kontext "TabCustomizeToolbars" - case 3 : kontext "TabCustomizeMenu" + select case iPageButton + case TAB_EVENTS : kontext "TabCustomizeEvents" + case TAB_TOOLBARS : kontext "TabCustomizeToolbars" + case TAB_MENU : kontext "TabCustomizeMenu" end select hUpdtToolsCustomizeScriptSelector() = brc @@ -619,9 +633,6 @@ end function '******************************************************************************* function hToolsCustomizeTestSaveIn( iItems as integer ) as boolean - - - const CFN = "hToolsCustomizeTestSaveIn::" dim iPresentItems as integer @@ -661,15 +672,18 @@ function hOpenMenuButton( oControl as object ) as integer dim bUseSlowMethod as boolean : bUseSlowMethod = false const CFN = "hOpenMenuButton: " + const RC_FAILURE = -1 + const MAX_RETRIES = 3 + const DEFAULT_DELAY = 1000 - hOpenMenuButton() = -1 ' this is the general failure returnvalue + hOpenMenuButton() = RC_FAILURE - for iClick = 1 to 3 + for iClick = 1 to MAX_RETRIES if ( bUseSlowMethod ) then - wait( 1000 ) + wait( DEFAULT_DELAY ) oControl.OpenMenu() - wait( 3000 ) + wait( DEFAULT_DELAY * 3 ) else oControl.click() endif diff --git a/testautomation/framework/required/includes/tools_options.inc b/testautomation/framework/required/includes/tools_options.inc index 0b226db7e7b0..82d5ef6ae861 100644..100755 --- a/testautomation/framework/required/includes/tools_options.inc +++ b/testautomation/framework/required/includes/tools_options.inc @@ -59,24 +59,29 @@ testcase tUpdtOptionItems 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 ) ) + if ( ExtrasOptionenDlg.exists( 2 ) ) then + + iAppItems = Optionsliste.getItemCount() + Optionsliste.typeKeys( "<HOME>" ) + for iNodes = 1 to iAppItems + Optionsliste.typeKeys( "-" ) + Optionsliste.typeKeys( "<DOWN>" ) + next iNodes + + iAppItems = Optionsliste.getItemCount() + if ( iAppItems <> iAppCount( iDocType ) ) then + warnlog( "#i68068# The number of top nodes in Tools/Options is incorrect." ) + printlog( "Found...: " & iAppItems ) + printlog( "Expected: " & iAppCount( iDocType ) ) + else + printlog( "The number of top nodes is correct." ) + endif + + hCloseDialog( ExtrasOptionenDlg, "Cancel" ) else - printlog( "The number of top nodes is correct." ) + warnlog( "Dialog <Tools/Options> did not open " ) endif - - ExtrasOptionenDlg.cancel() + hDestroyDocument() next iDocType diff --git a/testautomation/framework/required/includes/window_functions.inc b/testautomation/framework/required/includes/window_functions.inc index 6efeb70b0b6f..779ab3c0a8aa 100755..100644 --- a/testautomation/framework/required/includes/window_functions.inc +++ b/testautomation/framework/required/includes/window_functions.inc @@ -40,17 +40,17 @@ testcase tWindowFunctions 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 + endif kontext "DocumentWriter" printlog( "Close document" ) @@ -64,7 +64,7 @@ testcase tWindowFunctions hNewDocument() if ( getDocumentCount <> 2) then warnlog( "Two open documents were expected, found " & getDocumentCount ) - endif + endif printlog( "Enter some text into the second writer document" ) kontext "DocumentWriter" @@ -78,8 +78,8 @@ testcase tWindowFunctions else warnlog( "No warning that data will be lost on close of this document" ) endif - - kontext "DocumentWriter" + + kontext "DocumentWriter" if ( getDocumentCount = 2 ) then printlog( "Two documents open. Good." ) else @@ -89,21 +89,21 @@ testcase tWindowFunctions kontext "DocumentWriter" printlog( "Close the document" ) FileClose() - + kontext "Active" - if ( Active.exists() ) then + 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 + endif Kontext "DocumentWriter" printlog( "Minimize window" ) @@ -132,7 +132,7 @@ testcase tWindowFunctions printlog( "Maximize window" ) DocumentWriter.Maximize() Wait( 2000 ) - + kontext "DocumentWriter" if ( DocumentWriter.IsMax() ) then printlog( "Window is maximized" ) @@ -149,177 +149,157 @@ endcase sub sAllWindowTitle printlog( "Window titles for the applications: " & gProductName ) - + printlog( "Writer" ) gApplication = "WRITER" - call tCheckWindowTitle("swriter","Writer") + call tCheckWindowTitle( "swriter", "Writer" ) printlog( "Master Document" ) gApplication = "MASTERDOCUMENT" - call tCheckWindowTitle("sglobal","Writer") + call tCheckWindowTitle( "sglobal", "Writer" ) printlog( "HTML" ) gApplication = "HTML" - call tCheckWindowTitle("sweb","Writer/Web") + call tCheckWindowTitle( "sweb", "Writer/Web" ) printlog( "Spreadsheet" ) gApplication = "CALC" - call tCheckWindowTitle("scalc","Calc") + call tCheckWindowTitle( "scalc", "Calc" ) printlog( "Presentation" ) gApplication = "IMPRESS" - call tCheckWindowTitle("simpress","Impress") + call tCheckWindowTitle( "simpress", "Impress" ) printlog( "Drawing" ) gApplication = "DRAW" - call tCheckWindowTitle("sdraw","Draw") + call tCheckWindowTitle( "sdraw", "Draw" ) printlog( "Formula" ) gApplication = "MATH" - call tCheckWindowTitle("smath","Math") + call tCheckWindowTitle( "smath", "Math" ) - qaerrorlog( "Excluded BASE and BACKINGWINDOW" ) + printlog( "BASIC IDE" ) + gApplication = "WRITER" + call tCheckWindowTitle( "basic", "Basic" ) - 'gApplication = "DATABASE" - 'call tCheckWindowTitle("DATABASE","Base") + printlog( "Database" ) + gApplication = "DATABASE" + call tCheckWindowTitle( "database", "Base" ) - 'fileclose - 'call tCheckWindowTitle("soffice","") + printlog( "Backing Window / StartCenter" ) + gApplication = "BACKGROUND" + call tCheckWindowTitle( "soffice", "" ) end sub '******************************************************************************* -testcase tCheckWindowTitle(sApplication as string, sReference as string) +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 = 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" ) + const BASIC_MODULE = "tCheckWindowTitle" + const STRING_NOT_FOUND = 0 + const STRING_LEFTMOST = 1 + + dim cWindowCaption as string + + dim iProductnamePosition as integer + dim iApplicationPosition as integer + + dim cProductNameString as string + dim cApplicationString as string + + ' hGetWindowCaption modifies it's function parameter, so we pass a copy instead + ' This is a thing that justifies the use of a four letter word for sure. + dim sApplicationTemp as string : sApplicationTemp = sApplication + + printlog( "Application: " & sApplication & "; Title should be: " & sReference ) + printlog( "Open the work windows (documents)" ) + hInitSingleDoc() hCreateDocument() printlog( "Verify that the correct window is open" ) select case sApplication - case"swriter": - case"sglobal": - case"sweb": - case"scalc": - case"simpress": - case"sdraw": - case"smath": - case"basic": - 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() + case "swriter" : + case "sglobal" : + case "sweb" : + case "scalc" : + case "simpress": + case "sdraw" : + case "smath" : + case "basic" : hInitBasicIDE( BASIC_MODULE ) + case "chart" : + case "database": + case "soffice" : hFileCloseAll() end select - 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. Should be: '" & sReference & "', is: '" & saTemp(1) & "'" + ' Note: The Testtool connection string does not belong to the window caption + ' so we do not check for it here. + cWindowCaption = hGetWindowCaption( sApplicationTemp ) + printlog( "Caption is: " & cWindowCaption ) + + ' This prevents accidential matches like "base" in a document name like "database8.odb" + ' And we have a - (minus) as delimiter between the document name and the product name + cProductnameString = " - " & gProductName & " " + cApplicationString = " " & sReference + + ' Find out where in the caption the substrings are + iProductNamePosition = instr( cWindowCaption, cProductnameString ) + iApplicationPosition = instr( cWindowCaption, cApplicationString ) + + ' Verify that the productname is contained within the string + if ( iProductNamePosition = STRING_NOT_FOUND ) then + warnlog( "The product name is missing" ) + endif + + ' Verify that the application name (e.g. "Writer") is contained in the string + ' The StartCenter should not have any application name + if ( sApplication = "soffice" ) then + if ( iApplicationPosition > STRING_NOT_FOUND ) then + printlog( "The StartCenter should not have an application name" ) endif - printlog "Productname: '" + saTemp(2) + "'" else - warnlog "#i36173# - Applicationname not as expected. Should be: '" & sReference & "', is: '" & saTemp(1) + "'" + if ( iApplicationPosition = STRING_NOT_FOUND ) then + warnlog( "The application name is missing" ) + endif + endif + + if ( sApplication = "soffice" ) then + printlog( "Backing window should exclusively show the product name" ) + else + ' If one of Productname or application is leftmost in the string, we have a + ' missing document identifier. This can be different things - the filename, + ' the module name (BASIC) etc. + if ( ( iApplicationPosition = STRING_LEFTMOST ) OR _ + iProductnamePosition = STRING_LEFTMOST ) then + warnlog( "Current document identifier missing (like e.g. <Unknown 1>)" ) + endif + + ' Verify that the order is correct: Product name first, the application + if ( iProductNamePosition >= iApplicationPosition ) then + warnlog( "The order of the strings is incorrect" ) + printlog( "Expected: <Product Name> <Application>" ) + endif endif printlog( "Cleanup after test" ) select case sApplication - case"swriter": - case"sglobal": - case"sweb": - case"scalc": - case"simpress": - case"sdraw": - case"smath": - case"basic": - brc = hDestroyDocument() - case"chart": - case"DATABASE": - case"soffice": - hCreateDocument() - hCreateDocument() + case "swriter" : + case "sglobal" : + case "sweb" : + case "scalc" : + case "simpress": + case "sdraw" : + case "smath" : + case "basic" : hDestroyDocument() + case "chart" : + case "database": + case "soffice" : hCreateDocument() end select printlog( "Close all open documents" ) hFileCloseAll() + endcase diff --git a/testautomation/framework/required/includes/wizard_agenda.inc b/testautomation/framework/required/includes/wizard_agenda.inc index b1b099e07c88..d320234fd40b 100644..100755 --- a/testautomation/framework/required/includes/wizard_agenda.inc +++ b/testautomation/framework/required/includes/wizard_agenda.inc @@ -56,23 +56,23 @@ testcase tUpdtWizardAgenda Kontext "AutopilotAgenda" call DialogTest( AutopilotAgenda, 1 ) PageDesignList.select( 3 ) - hClickNextButton() + hClickButton( NextButton ) Kontext "AutopilotAgenda" call DialogTest( AutopilotAgenda, 2 ) - hClickNextButton() + hClickButton( NextButton ) Kontext "AutopilotAgenda" call DialogTest( AutopilotAgenda, 3 ) - hClickNextButton() + hClickButton( NextButton ) Kontext "AutopilotAgenda" call DialogTest( AutopilotAgenda, 4 ) - hClickNextButton() + hClickButton( NextButton ) Kontext "AutopilotAgenda" call DialogTest( AutopilotAgenda, 5 ) - hClickNextButton() + hClickButton( NextButton ) Kontext "AutopilotAgenda" call DialogTest( AutopilotAgenda, 6 ) @@ -91,15 +91,9 @@ testcase tUpdtWizardAgenda 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 - - + if ( not brc ) then qaerrorlog( "#i59233# The wizard does not display the new template" ) + + hFileCloseAll() hDeleteFile( cTemplatePath ) else warnlog ( "The Agenda wizard did not open/timelimit exceeded" ) diff --git a/testautomation/framework/required/includes/wizard_fax.inc b/testautomation/framework/required/includes/wizard_fax.inc index 433a9bb7a593..b970d8754c5d 100644..100755 --- a/testautomation/framework/required/includes/wizard_fax.inc +++ b/testautomation/framework/required/includes/wizard_fax.inc @@ -53,19 +53,19 @@ testcase tUpdtWizardFax kontext "AutopilotFax" call DialogTest( AutopilotFax, 1 ) - hClickNextButton() + hClickButton( NextButton ) kontext "AutopilotFax" call DialogTest( AutopilotFax, 2 ) - hClickNextButton() + hClickButton( NextButton ) kontext "AutopilotFax" call DialogTest( AutopilotFax, 3 ) - hClickNextButton() + hClickButton( NextButton ) kontext "AutopilotFax" call DialogTest( AutopilotFax, 4 ) - hClickNextButton() + hClickButton( NextButton ) kontext "AutopilotFax" call DialogTest( AutopilotFax, 5 ) @@ -81,9 +81,7 @@ testcase tUpdtWizardFax hWaitForObject( Speichern, 5000 ) brc = hDestroyDocument() - if ( not brc ) then - qaerrorlog( "#i59233# The wizard does not display the new template" ) - endif + if ( not brc ) then qaerrorlog( "#i59233# The wizard does not display the new template" ) printlog( "Delete the user-template: " & cTemplatePath ) hDeleteFile( cTemplatePath ) @@ -92,9 +90,7 @@ testcase tUpdtWizardFax warnlog( "Fax wizard did not open/exceeded timeout" ) endif - while( getDocumentCount() > 0 ) - hDestroyDocument() - wend + hFileCloseAll() endcase diff --git a/testautomation/framework/required/includes/wizard_letter.inc b/testautomation/framework/required/includes/wizard_letter.inc index 19afe2a96f90..267efcefd18a 100644..100755 --- a/testautomation/framework/required/includes/wizard_letter.inc +++ b/testautomation/framework/required/includes/wizard_letter.inc @@ -89,7 +89,7 @@ testcase tUpdtWizardLetter kontext "AutopilotLetter" LetterHead.Check() - hClickNextButton() + hClickButton( NextButton ) kontext "AutopilotLetter" call DialogTest( AutopilotLetter, 2 ) @@ -123,7 +123,7 @@ testcase tUpdtWizardLetter warnlog( "FooterHeight should not be enabled in this configuration" ) endif - hClickNextButton() + hClickButton( NextButton ) kontext "AutopilotLetter" call DialogTest( AutopilotLetter, 3 ) @@ -136,11 +136,11 @@ testcase tUpdtWizardLetter printlog( " * change Complimentary Close to second entry" ) ListGreetings.select( 2 ) - hClickNextButton() + hClickButton( NextButton ) kontext "AutopilotLetter" call DialogTest( AutopilotLetter, 4 ) - hClickNextButton() + hClickButton( NextButton ) kontext "AutopilotLetter" call DialogTest( AutopilotLetter, 5 ) @@ -150,7 +150,7 @@ testcase tUpdtWizardLetter printlog( " * check Include only on second ..." ) IncludeFromPage2.check() - hClickNextButton() + hClickButton( NextButton ) kontext "AutopilotLetter" call DialogTest( AutopilotLetter, 6 ) @@ -178,9 +178,7 @@ testcase tUpdtWizardLetter endif brc = hDestroyDocument() - if ( not brc ) then - qaerrorlog( "#i59233# The wizard does not display the new template" ) - endif + if ( not brc ) then qaerrorlog( "#i59233# The wizard does not display the new template" ) else warnlog( "Autopilot Letter not open/exceeded timeout" ) endif @@ -192,9 +190,7 @@ testcase tUpdtWizardLetter printlog( "Unexpectedly deleted user template(s), please check") endif - do while( getDocumentCount() > 0 ) - call hCloseDocument() - loop + hFileCloseAll() endcase diff --git a/testautomation/framework/required/includes/wizard_mailmerge.inc b/testautomation/framework/required/includes/wizard_mailmerge.inc index d6dbe9ae826c..45b8947eec38 100644..100755 --- a/testautomation/framework/required/includes/wizard_mailmerge.inc +++ b/testautomation/framework/required/includes/wizard_mailmerge.inc @@ -60,36 +60,36 @@ testcase tUpdtWizardMailMerge endif Kontext "MailMergeWizard" - brc = hClickNextButton() + hClickButton( NextButton ) hUpdtMMWPage2() Kontext "MailMergeWizard" - brc = hClickNextButton() - hUpdtMMWpage3() + hClickButton( NextButton ) + hUpdtMMWpage3() Kontext "MailMergeWizard" - brc = hClickNextButton() + hClickButton( NextButton ) hUpdtMMWPage4() Kontext "MailMergeWizard" - brc = hClickNextButton() + hClickButton( NextButton ) hUpdtMMWPage5() Kontext "MailMergeWizard" - brc = hClickNextButton() + hClickButton( NextButton ) hUpdtMMWPage6() Kontext "MailMergeWizard" - brc = hClickNextButton() + hClickButton( NextButton ) hUpdtMMWPage7() Kontext "MailMergeWizard" - brc = hClickNextButton() + hClickNextButton() hUpdtMMWPage8() printlog( "close the wizard" ) Kontext "MailMergeWizard" - MailMergeWizard.cancel() + hCloseDialog( MailMergeWizard, "cancel" ) hRemoveDatabaseConnections() hCloseDocument() diff --git a/testautomation/framework/required/includes/wizard_presentation.inc b/testautomation/framework/required/includes/wizard_presentation.inc index 2c06a00e1971..59544e0fb48e 100644..100755 --- a/testautomation/framework/required/includes/wizard_presentation.inc +++ b/testautomation/framework/required/includes/wizard_presentation.inc @@ -47,14 +47,12 @@ testcase tUpdtWizardPresentation printlog( "Page 1" ) call Dialogtest( AutopilotPraesentation1 ) - - hClickNextButton() + hClickButton( NextButton ) printlog( "Page 2" ) kontext "AutopilotPraesentation2" call DialogTest( AutopilotPraesentation2 ) - - hClickNextButton() + hClickButton( NextButton ) printlog( "Page 3" ) kontext "AutopilotPraesentation3" @@ -65,9 +63,7 @@ testcase tUpdtWizardPresentation warnlog( "Presentation wizard not open/exceeded timeout" ) endif - do while( getDocumentCount() > 0 ) - call hCloseDocument() - loop + hFileCloseAll() gApplication = "WRITER" |