diff options
Diffstat (limited to 'testautomation')
33 files changed, 1681 insertions, 815 deletions
diff --git a/testautomation/dbaccess/optional/includes/ctrl_General.inc b/testautomation/dbaccess/optional/includes/ctrl_General.inc index 5fc684f8f540..80fc173652b2 100755 --- a/testautomation/dbaccess/optional/includes/ctrl_General.inc +++ b/testautomation/dbaccess/optional/includes/ctrl_General.inc @@ -884,6 +884,8 @@ testcase tActivationOrder endif DocumentWriter.TypeKeys "<TAB>" , true sleep(1) + DocumentWriter.TypeKeys "<MOD1 HOME>" , true + sleep(1) DocumentWriter.TypeKeys "<MOD1 SHIFT END>" , true sleep(1) DocumentWriter.TypeKeys "<MOD1 C>" , true @@ -896,6 +898,8 @@ testcase tActivationOrder DocumentWriter.TypeKeys "<TAB>" , true sleep(1) + DocumentWriter.TypeKeys "<MOD1 HOME>" , true + sleep(1) DocumentWriter.TypeKeys "<MOD1 SHIFT END>" , true sleep(1) DocumentWriter.TypeKeys "<MOD1 C>" , true diff --git a/testautomation/dbaccess/optional/includes/ctrl_Wizards.inc b/testautomation/dbaccess/optional/includes/ctrl_Wizards.inc index 4ce62f21b619..b7e93ba9e34c 100755 --- a/testautomation/dbaccess/optional/includes/ctrl_Wizards.inc +++ b/testautomation/dbaccess/optional/includes/ctrl_Wizards.inc @@ -581,7 +581,7 @@ testcase tListBox Kontext "FormControls" Listbox.Click - call hDrawingWithSelection ( 50, 20, 60, 30 ) + call hDrawingWithSelection ( 50, 20, 60, 25 ) sleep(3) Kontext "AutoPilotListComboBox" AutoPilotListComboBox.MouseDown(10,10) diff --git a/testautomation/dbaccess/optional/includes/frm_Forms.inc b/testautomation/dbaccess/optional/includes/frm_Forms.inc index 5bc5b4c18131..5cfeeb7a709f 100755 --- a/testautomation/dbaccess/optional/includes/frm_Forms.inc +++ b/testautomation/dbaccess/optional/includes/frm_Forms.inc @@ -530,9 +530,10 @@ testcase tCreateSubForms DataSource.setText(gDSName) TabDataForm.TypeKeys("<RETURN>") '/// set the table TT_Forms - printlog "set the table TT_Forms" - Content.setText("TT_Forms") - TabDataForm.TypeKeys("<RETURN>") + printlog "set the table TT_Forms" + Content.setText("TT_Forms") + sleep(1) + Content.TypeKeys("<RETURN>",true) sleep(1) Kontext "FormPropertiesDialog" sleep(1) @@ -607,7 +608,11 @@ testcase tCreateSubForms '/// set the sql string : select * from TT_Forms where id=:var1" printlog "set the sql string : select * from TT_Forms where id=:var1" TabDataForm.TypeKeys "<RETURN>" , true - TabDataForm.TypeKeys "select * from TT_Forms where id=:var1" , true + sleep(1) + Content.TypeKeys "select * from TT_Forms where id=:var1" , true + sleep(1) + TabDataForm.TypeKeys("<RETURN>") + sleep(1) '/// set link master field printlog "set link master field" TabDataForm.TypeKeys "<TAB>" , 11 , true diff --git a/testautomation/dbaccess/tools/controltools.inc b/testautomation/dbaccess/tools/controltools.inc index cd73e5f068be..d7f8dce83a37 100755 --- a/testautomation/dbaccess/tools/controltools.inc +++ b/testautomation/dbaccess/tools/controltools.inc @@ -249,6 +249,7 @@ function fSetControlProperty(sControlType, sPropertyName, sPropertyValue as stri ControlPropertiesTabControl.setPage TabDataControl Kontext "TabDataControl" ReferenceValue.setText(sPropertyValue) + ReferenceValue.TypeKeys("<RETURN>",true) Kontext "ControlPropertiesTabControl" ControlPropertiesTabControl.setPage TabGeneralControl elseif sPropertyName = "Repeat" then @@ -266,6 +267,7 @@ function fSetControlProperty(sControlType, sPropertyName, sPropertyValue as stri ControlPropertiesTabControl.setPage TabDataControl Kontext "TabDataControl" ReferenceValueOff.setText(sPropertyValue) + ReferenceValueOff.TypeKeys("<RETURN>",true) Kontext "ControlPropertiesTabControl" ControlPropertiesTabControl.setPage TabGeneralControl elseif sPropertyName = "Readonly" then diff --git a/testautomation/extensions/optional/includes/help.inc b/testautomation/extensions/optional/includes/help.inc index 8bcddfe4f33c..78072873ed28 100755 --- a/testautomation/extensions/optional/includes/help.inc +++ b/testautomation/extensions/optional/includes/help.inc @@ -39,9 +39,6 @@ testcase tExtensibleHelp - warnlog( "#i105760# - Extensible help not displayed" ) - goto endsub - '///<h1>Extensible help</h1> '///<u><pre>Synopsis</pre></u>Beginning with CWS ab38 extensions can extend the help application with index entries and content<br> diff --git a/testautomation/framework/optional/f_basic_gridcontrol.bas b/testautomation/framework/optional/f_basic_gridcontrol.bas new file mode 100755 index 000000000000..06b9a40f7788 --- /dev/null +++ b/testautomation/framework/optional/f_basic_gridcontrol.bas @@ -0,0 +1,55 @@ +'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: gridcontrol.bas,v $ +'* +'* $Revision: 1.3 $ +'* +'* last change: $Author: jsk $ $Date: 2008/06/20 08:07: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 : thorsten.bosbach@sun.com +'* +'* short description : test availablity of gridcontrol +'* +'\****************************************************************************** + +sub main + use "framework\optional\includes\basic_gridcontrol.inc" + call hStatusIn ("framework", "f_basic_gridcontrol.bas") + printlog "Load Document with gridcontrol" + call tGridcontrolLoad + hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT ) + call hStatusOut +end sub + +sub LoadIncludeFiles + use "global\system\includes\master.inc" + use "global\system\includes\gvariabl.inc" + gApplication = "WRITER" + call GetUseFiles() +end sub + diff --git a/testautomation/framework/optional/includes/basic_eventbinding.inc b/testautomation/framework/optional/includes/basic_eventbinding.inc index 165b1e9eda00..634021806a8e 100755 --- a/testautomation/framework/optional/includes/basic_eventbinding.inc +++ b/testautomation/framework/optional/includes/basic_eventbinding.inc @@ -231,7 +231,7 @@ testcase tAssignComponentFunction for i = 1 to x sTemp = LibraryTreeList.getItemText(i) 'printlog "("+i+"/"+x+"): '" + sTemp + "'" - if (("DialogComponent.odt"=sTemp) OR ("DIALOGCOMPONENT.ODT"=sTemp)) then + if (instr(stemp,"DialogComponent.odt") OR instr(stemp,"DIALOGCOMPONENT.ODT")) then a = i printlog "Found library ("+i+"/"+x+"): '" + sTemp + "'" endif diff --git a/testautomation/framework/optional/includes/basic_gridcontrol.inc b/testautomation/framework/optional/includes/basic_gridcontrol.inc new file mode 100755 index 000000000000..cf71748873bd --- /dev/null +++ b/testautomation/framework/optional/includes/basic_gridcontrol.inc @@ -0,0 +1,137 @@ +'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: gridcontrol.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 : thorsten.bosbach@sun.com +'* +'* short description : gridcontrol +'* +'\****************************************************************************** + +testcase tGridcontrolLoad + 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/optional/include/basic_gridcontrol.inc::" + + hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_LOW ) + + printlog "Open the test document" + call hFileOpen(convertPath(gTestToolPath + "framework/optional/input/gridcontrol.odt")) + printlog "Security dialog might come up" + kontext "SecurityWarning" + if SecurityWarning.exists(5) then + printlog "Allow to run macros" + SecurityWarning.ok + endif + call sleep 1 + + printlog "Start the macro, that performs the test" + printlog "Tools->Macros->Run Macro..." + ToolsMacrosRunMacro + Kontext "ScriptSelector" + if ScriptSelector.exists(10) then + x = LibraryTreeList.getItemCount + printlog "Look for library 'gridcontrol'" + for i = 1 to x + sTemp = LibraryTreeList.getItemText(i) + 'printlog "("+i+"/"+x+"): '" + sTemp + "'" + if (instr(sTemp,"gridcontrol")>0 OR instr(sTemp,"GRIDCONTROL")) then + a = i + printlog "Found library ("+i+"/"+x+"): '" + sTemp + "'" + endif + next i + if 0 <> a then + printlog "Select the library and unfold it" + LibraryTreeList.select(a) + LibraryTreeList.typeKeys("+") + printlog "Go to 'Standard' and unfold" + LibraryTreeList.typeKeys("<down>") + LibraryTreeList.typeKeys("+") + printlog "Go to 'Module1'" + LibraryTreeList.typeKeys("<down>") + + printlog "Select macro name 'VclTestTool'" + x = ScriptList.getItemCount + for i = 1 to x + sTemp = ScriptList.getItemText(i) + 'printlog "("+i+"/"+x+"): '" + sTemp + "'" + if "VclTestTool" = sTemp then + a = i + printlog "Found macro ("+i+"/"+x+"): '" + sTemp + "'" + endif + next i + if (0 <> a) then + printlog "Select the macro" + ScriptList.select(a) + printlog "Start the macro by pressing the button 'run'" + ScriptSelector.ok + printlog "sleep... at least 60 seconds" + call sleep(60) + printlog "If macro fails for whatever reason, a message comes up" + Kontext + if active.exists() then + warnlog "" + active.getText + active.ok + try + EditCopy + warnlog getclipboard() + catch + endcatch + printlog "close basic ide" + call hCloseDocument() + printlog "close document" + call hCloseDocument() + goto endsub + endif + + else + warnlog sLocation + "Macro not found: 'Main'" + endif + else + warnlog sLocation + "Library not found: 'gridcontrol'" + endif + else + warnlog sLocation + "'Run macro dialog' didn't came up" + endif + + printlog "clean up" + printlog "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/optional/includes/basic_ide.inc b/testautomation/framework/optional/includes/basic_ide.inc index c60bf35f00a7..a5802e6da9d4 100755 --- a/testautomation/framework/optional/includes/basic_ide.inc +++ b/testautomation/framework/optional/includes/basic_ide.inc @@ -59,75 +59,37 @@ testcase tBasic_IDE_Toolbar_Module kontext "macrobar" printlog "- compile" - Compile.Click - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif + hClickToolbarButton( Compile ) printlog "- Run Basic" - BasicRun.Click - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif - + hClickToolbarButton( BasicRun ) printlog "- Step Procedure" - ProcedureStep.Click - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif - + hClickToolbarButton( ProcedureStep ) printlog "- Stop Basic" - BasicStop.Click - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif - + hClickToolbarButton( BasicStop ) printlog "- Single Step" - SingleStep.Click - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif - + hClickToolbarButton( SingleStep ) printlog "- Step Back" - StepBack.Click() - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif - + hClickToolbarButton( StepBack ) printlog "- Breakpoint => activate" - Breakpoint.Click - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif + hClickToolbarButton( Breakpoint ) printlog "- Breakpoint => deactivate" - Breakpoint.Click - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif - + hClickToolbarButton( Breakpoint ) printlog "- Add Watch => deactivate" - AddWatch.Click - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif - + hClickToolbarButton( AddWatch ) printlog "- Find Paranthese" kontext "macrobar" - FindParanthese.Click() - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif - + hClickToolbarButton( FindParanthese ) try Controls.TearOff() @@ -161,11 +123,7 @@ testcase tBasic_IDE_Toolbar_Module kontext "macrobar" printlog "- Save Source Test " - SaveSourceTest.Click - if ( WaitSlot <> WSFinished ) then - warnlog( "Slot not finished within 1 second" ) - endif - + hClickToolbarButton( SaveSourceTest ) kontext "speicherndlg" if ( SpeichernDlg.exists( 1 ) ) then @@ -177,6 +135,7 @@ testcase tBasic_IDE_Toolbar_Module kontext "active" if ( Active.Exists( 1 ) ) then + printlog( "Closing Messagebox with <Yes>") Active.Yes() endif @@ -347,4 +306,36 @@ testcase tBasic_IDE_Toolbar_Dialogs endcase +'******************************************************************************' + +function hClickToolbarButton( oButton as object ) as boolean + + const CFN = "hClickToolbarButton(): " + + dim iTry as integer + dim brc as boolean : brc = false + + printlog( CFN & "Clicking button on toolbar: " & oButton.name() ) + for iTry = 1 to 5 + + try + oButton.click() + brc = true + exit for + catch + printlog( CFN & "Retrying..." ) + endcatch + + if ( iTry = 5 ) then + exit for + endif + + wait( 500 ) + + next iTry + + if ( WaitSlot( 2000 ) <> WSFinished ) then + warnlog( CFN & "Slot not finished within 1 second" ) + endif +end function diff --git a/testautomation/framework/optional/input/gridcontrol.odt b/testautomation/framework/optional/input/gridcontrol.odt Binary files differnew file mode 100755 index 000000000000..b3e5c6fb40bb --- /dev/null +++ b/testautomation/framework/optional/input/gridcontrol.odt diff --git a/testautomation/framework/required/includes/basic_dialog_export.inc b/testautomation/framework/required/includes/basic_dialog_export.inc index 251efa7ac02a..5999decd2783 100755 --- a/testautomation/framework/required/includes/basic_dialog_export.inc +++ b/testautomation/framework/required/includes/basic_dialog_export.inc @@ -66,7 +66,7 @@ testcase tUpdtDialogExport hDestroyDocument() goto endsub endif - + sleep(1) printlog( "Click the Export button on the DialogBar" ) kontext "DialogBar" Export.click() diff --git a/testautomation/framework/required/includes/basic_dialog_i18n.inc b/testautomation/framework/required/includes/basic_dialog_i18n.inc index 4947b72fa37b..5ac437ea1795 100755 --- a/testautomation/framework/required/includes/basic_dialog_i18n.inc +++ b/testautomation/framework/required/includes/basic_dialog_i18n.inc @@ -54,6 +54,7 @@ testcase tUpdtBasicDialogI18n printlog( "Click Manage Languages on ToolsCollectionBar") kontext "ToolsCollectionBar" + sleep(1) if ( ToolsCollectionBar.exists() ) then ManageLanguage.click() else @@ -106,7 +107,7 @@ testcase tUpdtBasicDialogI18n printlog( "Back on Manage UI Languages Dialog, delete selected language") kontext "ManageUILanguages" Delete.click() - + sleep(1) printlog( "Confirm delete") kontext "active" if ( Active.exists( 1 ) ) then diff --git a/testautomation/framework/required/includes/basic_dialog_i18n_import.inc b/testautomation/framework/required/includes/basic_dialog_i18n_import.inc index 8c26ab0d6bed..eaba271319be 100755 --- a/testautomation/framework/required/includes/basic_dialog_i18n_import.inc +++ b/testautomation/framework/required/includes/basic_dialog_i18n_import.inc @@ -39,12 +39,15 @@ testcase tBasicDialogI18nImport - printlog( "Dialogs that show up when importing Multi locale dialogs into BASIC IDE" ) + printlog( "Dialogs that show up when importing multi locale dialogs into BASIC IDE" ) dim cDialogPath as string cDialogPath = gTesttoolPath & "framework\required\input\basic_ide\Dialog5.xdl" cDialogPath = convertpath( cDialogPath ) + dim iNumberOfLanguages as integer + dim iTry as integer + const LANGUAGE_COUNT = 5 printlog( "Open BASIC-IDE" ) @@ -82,15 +85,23 @@ testcase tBasicDialogI18nImport printlog( "Accept with yes" ) Active.Yes() - + sleep(1) Kontext "TranslationBar" if ( TranslationBar.exists() ) then + + for iTry = 1 to 5 + iNumberOfLanguages = CurrentLanguage.getItemCount() + if ( iNumberOfLanguages = LANGUAGE_COUNT ) then + exit for + endif + wait( 100 ) + next iTry printlog( "Check number of imported languages" ) - if ( CurrentLanguage.getItemCount() <> LANGUAGE_COUNT ) then + if ( iNumberOfLanguages <> LANGUAGE_COUNT ) then warnlog( "Incorrect language count in listbox <CurrentLanguage>" ) printlog( "Expected: " & LANGUAGE_COUNT ) - printlog( "Found...: " & CurrentLanguage.getItemCount() ) + printlog( "Found...: " & iNumberOfLanguages ) endif Kontext "DialogBar" diff --git a/testautomation/global/input/accelerators.txt b/testautomation/global/input/accelerators.txt index 1f1d88214986..cb518c9e3335 100755 --- a/testautomation/global/input/accelerators.txt +++ b/testautomation/global/input/accelerators.txt @@ -158,6 +158,7 @@ ko-KR=mod2 u zh-CN=mod2 u zh-TW=mod2 u sl=mod2 i +cs=mod2 a # This is the accelerator that switches tabs in the BASIC IDE. I found it by accident diff --git a/testautomation/global/required/includes/g_customize.inc b/testautomation/global/required/includes/g_customize.inc index 29b6dec58c61..733f5028880c 100644 --- a/testautomation/global/required/includes/g_customize.inc +++ b/testautomation/global/required/includes/g_customize.inc @@ -108,6 +108,7 @@ testcase tToolsCustomize Kontext "TabCustomizeMenu" '/// Click button 'Command' ///' + sleep(1) Command.click printlog "opened second one" WaitSlot() @@ -123,6 +124,7 @@ testcase tToolsCustomize WaitSlot() Kontext "TabCustomizeMenu" '/// Click button 'Command' ///' + sleep(1) Command.click printlog "opened third one" WaitSlot() @@ -192,8 +194,10 @@ testcase tToolsCustomize waitslot Kontext "TabCustomizeToolbars" + sleep(1) '/// Click button 'Command' ///' Command.click + waitslot '/// Select the firste entry 'Rename' ///' hMenuSelectNr(1) '/// Dialog 'Name' comes up ///' @@ -206,7 +210,9 @@ testcase tToolsCustomize endif Kontext "TabCustomizeToolbars" + sleep(1) Command.click + waitslot hMenuSelectNr(1) Kontext "CustomizeToolbarsReName" call DialogTest (CustomizeToolbarsReName) @@ -217,7 +223,9 @@ testcase tToolsCustomize waitslot Kontext "TabCustomizeToolbars" '/// Click button 'Command' ///' + sleep(1) Command.click + waitslot '/// Select the fifth entry 'Change Icon' ///' hMenuSelectNr(5) '/// Dialog 'Change Icon' comes up ///' @@ -252,6 +260,7 @@ testcase tToolsCustomize WaitSlot() Kontext "TabCustomizeToolbars" '/// On Tab Page 'Customize Menus' click on Button 'Toolbar' ///' + sleep(1) MenuBtn.openMenu WaitSlot() hMenuSelectNr(1) diff --git a/testautomation/global/tools/includes/required/t_option2.inc b/testautomation/global/tools/includes/required/t_option2.inc index 74f49d9e3916..fdf11f1e4411 100644 --- a/testautomation/global/tools/includes/required/t_option2.inc +++ b/testautomation/global/tools/includes/required/t_option2.inc @@ -136,9 +136,9 @@ sub DialogeFuerTypenKontrollieren if OeffnenDlg.Exists() then if ( Dateityp.IsVisible ) then Warnlog "The normal FileOpen-Dialog is visible with the Filetype-Listbox => BUG!" - OeffnenDlg.Cancel - exit do endif + OeffnenDlg.Cancel + exit do endif Kontext "PfadeAuswaehlen" @@ -146,6 +146,8 @@ sub DialogeFuerTypenKontrollieren PfadeAuswaehlen.Cancel exit do end if + + iExitCounter = iExitCounter + 1 loop Kontext "TabPfade" else diff --git a/testautomation/global/win/tab_t_z.win b/testautomation/global/win/tab_t_z.win index 6196e652b5b9..510cef7e6da5 100755 --- a/testautomation/global/win/tab_t_z.win +++ b/testautomation/global/win/tab_t_z.win @@ -330,6 +330,8 @@ Maximum sc:Edit:TP_VALIDATION_VALUES:EDT_MAX ShowSelectionList sc:CheckBox:TP_VALIDATION_VALUES:CB_SHOWLIST ListSortEntries sc:CheckBox:TP_VALIDATION_VALUES:CB_SORTLIST CriteriaListEntries sc:MultiLineEdit:TP_VALIDATION_VALUES:EDT_LIST +SourceShrink sc:ImageButton:TP_VALIDATION_VALUES:RB_VALIDITY_REF +ValidityReset HID_TABDLG_RESET_BTN *TabWortergaenzung HID_OFAPAGE_AUTOCOMPLETE_OPTIONS WoerterErgaenzen svx:CheckBox:RID_OFAPAGE_AUTOCOMPLETE_OPTIONS:CB_ACTIV diff --git a/testautomation/spreadsheet/optional/c_validity.bas b/testautomation/spreadsheet/optional/c_validity.bas new file mode 100755 index 000000000000..f277a37009bc --- /dev/null +++ b/testautomation/spreadsheet/optional/c_validity.bas @@ -0,0 +1,93 @@ +'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: c_validity.bas,v $ +'* +'* $Revision: 0.9 $ +'* +'* last change: $Author: oc $ $Date: 2009/08/04 15:41:38 $ +'* +'* 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 : oliver.craemer@Sun.COM +'** +'** short description : extensive test for the validity functionality +'** +'\*********************************************************************** + +global giWhichSecurityLevel as integer + +sub main + + PrintLog "---------------------------------------------------------------------" + Printlog "----- Calc test validity -----" + PrintLog "---------------------------------------------------------------------" + + use "spreadsheet/optional/includes/validity/c_validity.inc" + use "spreadsheet/tools/includes/c_select_tools.inc" + use "spreadsheet/tools/includes/c_validity_tools.inc" + + printlog "Get the security level and set it to lower" + Call sPreconditions + + Call hStatusIn("spreadsheet", "c_validity.bas") + call tValidity_Check_Message + call tValidity_Check_Excel + Call hStatusOut + + printlog "Set the security level to starting value" + Call sResetSystemUnderTest +end sub +' +'------------------------------------------------------------------------------- +' +sub LoadIncludeFiles + use "global\system\includes\master.inc" + use "global\system\includes\gvariabl.inc" + use "global\tools\includes\required\t_option2.inc" + gApplication = "CALC" + Call GetUseFiles +end sub + +' +'------------------------------------------------------------------------------- +' +sub sPreconditions + 'Init the iWhichSecurityLevel() variable with 2 + 'which would be the normal state if it's impossible + 'to detect the macro security level. + giWhichSecurityLevel = 2 + 'Get the macro security level and remember it. + 'and then set the Macro security level to (0) low + giWhichSecurityLevel = hSetMacroSecurity(0) +end sub +' +'------------------------------------------------------------------------------- +' +sub sResetSystemUnderTest + 'Set the macro security level back to the value + 'which has it before the system was under test + call hSetMacroSecurity(giWhichSecurityLevel) +end sub diff --git a/testautomation/spreadsheet/optional/includes/validity/c_validity.inc b/testautomation/spreadsheet/optional/includes/validity/c_validity.inc new file mode 100755 index 000000000000..05f71cd10b5c --- /dev/null +++ b/testautomation/spreadsheet/optional/includes/validity/c_validity.inc @@ -0,0 +1,384 @@ +'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: c_validity.inc,v $ +'* +'* $Revision: 1.0 $ +'* +'* last change: $Author: oc $ $Date: 2009/08/04 15:41:39 $ +'* +'* 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 : oliver.craemer@Sun.COM +'** +'** short description : Complete test for data validity +'** +'************************************************************************ +' ** +' #1 tValidity_Check_Message +' #1 tValidity_Check_Excel +' ** +'\*********************************************************************** + +testcase tValidity_Check_Message + + printlog "This test checks, if an error messgae appears, when a wrong content is inserted into the appropriate cells" + + dim sInputFile as string + dim sOutputFile as string + dim sMType as string + dim sInfoStr as string + dim iCount as integer + + sInputFile = convertpath(gTesttoolPath & "spreadsheet/optional/input/validity.ods") + sOutputFile = convertpath (gOfficepath & "user/work/validity.ods.ods)" + + printlog " Open document <i>gTesttoolPath</i>spreadsheet/optional/input/validity.ods" + call hFileOpen (sInputFile) + printlog " Save the document under <i>gOfficePath</i>user/work/validity.ods" + if NOT hFileSaveAsWithFilter ( sOutputFile, "calc8" ) then + warnlog "Saving test document localy failed -> Aborting" + call hCloseDocument + goto endsub + endif + + printlog " Do the following operations (see values in table) with every of the 4 sheets." + printlog " Goto first cell and insert the correct value" + printlog " Press RETURN" + printlog " No warning or information message should appear" + printlog " Enter the incorrect value" + printlog " Press RETURN" + printlog " A warning or information message should appear" + for iCount = 1 to 4 + select case iCount + case 1 : sMType = "Stop" : sInfoStr = "First" + case 2 : sMType = "Warning" : sInfoStr = "Second" + case 3 : sMType = "Information" : sInfoStr = "Third" + case 4 : sMType = "Macro" : sInfoStr = "Macro" + end select + + call fCalcSelectSheet(sMType) + printlog " *** " & sInfoStr & " it is checked, if the " & sMType & " messages appears, if wrong contents are inserted into the appropriate cells" + '///+<UL> + '///+<LI>Goto first cell and insert the <i>correct value</i></LI> + '///+<LI>Press RETURN</LI> + '///+<LI><UL><LI>No warning or information message should appear</LI></UL></LI> + '///+<LI>Enter the <i>incorrect value</I> + '///+<LI>Press RETURN</LI> + '///+<LI><UL><LI>A warning or information message should appear</LI></UL></LI> + '///+<LI><TABLE BORDER=1> + '///+ <TR><TH>Cell address</TH><TH>correct value</TH><TH>incorrect value</TH></TR> + '///+ <TR><TD>B4</TD><TD>3</TD><TD>8</TD></TR> + call check_message(sMType, "B4", "3", "8") + '///+ <TR><TD>B5</TD><TD>9</TD><TD>10</TD></TR> + call check_message(sMType, "B5", "9", "10") + '///+ <TR><TD>B6</TD><TD>28</TD><TD>25</TD></TR> + call check_message(sMType, "B6", "28", "25") + '///+ <TR><TD>B7</TD><TD>10</TD><TD>12</TD></TR> + call check_message(sMType, "B7", "10", "12") + '///+ <TR><TD>B8</TD><TD>11</TD><TD>9</TD></TR> + call check_message(sMType, "B8", "11", "9") + '///+ <TR><TD>B9</TD><TD>5</TD><TD>3</TD></TR> + call check_message(sMType, "B9", "5", "3") + '///+ <TR><TD>B10</TD><TD>1</TD><TD>6</TD></TR> + call check_message(sMType, "B10", "1", "6") + '///+ <TR><TD>B11</TD><TD>1</TD><TD>6</TD></TR> + call check_message(sMType, "B11", "1", "6") + '///+ <TR><TD>B17</TD><TD>3,14</TD><TD>3,15</TD></TR> + call check_message(sMType, "B17", "3,14", "3,15") + '///+ <TR><TD>B18</TD><TD>10,14</TD><TD>10,16</TD></TR> + call check_message(sMType, "B18", "10,14", "10,16") + '///+ <TR><TD>B19</TD><TD>25,10</TD><TD>25,09</TD></TR> + call check_message(sMType, "B19", "25,10", "25,09") + '///+ <TR><TD>B20</TD><TD>10,5</TD><TD>10,7</TD></TR> + call check_message(sMType, "B20", "10,5", "10,7") + '///+ <TR><TD>B21</TD><TD>11,9</TD><TD>10</TD></TR> + call check_message(sMType, "B21", "11,9", "10") + '///+ <TR><TD>B22</TD><TD>3,145</TD><TD>3,14</TD></TR> + call check_message(sMType, "B22", "3,145", "3,14") + '///+ <TR><TD>B23</TD><TD>1,45</TD><TD>1,38</TD></TR> + call check_message(sMType, "B23", "1,45", "1,38") + '///+ <TR><TD>B24</TD><TD>2,03</TD><TD>2,15</TD></TR> + call check_message(sMType, "B24", "2,03", "2,15") + '///+ <TR><TD>E4</TD><TD>13.12.99</TD><TD>13.11.99</TD></TR> + call check_message(sMType, "E4", "13.12.99", "13.11.99") + '///+ <TR><TD>E5</TD><TD>12.12.99</TD><TD>13.12.99</TD></TR> + call check_message(sMType, "E5", "12.12.99", "13.12.99") + '///+ <TR><TD>E6</TD><TD>14.12.99</TD><TD>13.12.99</TD></TR> + call check_message(sMType, "E6", "14.12.99", "13.12.99") + '///+ <TR><TD>E7</TD><TD>13.12.99</TD><TD>14.12.99</TD></TR> + call check_message(sMType, "E7", "13.12.99", "14.12.99") + '///+ <TR><TD>E8</TD><TD>13.12.99</TD><TD>12.12.99</TD></TR> + call check_message(sMType, "E8", "13.12.99", "12.12.99") + '///+ <TR><TD>E9</TD><TD>13.11.99</TD><TD>13.12.99</TD></TR> + call check_message(sMType, "E9", "13.11.99", "13.12.99") + '///+ <TR><TD>E10</TD><TD>23.12.99</TD><TD>12.12.99</TD></TR> + call check_message(sMType, "E10", "23.12.99", "12.12.99") + '///+ <TR><TD>E11</TD><TD>24.12.99</TD><TD>23.12.99</TD></TR> + call check_message(sMType, "E11", "24.12.99", "23.12.99") + '///+ <TR><TD>E17</TD><TD>13:15</TD><TD>13:16</TD></TR> + call check_message(sMType, "E17", "13:15", "13:16") + '///+ <TR><TD>E18</TD><TD>10:15</TD><TD>14:16</TD></TR> + call check_message(sMType, "E18", "10:15", "14:16") + '///+ <TR><TD>E19</TD><TD>23:10</TD><TD>12:09</TD></TR> + call check_message(sMType, "E19", "23:10", "12:09") + '///+ <TR><TD>E20</TD><TD>13:15</TD><TD>13:16</TD></TR> + call check_message(sMType, "E20", "13:15", "13:16") + '///+ <TR><TD>E21</TD><TD>13:15</TD><TD>13:14</TD></TR> + call check_message(sMType, "E21", "13:15", "13:14") + '///+ <TR><TD>E22</TD><TD>13:16</TD><TD>13:15</TD></TR> + call check_message(sMType, "E22", "13:16", "13:15") + '///+ <TR><TD>E23</TD><TD>13:15</TD><TD>23:13</TD></TR> + call check_message(sMType, "E23", "13:15", "23:13") + '///+ <TR><TD>E24</TD><TD>12:59</TD><TD>13:00</TD></TR> + call check_message(sMType, "E24", "12:59", "13:00") + '///+ <TR><TD>H4</TD><TD>abc</TD><TD>abcd</TD></TR> + call check_message(sMType, "H4", "abc", "abcd") + '///+ <TR><TD>H5</TD><TD>abcdefgrd</TD><TD>aderfgtzjm</TD></TR> + call check_message(sMType, "H5", "abcdefgrd", "aderfgtzjm") + '///+ <TR><TD>H6</TD><TD>rftgzhujikolmnbvcxyaswqepk</TD><TD>ftgzhnujikm,lopredswqayx</TD></TR> + call check_message(sMType, "H6", "rftgzhujikolmnbvcxyaswqepk", "ftgzhnujikm,lopredswqayx") + '///+ <TR><TD>H7</TD><TD>asweqrfvbg</TD><TD>edcvfrtgbnh</TD></TR> + call check_message(sMType, "H7", "asweqrfvbg", "edcvfrtgbnh") + '///+ <TR><TD>H8</TD><TD>edcswxyaqtgb</TD><TD>ujnmkipztr</TD></TR> + call check_message(sMType, "H8", "edcswxyaqtgb", "ujnmkipztr") + '///+ <TR><TD>H9</TD><TD>sdxc</TD><TD>tgb</TD></TR> + call check_message(sMType, "H9", "sdxc", "tgb") + '///+ <TR><TD>H10</TD><TD>rfvbj</TD><TD>dfcvgb</TD></TR> + call check_message(sMType, "H10", "rfvbj", "dfcvgb") + '///+ <TR><TD>H11</TD><TD>g</TD><TD>we</TD></TR> + call check_message(sMType, "H11", "g", "we") + '///+ <TR><TH>New featurs OpenOffice 2.0</TH></TR> + '///+ <TR><TD>B30</TD><TD>February</TD><TD>January</TD></TR> + call check_message(sMType, "B30", "February", "January") + '///+ <TR><TD>B31</TD><TD>May</TD><TD>February</TD></TR> + call check_message(sMType, "B31", "May", "February") + '///+ <TR><TD>B32</TD><TD>June</TD><TD>January</TD></TR> + call check_message(sMType, "B32", "June", "January") + '///+ <TR><TD>B33</TD><TD>August</TD><TD>November</TD></TR> + call check_message(sMType, "B33", "August", "November") + '///+ <TR><TD>B34</TD><TD>September</TD><TD>December</TD></TR> + call check_message(sMType, "B34", "September", "December") + '///+ <TR><TD>B35</TD><TD>October</TD><TD>March</TD></TR> + call check_message(sMType, "B35", "October", "March") + '///+ <TR><TD>B36</TD><TD>July</TD><TD>August</TD></TR> + call check_message(sMType, "B36", "July", "August") + '///+ <TR><TD>B37</TD><TD>April</TD><TD>October</TD></TR> + call check_message(sMType, "B37", "April", "October") + '///+ <TR><TD>B38</TD><TD>Name03</TD><TD>Name07</TD></TR> + call check_message(sMType, "B38", "Name03", "Name07") + '///+ <TR><TD>E30</TD><TD>alpha</TD><TD>omega</TD></TR> + call check_message(sMType, "E30", "alpha", "omega") + '///+ <TR><TD>E31</TD><TD>beta</TD><TD>zeta</TD></TR> + call check_message(sMType, "E31", "beta", "zeta") + '///+ <TR><TD>E32</TD><TD>gamma</TD><TD>psi</TD></TR> + call check_message(sMType, "E32", "gamma", "psi") + '///+ <TR><TD>E33</TD><TD>delta</TD><TD>pi/2</TD></TR> + call check_message(sMType, "E33", "delta", "pi/2") + '///+ </TABLE></LI></UL> + next iCount + '/// Close the document + printlog "Close the document" + call hCloseDocument + +endcase +' +'------------------------------------------------------------------------------- +' +testcase tValidity_Check_Excel +'/// This test checks, if an error messgae appears, when a wrong content is inserted into the appropriate cells + + dim sInputFile as String + dim sOutputFile as String + dim sMType as String + dim iCount as integer + dim sInfoStr as String + dim sdecimalseperator as string + sDecimalseperator = GetDecimalSeperator + + sInputFile = convertpath(gTesttoolPath & "spreadsheet/optional/input/validity.ods") + sOutputFile = convertpath(gOfficePath & "user/work/validity.xls") + + '/// Open <i>gTesttoolPath</i>/calc/special/input/validity.ods + printlog "Open <i>gTesttoolPath</i>/calc/special/input/validity.ods" + call hFileOpen (sInputFile) + Kontext "SecurityWarning" + '/// If security warning occours click on 'Enable Macros'. + if SecurityWarning.exists(2) then + SecurityWarning.OK + endif + sleep (2) + '/// Save the document under <i>gOfficePath</i>user/work/validity.xls (MS Excel 97 format) + if NOT hFileSaveAsWithFilterKill ( sOutputFile, "MS Excel 97" ) then + warnlog "Saving test document localy failed -> Aborting" + call hCloseDocument + goto endsub + endif + sleep (2) + '/// Close the document + call hCloseDocument + sleep (2) + '/// Open the exported document + call hFileOpen ( sOutputFile ) + sleep (2) + printlog " Do the following operations (see values in table) with every of the 3 sheets." + printlog " Goto first cell and insert the correct value" + printlog " Press RETURN" + printlog " No warning or information message should appear" + printlog " Enter the incorrect value" + printlog " Press RETURN" + printlog " A warning or information message should appear" + for iCount = 1 to 3 + select case iCount + case 1 : sMType = "Stop" : sInfoStr = "First" + case 2 : sMType = "Warning" : sInfoStr = "Second" + case 3 : sMType = "Information" : sInfoStr = "Third" + end select + '/// Do the following operations (see values in table) with every of the 3 sheets. + call fCalcSelectSheet(sMType) + printlog " *** " & sInfoStr & " it is checked, if the " & sMType & " messages appears, if wrong contents are " & _ + "inserted into the appropriate cells" +'///+<UL> +'///+<LI>Goto first cell and insert the <i>correct value</i></LI> +'///+<LI>Press RETURN</LI> +'///+<LI><UL><LI>No warning or information message should appear</LI></UL></LI> +'///+<LI>Enter the <i>incorrect value</I> +'///+<LI>Press RETURN</LI> +'///+<LI><UL><LI>A warning or information message should appear</LI></UL></LI> +'///+<LI><TABLE BORDER=1> +'///+ <TR><TH>Cell address</TH><TH>correct value</TH><TH>incorrect value</TH></TR> +'///+ <TR><TD>B4</TD><TD>3</TD><TD>8</TD></TR> + call check_message(sMType, "B4", "3", "8") +'///+ <TR><TD>B5</TD><TD>9</TD><TD>10</TD></TR> + call check_message(sMType, "B5", "9", "10") +'///+ <TR><TD>B6</TD><TD>28</TD><TD>25</TD></TR> + call check_message(sMType, "B6", "28", "25") +'///+ <TR><TD>B7</TD><TD>10</TD><TD>12</TD></TR> + call check_message(sMType, "B7", "10", "12") +'///+ <TR><TD>B8</TD><TD>11</TD><TD>9</TD></TR> + call check_message(sMType, "B8", "11", "9") +'///+ <TR><TD>B9</TD><TD>5</TD><TD>3</TD></TR> + call check_message(sMType, "B9", "5", "3") +'///+ <TR><TD>B10</TD><TD>1</TD><TD>6</TD></TR> + call check_message(sMType, "B10", "1", "6") +'///+ <TR><TD>B11</TD><TD>1</TD><TD>6</TD></TR> + call check_message(sMType, "B11", "1", "6") +'///+ <TR><TD>B17</TD><TD>3,14</TD><TD>3,15</TD></TR> + call check_message(sMType, "B17", "3" & sdecimalseperator & "14", "3" & sdecimalseperator & "15") +'///+ <TR><TD>B18</TD><TD>10,14</TD><TD>10,16</TD></TR> + call check_message(sMType, "B18", "10" & sdecimalseperator & "14", "10" & sdecimalseperator & "16") +'///+ <TR><TD>B19</TD><TD>25,10</TD><TD>25,09</TD></TR> + call check_message(sMType, "B19", "25" & sdecimalseperator & "10", "25" & sdecimalseperator & "09") +'///+ <TR><TD>B20</TD><TD>10,5</TD><TD>10,7</TD></TR> + call check_message(sMType, "B20", "10" & sdecimalseperator & "5", "10" & sdecimalseperator & "7") +'///+ <TR><TD>B21</TD><TD>11,9</TD><TD>10</TD></TR> + call check_message(sMType, "B21", "11" & sdecimalseperator & "9", "10") +'///+ <TR><TD>B22</TD><TD>3,145</TD><TD>3,14</TD></TR> + call check_message(sMType, "B22", "3" & sdecimalseperator & "145", "3" & sdecimalseperator & "14") +'///+ <TR><TD>B23</TD><TD>1,45</TD><TD>1,38</TD></TR> + call check_message(sMType, "B23", "1" & sdecimalseperator & "45", "1" & sdecimalseperator & "38") +'///+ <TR><TD>B24</TD><TD>2,03</TD><TD>2,15</TD></TR> + call check_message(sMType, "B24", "2" & sdecimalseperator & "03", "2" & sdecimalseperator & "15") +'///+ <TR><TD>E4</TD><TD>13.12.99</TD><TD>13.11.99</TD></TR> + call check_message(sMType, "E4", "13.12.99", "13.11.99") +'///+ <TR><TD>E5</TD><TD>12.12.99</TD><TD>13.12.99</TD></TR> + call check_message(sMType, "E5", "12.12.99", "13.12.99") +'///+ <TR><TD>E6</TD><TD>14.12.99</TD><TD>13.12.99</TD></TR> + call check_message(sMType, "E6", "14.12.99", "13.12.99") +'///+ <TR><TD>E7</TD><TD>13.12.99</TD><TD>14.12.99</TD></TR> + call check_message(sMType, "E7", "13.12.99", "14.12.99") +'///+ <TR><TD>E8</TD><TD>13.12.99</TD><TD>12.12.99</TD></TR> + call check_message(sMType, "E8", "13.12.99", "12.12.99") +'///+ <TR><TD>E9</TD><TD>13.11.99</TD><TD>13.12.99</TD></TR> + call check_message(sMType, "E9", "13.11.99", "13.12.99") +'///+ <TR><TD>E10</TD><TD>23.12.99</TD><TD>12.12.99</TD></TR> + call check_message(sMType, "E10", "23.12.99", "12.12.99") +'///+ <TR><TD>E11</TD><TD>24.12.99</TD><TD>23.12.99</TD></TR> + call check_message(sMType, "E11", "24.12.99", "23.12.99") +'///+ <TR><TD>E17</TD><TD>13:15</TD><TD>13:16</TD></TR> + call check_message(sMType, "E17", "13:15", "13:16") +'///+ <TR><TD>E18</TD><TD>10:15</TD><TD>14:16</TD></TR> + call check_message(sMType, "E18", "10:15", "14:16") +'///+ <TR><TD>E19</TD><TD>23:10</TD><TD>12:09</TD></TR> + call check_message(sMType, "E19", "23:10", "12:09") +'///+ <TR><TD>E20</TD><TD>13:15</TD><TD>13:16</TD></TR> + call check_message(sMType, "E20", "13:15", "13:16") +'///+ <TR><TD>E21</TD><TD>13:15</TD><TD>13:15</TD></TR> + call check_message(sMType, "E21", "13:15", "13:14") +'///+ <TR><TD>E22</TD><TD>13:16</TD><TD>13:15</TD></TR> + call check_message(sMType, "E22", "13:16", "13:15") +'///+ <TR><TD>E23</TD><TD>13:15</TD><TD>23:13</TD></TR> + call check_message(sMType, "E23", "13:15", "23:13") +'///+ <TR><TD>E24</TD><TD>12:59</TD><TD>13:00</TD></TR> + call check_message(sMType, "E24", "12:59", "13:00") +'///+ <TR><TD>H4</TD><TD>abc</TD><TD>abcd</TD></TR> + call check_message(sMType, "H4", "abc", "abcd") +'///+ <TR><TD>H5</TD><TD>abcdefgrd</TD><TD>aderfgtzjm</TD></TR> + call check_message(sMType, "H5", "abcdefgrd", "aderfgtzjm") +'///+ <TR><TD>H6</TD><TD>rftgzhujikolmnbvcxyaswqepk</TD><TD>ftgzhnujikm,lopredswqayx</TD></TR> + call check_message(sMType, "H6", "rftgzhujikolmnbvcxyaswqepk", "ftgzhnujikm,lopredswqayx") +'///+ <TR><TD>H7</TD><TD>asweqrfvbg</TD><TD>edcvfrtgbnh</TD></TR> + call check_message(sMType, "H7", "asweqrfvbg", "edcvfrtgbnh") +'///+ <TR><TD>H8</TD><TD>edcswxyaqtgb</TD><TD>ujnmkipztr</TD></TR> + call check_message(sMType, "H8", "edcswxyaqtgb", "ujnmkipztr") +'///+ <TR><TD>H9</TD><TD>sdxc</TD><TD>tgb</TD></TR> + call check_message(sMType, "H9", "sdxc", "tgb") +'///+ <TR><TD>H10</TD><TD>rfvbj</TD><TD>dfcvgb</TD></TR> + call check_message(sMType, "H10", "rfvbj", "dfcvgb") +'///+ <TR><TD>H11</TD><TD>g</TD><TD>we</TD></TR> + call check_message(sMType, "H11", "g", "we") +'///+ <TR><TH>New featurs OpenOffice 2.0</TH></TR>we</TD></TR> +'///+ <TR><TD>B30</TD><TD>February</TD><TD>January</TD></TR> + call check_message(sMType, "B30", "February", "January") +'///+ <TR><TD>B31</TD><TD>May</TD><TD>February</TD></TR> + call check_message(sMType, "B31", "May", "February") +'///+ <TR><TD>B32</TD><TD>June</TD><TD>January</TD></TR> + call check_message(sMType, "B32", "June", "January") +'///+ <TR><TD>B33</TD><TD>August</TD><TD>November</TD></TR> + call check_message(sMType, "B33", "August", "November") +'///+ <TR><TD>B34</TD><TD>September</TD><TD>December</TD></TR> + call check_message(sMType, "B34", "September", "December") +'///+ <TR><TD>B35</TD><TD>October</TD><TD>March</TD></TR> + call check_message(sMType, "B35", "October", "March") +'///+ <TR><TD>B36</TD><TD>July</TD><TD>August</TD></TR> + call check_message(sMType, "B36", "July", "August") +'///+ <TR><TD>B37</TD><TD>April</TD><TD>October</TD></TR> + call check_message(sMType, "B37", "April", "October") +'///+ <TR><TD>B38</TD><TD>Name03</TD><TD>Name07</TD></TR> + call check_message(sMType, "B38", "Name03", "Name07") +'///+ <TR><TD>E30</TD><TD>alpha</TD><TD>omega</TD></TR> + call check_message(sMType, "E30", "alpha", "omega") +'///+ <TR><TD>E31</TD><TD>beta</TD><TD>zeta</TD></TR> + call check_message(sMType, "E31", "beta", "zeta") +'///+ <TR><TD>E32</TD><TD>gamma</TD><TD>psi</TD></TR> + call check_message(sMType, "E32", "gamma", "psi") +'///+ <TR><TD>E33</TD><TD>delta</TD><TD>pi/2</TD></TR> + call check_message(sMType, "E33", "delta", "pi/2") +'///+ </TABLE></LI></UL> + next iCount +'/// File / Close + call hCloseDocument +endcase + diff --git a/testautomation/spreadsheet/optional/input/validity.ods b/testautomation/spreadsheet/optional/input/validity.ods Binary files differnew file mode 100755 index 000000000000..06a980c67478 --- /dev/null +++ b/testautomation/spreadsheet/optional/input/validity.ods diff --git a/testautomation/spreadsheet/required/includes/c_upd_datamenu.inc b/testautomation/spreadsheet/required/includes/c_upd_datamenu.inc index 0b2ae7c0dba4..01f982640293 100755 --- a/testautomation/spreadsheet/required/includes/c_upd_datamenu.inc +++ b/testautomation/spreadsheet/required/includes/c_upd_datamenu.inc @@ -549,14 +549,20 @@ testcase tDataValidity printlog " Choose last entry (not between) in 'Data' combobox" Daten.select (8) Call DialogTest ( TabWerte,3 ) - '/// Choose 7th entry (Cell range) in 'Allow' combobox - printlog " Choose 7th entry (Cell range) in 'Allow' combobox" + '/// Choose 7th entry (List) in 'Allow' combobox + printlog " Choose 7th entry (List) in 'Allow' combobox" Zulassen.select (7) - Call DialogTest ( TabWerte,4 ) - '/// Choose 6th entry (List) in 'Allow' combobox - printlog " Choose 6th entry (List) in 'Allow' combobox" + Call DialogTest ( TabWerte,4 ) + '/// Choose 6th entry (Cell range) in 'Allow' combobox + printlog " Choose 6th entry (Cell range) in 'Allow' combobox" Zulassen.select (6) Call DialogTest ( TabWerte,5 ) + printlog " Press Shrink button" + SourceShrink.Click + Kontext "TabWerte" + printlog " Close rangechooser" + SourceShrink.Click + Kontext "TabWerte" '/// Switch to tabpage 'Input Help' printlog " Switch to tabpage 'Input Help'" Kontext diff --git a/testautomation/spreadsheet/required/includes/c_upd_viewmenu.inc b/testautomation/spreadsheet/required/includes/c_upd_viewmenu.inc index 6513f450a15d..000c8db5c961 100755 --- a/testautomation/spreadsheet/required/includes/c_upd_viewmenu.inc +++ b/testautomation/spreadsheet/required/includes/c_upd_viewmenu.inc @@ -332,6 +332,7 @@ testcase tViewNavigator '/// Check that the dragmodus has 3 modes printlog " Check that the dragmodus has 3 modes" Dragmodus.OpenMenu + waitslot(1000) if hMenuItemGetCount <> 3 then warnlog "Not enough modes for dragmodus" end if diff --git a/testautomation/spreadsheet/tools/includes/c_validity_tools.inc b/testautomation/spreadsheet/tools/includes/c_validity_tools.inc new file mode 100755 index 000000000000..0fb9277a7a5a --- /dev/null +++ b/testautomation/spreadsheet/tools/includes/c_validity_tools.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: c_validity_tools.inc,v $ +'* +'* $Revision: 1.0 $ +'* +'* last change: $Author: oc $ $Date: 2009/08/04 15:41:39 $ +'* +'* 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 : oliver.craemer@Sun.COM +'** +'** short description : Subroutines for the data validity test +'** +'************************************************************************ +' ** +' #0 check_message ' Check if the messages in validity test are OK +' ** +'\*********************************************************************** + +sub check_message(MType as String, Celladdress as String, cellcontent as String, wrong as String) +'/// Sub routine for checking message + if MType <> "Macro" then + Kontext "RechenleisteCalc" + if not RechenleisteCalc.isvisible then + ViewToolbarsFormulaBar + end if + Kontext "RechenleisteCalc" + Bereich.TypeKeys "<MOD1 A>" + Bereich.TypeKeys Celladdress + sleep(1) + Bereich.TypeKeys "<RETURN>" + + Kontext "DocumentCalc" + DocumentCalc.TypeKeys cellcontent + DocumentCalc.TypeKeys "<RETURN>" + kontext "active" + if active.exists(2) then + warnlog "Value " & cellcontent & " is correct in cell "& Celladdress & ", so no " & MType & " message must not be appear" + if MType = "Stop" then + active.OK + else + active.Cancel + end if + else + printlog "OK, no " & MType & " message appears, by inserting the correct value into " & Celladdress + end if + + Kontext "RechenleisteCalc" + if not RechenleisteCalc.isvisible then + ViewToolbarsFormulaBar + end if + Kontext "RechenleisteCalc" + Bereich.TypeKeys "<MOD1 A>" + Bereich.TypeKeys Celladdress + sleep(1) + Bereich.TypeKeys "<RETURN>" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys wrong + DocumentCalc.TypeKeys "<RETURN>" + kontext "active" + if active.exists(2) then + printlog "OK, value " & wrong & " is not correct in cell " & Celladdress & ", so the " & MType & " message has to be appear" + if MType = "Stop" then + active.OK + else + active.Cancel + end if + else + warnlog "Value " & wrong & " is not correct for cell " & Celladdress & ", so the " & MType & " message has to be appears" + end if + else + Kontext "RechenleisteCalc" + if not RechenleisteCalc.isvisible then + ViewToolbarsFormulaBar + end if + Kontext "RechenleisteCalc" + Bereich.TypeKeys "<MOD1 A>" + Bereich.TypeKeys Celladdress + sleep(1) + Bereich.TypeKeys "<RETURN>" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys cellcontent + DocumentCalc.TypeKeys "<RETURN>" + DocumentCalc.TypeKeys "<UP><RIGHT>" + FormatCells + Kontext + Active.setPage TabFontEffects + Kontext "TabFontEffects" + if FontColor.getSelIndex = 1 then + printlog "OK, the macro detect the correct word in " & Celladdress + else + warnlog "The Fontcolor is " & FontColor.getSelText & " instead of automatic in cell " & Celladdress + end if + TabFontEffects.Cancel + + Kontext "RechenleisteCalc" + if not RechenleisteCalc.isvisible then + ViewToolbarsFormulaBar + end if + Kontext "RechenleisteCalc" + Bereich.TypeKeys "<MOD1 A>" + Bereich.TypeKeys Celladdress + sleep(1) + Bereich.TypeKeys "<RETURN>" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys wrong + DocumentCalc.TypeKeys "<RETURN>" + DocumentCalc.TypeKeys "<UP><RIGHT>" + FormatCells + Kontext + Active.setPage TabFontEffects + Kontext "TabFontEffects" + if FontColor.getSelIndex = 12 then + printlog "OK, the macro detect the wrong word in " & Celladdress + else + warnlog "The Fontcolor is " & FontColor.getSelText & " instead of light green in cell " & Celladdress + end if + TabFontEffects.Cancel + end if +end sub + diff --git a/testautomation/writer/optional/includes/drawing/w_drawing_tools2.inc b/testautomation/writer/optional/includes/drawing/w_drawing_tools2.inc index f96238cb11a8..463ef593930c 100755 --- a/testautomation/writer/optional/includes/drawing/w_drawing_tools2.inc +++ b/testautomation/writer/optional/includes/drawing/w_drawing_tools2.inc @@ -304,9 +304,9 @@ testcase tGroup_6 Call wTypeKeys "<Right>",2 PrintLog "- Set the focus to rectangle , check if it is moved (Should NOT)" - Call gMouseClick(35,35) + Call gMouseClick(41,40) Call fPositionAndSize("TabPositionAndSizeWriter") - if Horizontalby.Gettext <> sPositionX1 then Warnlog "Rectangle should NOT be moved: X Not -> "+sPositionX1+" but -> "+ Horizontalby.Gettext + if Horizontalby.Gettext <> sPositionX1 then Warnlog "#i106719#Rectangle should NOT be moved: X Not -> "+sPositionX1+" but -> "+ Horizontalby.Gettext if Verticalby.Gettext <> sPositionY1 then Warnlog "Rectangle should NOT be moved: Y Not -> "+sPositionY1+" but -> "+ Verticalby.Gettext TabPositionAndSizeWriter.Cancel @@ -377,7 +377,7 @@ testcase tGroup_7 PrintLog "- Set the focus to rectangle , check if it is moved (Should NOT)." Call gMouseClick(40,40) Call fPositionAndSize("TabPositionAndSizeWriter") - if Horizontalby.Gettext <> sPositionX1 then Warnlog "Rectangle should NOT be moved: X Not -> "+sPositionX1+" but -> "+ Horizontalby.Gettext + if Horizontalby.Gettext <> sPositionX1 then Warnlog "#i106719#Rectangle should NOT be moved: X Not -> "+sPositionX1+" but -> "+ Horizontalby.Gettext if Verticalby.Gettext <> sPositionY1 then Warnlog "Rectangle should NOT be moved: Y Not -> "+sPositionY1+" but -> "+ Verticalby.Gettext TabPositionAndSizeWriter.Cancel diff --git a/testautomation/writer/optional/includes/hyphenation/w_hyphenation.inc b/testautomation/writer/optional/includes/hyphenation/w_hyphenation.inc index c663faf68001..8b7296d1d5a4 100755 --- a/testautomation/writer/optional/includes/hyphenation/w_hyphenation.inc +++ b/testautomation/writer/optional/includes/hyphenation/w_hyphenation.inc @@ -40,354 +40,347 @@ ' #1 tHyphenation_1 ' #1 tHyphenation_2 ' #1 tHyphenation_3 +' #1 tHyphenation_4 '* '\*********************************************************************** testcase tHyphenation_1 - Dim testFile as String - Dim testWord as String - Dim firstPartOfTestWord as String - Dim secondPartOfTestWord as String - - testFile = "tHyphenation.odt" - testWord = "following" - firstPartOfTestWord = "fol" - secondPartOfTestWord = "follow" - - PrintLog "- Test Hyphenation using ctrl and -" - - printlog "Test Hyphenation using ctrl and -" - - printlog "open a test file" - Call hFileOpen ( gTesttoolPath + "writer\optional\input\hyphenation\" + testFile ) - Call sMakeReadOnlyDocumentEditable - - Call wTypeKeys "<End><Shift Mod1 Left>" - - EditCopy - - printlog "add '-' between 'fol' and 'lowing' , then press 3 times 'space bar' (pc). (7 times on linux)" - printlog "+ check if fol in the end of the line" - if GetClipboardText = testWord then - Call wTypeKeys "<Right>" , 3 - Call wTypeKeys "<Mod1 SUBTRACT>" - Call wTypeKeys "<Home>" - if gPlatGroup <> "unx" then - Call wTypeKeys "<SPACE>" ,3 - else - Call wTypeKeys "<SPACE>" ,7 - end if - - Call wTypeKeys "<End><Left><Shift Mod1 Left>" - EditCopy - - if GetClipboardText <> firstPartOfTestWord then - Warnlog "The hyphenation does NOT work well in first part!" - end if - - printlog "add '-' between 'follow' and 'ing' , then press 6 times 'space bar'" - printlog "+ check if follow in the end of the line ." - Call wTypeKeys "<Mod1 z>",2 - Call wTypeKeys "<End>" - Call wTypeKeys "<Left>",3 - Call wTypeKeys "<Mod1 SUBTRACT>" - Call wTypeKeys "<Home>" - if gPlatGroup <> "unx" then - Call wTypeKeys "<SPACE>" ,3 - else - Call wTypeKeys "<SPACE>" ,6 - end if - Call wTypeKeys "<End><Left><Shift Mod1 Left>" - EditCopy - - if GetClipboardText = secondPartOfTestWord then - Call wTypeKeys "<Home>" - - printlog "press 5 times 'space bar'" - printlog "check if fol in the end of the line ." - if gPlatGroup <> "unx" then - Call wTypeKeys "<SPACE>" ,3 - else - Call wTypeKeys "<SPACE>" ,5 - end if - Call wTypeKeys "<End><Shift Mod1 Left>" - EditCopy - - if GetClipboardText <> firstPartOfTestWord then - Warnlog "The hyphenation does NOT work well in first part, but it works fine in second part!" - end if - else - Warnlog "The hyphenation does NOT work well in second part!" - end if - - else - Warnlog "The test word is wrong !!" - end if - - Call hCloseDocument - -endcase + Dim testFile as String + Dim testWord as String + Dim PartOfTestWord as String + + testFile = "tHyphenation.odt" + testWord = "following" + PartOfTestWord = "fol" + + printlog "Test Hyphenation using ctrl and -" + + printlog "open a test file" + Call hFileOpen ( gTesttoolPath + "writer\optional\input\hyphenation\" + testFile ) + Call sMakeReadOnlyDocumentEditable + + ' we must assure the word 'following' is the first word in second line + ' otherwise the test will not work correctly + if fPrepareHyphenationDocument(testWord) = false then + Warnlog "Unable to prepare document for hyphenation. Check testcase" + Call hCloseDocument + end if + + printlog "add '-' between 'fol' and 'lowing'" + printlog "+ check if fol in the end of the line" + + Call wTypeKeys "<Home>" + Call wTypeKeys "<Right>" , 3 + Call wTypeKeys "<Mod1 SUBTRACT>" + Call wTypeKeys "<Mod1 Home>" + Call wTypeKeys "<End>" + Call wTypeKeys "<Delete>" + + Call wTypeKeys "<End><Left>" + Call wTypeKeys "<Mod1 Shift Left>" + EditCopy + + if GetClipboardText <> PartOfTestWord then + Warnlog "The hyphenation does NOT work ! Found '" & GetClipboardText & "' and not '" & PartOfTestWord & "'" + end if + + Call hCloseDocument + +endcase '------------------------------------------------------------------------- testcase tHyphenation_2 -warnlog "#i102304# - outcommenting tHyphenation_2 due to bug." -goto endsub - - Dim testFile as String - Dim testWord as String - Dim firstPartOfTestWord as String - Dim secondPartOfTestWord as String - Dim testWordInHyphenationDlg as String - - testFile = "tHyphenation.odt" - testWord = "following" - testWordInHyphenationDlg = "fol=low-ing" - firstPartOfTestWord = "fol" - secondPartOfTestWord = "follow" - - PrintLog "- Test Hyphenation using Tools/Hyphenation ,test like fol-lowing" - - printlog "Test Hyphenation using Tools/Hyphenation ,test like fol-lowing" - - printlog "open a test file" - Call hFileOpen ( gTesttoolPath + "writer\optional\input\hyphenation\" + testFile ) - Call sMakeReadOnlyDocumentEditable - - Call wTypeKeys "<End><Shift Mod1 Left>" - - EditCopy - - if GetClipboardText <> testWord then - Warnlog "The test word is wrong !!" - goto endsub - end if - - printlog "Press 3 times 'space bar'" - Call wTypeKeys "<Home>" - if gPlatGroup <> "unx" then - Call wTypeKeys "<SPACE>" ,3 - else - Call wTypeKeys "<SPACE>" ,6 - end if - - printlog "Tools/Hyphenation" - ToolsLanguageHyphenate - Kontext "Silbentrennung" - - if Not Silbentrennung.Exists then - Kontext "Active" - if Active.Exists then - if Active.GetRT = 304 then - Active.Yes - - Kontext "Active" - if Active.Exists then - if Active.GetRT = 304 then Active.Ok - end if - end if - end if - Warnlog "Unable to bring up Dialog 'Hyphenation'!" - goto endsub - end if - - printlog "check if get 'fol=low-ing'" - if Wort.Gettext <> testWordInHyphenationDlg then - Warnlog "#i40561# The test can NOT be seperated two times , or something wrong!" - Silbentrennung.Cancel - goto NOTest - end if - - if NOT Vor.IsEnabled then - Warnlog "the Vor button is Not enabled, or something wrong!" - Silbentrennung.Cancel - goto NOTest - end if - - printlog "add '-' between 'fol' and 'lowing' using left arrow key" - Vor.Click - Silbentrennung.OK - - printlog "Close all dialogue, and recover the file to default" - Kontext "Active" - if NOT Active.Exists then - Kontext "Silbentrennung" - Silbentrennung.Cancel - Warnlog "The first message box is NOT pop up" - goto NOTest - end if - - Active.Yes - - Kontext "Active" - if NOT Active.Exists then - Warnlog "The second message box is NOT pop up" - goto endsub - end if - - Active.OK - - printlog "Press 3 times 'space bar' in front of the line" - Call wTypeKeys "<BACKSPACE>",3 - Call wTypeKeys "<SPACE>",3 - - Call wTypeKeys "<End><Left><Shift Mod1 Left>" - EditCopy - - printlog "Check if get 'fol'" - if GetClipboardText <> firstPartOfTestWord then - Warnlog "The hyphenation does NOT work well in first part!" - end if - -NOTest: - Call hCloseDocument - -endcase + Dim testFile as String + Dim testWord as String + Dim PartOfTestWord as String + + testFile = "tHyphenation.odt" + testWord = "following" + PartOfTestWord = "follow" + + printlog "Test Hyphenation using ctrl and -" + + printlog "open a test file" + Call hFileOpen ( gTesttoolPath + "writer\optional\input\hyphenation\" + testFile ) + Call sMakeReadOnlyDocumentEditable + + ' we must assure the word 'following' is the first word in second line + ' otherwise the test will not work correctly + if fPrepareHyphenationDocument(testWord) = false then + Warnlog "Unable to prepare document for hyphenation. Check testcase" + Call hCloseDocument + end if + + printlog "add '-' between 'follow' and 'ing'" + printlog "+ check if 'follow' in the end of the line" + + Call wTypeKeys "<Home>" + Call wTypeKeys "<Right>" , 6 + Call wTypeKeys "<Mod1 SUBTRACT>" + Call wTypeKeys "<Mod1 Home>" + Call wTypeKeys "<End>" + if gPlatgroup = "unx" then + Call wTypeKeys "<Delete>", 6 + else + Call wTypeKeys "<Delete>", 7 + end if + + Call wTypeKeys "<End><Left>" + Call wTypeKeys "<Mod1 Shift Left>" + EditCopy + + if GetClipboardText <> PartOfTestWord then + Warnlog "The hyphenation does NOT work ! Found '" & GetClipboardText & "' and not '" & PartOfTestWord & "'" + end if + + Call hCloseDocument + +endcase '------------------------------------------------------------------------- testcase tHyphenation_3 -warnlog "#i102304# - outcommenting tHyphenation_3 due to bug." -goto endsub - - Dim testFile as String - Dim testWord as String - Dim firstPartOfTestWord - Dim secondPartOfTestWord as String - Dim testWordInHyphenationDlg1 as String - Dim testWordInHyphenationDlg2 as String - - testFile = "tHyphenation.odt" - testWord = "following" - firstPartOfTestWord = "fol" - secondPartOfTestWord = "follow" - testWordInHyphenationDlg1 = "fol=low-ing" - testWordInHyphenationDlg2 = "fol-low=ing" - - printLog "- Test Hyphenation using Tools/Hyphenation ,test like follow-ing" - printlog "Test Hyphenation using Tools/Hyphenation ,test like follow-ing" - - printlog "open a test file" - Call hFileOpen ( gTesttoolPath + "writer\optional\input\hyphenation\" + testFile ) - Call sMakeReadOnlyDocumentEditable - - Call wTypeKeys "<End><Shift Mod1 Left>" - - EditCopy - - if GetClipboardText <> testWord then - Warnlog "The test word is wrong !!" - goto endsub - end if - - printlog "Press 3 times 'space bar'" - Call wTypeKeys "<Home>" - if gPlatGroup <> "unx" then - Call wTypeKeys "<SPACE>" ,3 - else - Call wTypeKeys "<SPACE>" ,6 - end if - - printlog "Tools/Hyphenation" - ToolsLanguageHyphenate - Kontext "Silbentrennung" - - if Not Silbentrennung.Exists then - Kontext "Active" - if Active.Exists then - if Active.GetRT = 304 then - Active.Yes - - Kontext "Active" - if Active.Exists then - if Active.GetRT = 304 then Active.Ok - end if - end if - end if - Warnlog "Unable to bring up Dialog 'Hyphenation'!" - goto endsub - end if - - printlog "check if get 'fol=low-ing'" - if Wort.Gettext <> testWordInHyphenationDlg1 then - Warnlog "#i40561# The test can NOT be seperated two times , or something wrong!" - Silbentrennung.Cancel - goto NOTest - end if - - printlog "click left arrow key" - if NOT Vor.IsEnabled then - Warnlog "the Vor button is Not enabled, or something wrong!" - Silbentrennung.Cancel - goto NOTest - end if - Vor.Click - - printlog "check if get ''fol-low=ing'" - if Wort.Gettext <> testWordInHyphenationDlg2 then - Warnlog "The test word should be changed after clicking Vor!" - goto endsub - end if - - printlog "add '-' between 'follow' and 'ing' pressing right arrow key" - if NOT Zurueck.IsEnabled then - Warnlog "the Zuruech button is Not enabled, or something wrong!" - goto endsub - end if - Zurueck.Click - - printlog "check if get 'fol-low=ing'" - if Wort.Gettext <> testWordInHyphenationDlg1 then - Warnlog "The test word should be changed after clicking Zurueck!" - goto endsub - end if - - Sleep 1 - - printlog "close all dialogue" - Silbentrennung.OK - - Kontext "Active" - if NOT Active.Exists then - Warnlog "The first message box is NOT pop up" - goto endsub - end if - - Active.Yes - - Kontext "Active" - if NOT Active.Exists then - Warnlog "The second message box is NOT pop up" - goto endsub - end if - - Active.OK - - printlog "recover to the default file and press 3 sparc bar in front of the line" - Call wTypeKeys "<BACKSPACE>",3 - Call wTypeKeys "<SPACE>",3 - - Call wTypeKeys "<End><Left><Shift Mod1 Left>" - EditCopy - - printlog "check if get 'follow' in the end of the line" - if GetClipboardText = secondPartOfTestWord then - Call wTypeKeys "<Home>" - Call wTypeKeys "<SPACE>" , 5 - - Call wTypeKeys "<End><Shift Mod1 Left>" - EditCopy + Dim testFile as String + Dim testWord as String + Dim firstPartOfTestWord as String + Dim secondPartOfTestWord as String + Dim testWordInHyphenationDlg as String + + testFile = "tHyphenation.odt" + testWord = "following" + testWordInHyphenationDlg = "fol=low-ing" + firstPartOfTestWord = "fol" + secondPartOfTestWord = "follow" + + printlog "Test Hyphenation using Tools/Hyphenation ,test like fol-lowing" + + printlog "open a test file" + Call hFileOpen ( gTesttoolPath + "writer\optional\input\hyphenation\" + testFile ) + Call sMakeReadOnlyDocumentEditable + + ' we must assure the word 'following' is the first word in second line + ' otherwise the test will not work correctly + if fPrepareHyphenationDocument(testWord) = false then + Warnlog "Unable to prepare document for hyphenation. Check testcase" + Call hCloseDocument + end if + + Call wTypeKeys "<Mod1 Home>" + Call wTypeKeys "<End>" + if gPlatgroup = "unx" then + Call wTypeKeys "<Delete>", 6 + else + Call wTypeKeys "<Delete>", 7 + end if + + printlog "Tools/Hyphenation" + ToolsLanguageHyphenate + Kontext "Silbentrennung" + + if Not Silbentrennung.Exists then + Warnlog "Unable to bring up Dialog 'Hyphenation'!" + Call hCloseDocument + goto endsub + end if + + printlog "check if get 'fol=low-ing'" + if Wort.Gettext <> testWordInHyphenationDlg then + Warnlog "Expected " & testWordInHyphenationDlg & " but found " & Wort.Gettext + Silbentrennung.Cancel + Call hCloseDocument + goto endsub + end if + + if NOT Vor.IsEnabled then + Warnlog "the 'Vor' button is Not enabled, or something wrong!" + Silbentrennung.Cancel + Call hCloseDocument + goto endsub + end if + + printlog "add '-' between 'fol' and 'lowing' using left arrow key" + Vor.Click + Silbentrennung.OK + + ' Messagebox 'Start hypheantion from the beginning ? + Kontext "Active" + if Active.Exists then + if Active.GetRT = 304 then + try + Active.Yes + catch + Active.ok + endcatch + else + Warnlog "No messagebox asking for hyphenate at beginning of document" + end if + end if + + ' End of hyphenation message + if Active.Exists then + if Active.GetRT = 304 then + try + Active.Ok + catch + Active.yes + endcatch + else + Warning "No 'end of hyphenation' messagebox" + end if + end if + + printlog "Press 3 times 'space bar' in front of the line" + Call wTypeKeys "<Mod1 Home>" + Call wTypeKeys "<End>" + Call wTypeKeys "<Left>" + Call wTypeKeys "<Shift Mod1 Left>" + EditCopy + + printlog "Check if get 'fol'" + if GetClipboardText <> firstPartOfTestWord then + Warnlog "The hyphenation does NOT work ! Found '" & GetClipboardText & "' and not '" & PartOfTestWord & "'" + end if + + Call hCloseDocument + +endcase - if GetClipboardText <> firstPartOfTestWord then - Warnlog "The hyphenation does NOT work well in first part, but it works fine in second part!" - end if - else - Warnlog "The hyphenation does NOT work well in second part!" - end if -NOTest: - Call hCloseDocument +'------------------------------------------------------------------------- +testcase tHyphenation_4 + + Dim testFile as String + Dim testWord as String + Dim firstPartOfTestWord as string + Dim secondPartOfTestWord as String + Dim testWordInHyphenationDlg1 as String + Dim testWordInHyphenationDlg2 as String + + testFile = "tHyphenation.odt" + testWord = "following" + firstPartOfTestWord = "fol" + secondPartOfTestWord = "follow" + testWordInHyphenationDlg1 = "fol=low-ing" + testWordInHyphenationDlg2 = "fol-low=ing" + + printLog "- Test Hyphenation using Tools/Hyphenation ,test like follow-ing" + printlog "Test Hyphenation using Tools/Hyphenation ,test like follow-ing" + + printlog "open a test file" + Call hFileOpen ( gTesttoolPath + "writer\optional\input\hyphenation\" + testFile ) + Call sMakeReadOnlyDocumentEditable + + ' we must assure the word 'following' is the first word in second line + ' otherwise the test will not work correctly + if fPrepareHyphenationDocument(testWord) = false then + Warnlog "Unable to prepare document for hyphenation. Check testcase" + Call hCloseDocument + end if + + Call wTypeKeys "<Mod1 Home>" + Call wTypeKeys "<End>" + if gPlatgroup = "unx" then + Call wTypeKeys "<Delete>", 6 + else + Call wTypeKeys "<Delete>", 7 + end if + + printlog "Tools/Hyphenation" + ToolsLanguageHyphenate + Kontext "Silbentrennung" + + if Not Silbentrennung.Exists then + Call hCloseDocument + goto endsub + end if + + printlog "check if get 'fol=low-ing'" + if Wort.Gettext <> testWordInHyphenationDlg1 then + Warnlog "Expected " & testWordInHyphenationDlg1 & " but found " & Wort.Gettext + Silbentrennung.Cancel + Call hCloseDocument + goto endsub + end if + + printlog "click left arrow key" + if NOT Vor.IsEnabled then + Warnlog "the Vor button is Not enabled, or something wrong!" + Silbentrennung.Cancel + Call hCloseDocument + goto endsub + end if + Vor.Click + + printlog "check if get ''fol-low=ing'" + if Wort.Gettext <> testWordInHyphenationDlg2 then + Warnlog "Expected " & testWordInHyphenationDlg2 & " but found " & Wort.Gettext + Call hCloseDocument + goto endsub + end if + + printlog "add '-' between 'follow' and 'ing' pressing right arrow key" + if NOT Zurueck.IsEnabled then + Warnlog "the 'Back' button is Not enabled, or something wrong!" + Call hCloseDocument + goto endsub + end if + Zurueck.Click + + printlog "check if get 'fol-low=ing'" + if Wort.Gettext <> testWordInHyphenationDlg1 then + Warnlog "The test word should be changed after clicking Zurueck!" + Call hCloseDocument + goto endsub + end if + + Sleep 1 + + printlog "close all dialogs" + Silbentrennung.OK + + ' Messagebox 'Start hypheantion from the beginning ? + Kontext "Active" + if Active.Exists then + if Active.GetRT = 304 then + try + Active.Yes + catch + Active.ok + endcatch + else + Warnlog "No messagebox asking for hyphenate at beginning of document" + end if + end if + + ' End of hyphenation message + if Active.Exists then + if Active.GetRT = 304 then + try + Active.Ok + catch + Active.yes + endcatch + else + Warning "No 'end of hyphenation' messagebox" + end if + end if + + printlog "Press 3 times 'space bar' in front of the line" + Call wTypeKeys "<Mod1 Home>" + Call wTypeKeys "<End>" + Call wTypeKeys "<Left>" + Call wTypeKeys "<Shift Mod1 Left>" + EditCopy + + printlog "Check if get 'follow'" + if GetClipboardText <> secondPartOfTestWord then + Warnlog "The hyphenation does NOT work ! Found '" & GetClipboardText & "' and not '" & secondPartOfTestWord & "'" + end if + + Call hCloseDocument + endcase diff --git a/testautomation/writer/optional/includes/loadsave/w_loadsave.inc b/testautomation/writer/optional/includes/loadsave/w_loadsave.inc index ad2c3122da63..fd927b339685 100644 --- a/testautomation/writer/optional/includes/loadsave/w_loadsave.inc +++ b/testautomation/writer/optional/includes/loadsave/w_loadsave.inc @@ -51,7 +51,6 @@ testcase tExportAllReadableFormatsIntoODF end if Dim AvailableFilters( 35 ) as String - Dim TemplateFilterFile as String Dim ImportFileList ( 300 ) as String Dim ExportFileList ( 300 ) as String Dim WorkDirectory as String @@ -61,7 +60,6 @@ testcase tExportAllReadableFormatsIntoODF Dim sExportFile as string Dim i as Integer - TemplateFilterFile = ConvertPath ( gTesttoolPath + "writer\optional\input\filterlist.txt") WorkDirectory = ( ConvertPath ( gOfficePath + "user\work\" + gPlatgroup + "\export\")) ImportDir = ConvertPath ( gTesttoolPath + "writer\optional\input\import\") @@ -84,98 +82,103 @@ testcase tExportAllReadableFormatsIntoODF printlog "- Start loading files in list" For i = 1 to listCount(ImportFileList()) printlog "- " & i & ". load: " & ImportFileList(i) - Call hFileOpen ( ImportFileList(i) ) - printlog "- done" - - Kontext "TextImport" - if TextImport.Exists then - TextImport.Ok - printlog "- Text import dialog passed" - end if - - Kontext "Filterauswahl" - if Filterauswahl.Exists then - Filterauswahl.Cancel - printlog "- Filterdialog passed" - end if - - Kontext "AsciiFilterOptionen" - if AsciiFilterOptionen.Exists then - AsciiFilterOptionen.Ok - printlog "- ASCII-Filter dialog passed" - end if - - Kontext "SecurityWarning" - if SecurityWarning.Exists(3) then - SecurityWarning.Ok - printlog "- Security warning passed" - end if - - Kontext "DocumentWriter" - if DocumentWriter.Exists(3) then - Do until DocumentWriter.StatusIsProgress = false - wait 500 - Loop + sExportFile = ImportFileList(i) + if GetExtention ( sExportFile ) = "psw" then + QAErrorlog "#i102221#Pocket Word filter puts General I/O Error" else - Kontext "DocumentCalc" - if DocumentCalc.Exists(3) then - Do until DocumentCalc.StatusIsProgress = false + Call hFileOpen ( ImportFileList(i) ) + printlog "- done" + + Kontext "TextImport" + if TextImport.Exists then + TextImport.Ok + printlog "- Text import dialog passed" + end if + + Kontext "Filterauswahl" + if Filterauswahl.Exists then + Filterauswahl.Cancel + printlog "- Filterdialog passed" + end if + + Kontext "AsciiFilterOptionen" + if AsciiFilterOptionen.Exists then + AsciiFilterOptionen.Ok + printlog "- ASCII-Filter dialog passed" + end if + + Kontext "SecurityWarning" + if SecurityWarning.Exists(3) then + SecurityWarning.Ok + printlog "- Security warning passed" + end if + + Kontext "DocumentWriter" + if DocumentWriter.Exists(3) then + Do until DocumentWriter.StatusIsProgress = false wait 500 Loop else - Warnlog "Neither DocumentWriter or DocumentCalc existed? Some other dialogue in focus?" + Kontext "DocumentCalc" + if DocumentCalc.Exists(3) then + Do until DocumentCalc.StatusIsProgress = false + wait 500 + Loop + else + Warnlog "Neither DocumentWriter or DocumentCalc existed? Some other dialogue in focus?" + end if end if - end if - - ' Check for macro alert - Kontext "SecurityWarning" - if SecurityWarning.Exists then - if inStr(ImportFileList(i),"sw40") = false then - QAErrorlog "Macro-Security Warning is up though document should have no macro! Macro disabled" + + ' Check for macro alert + Kontext "SecurityWarning" + if SecurityWarning.Exists then + if inStr(ImportFileList(i),"sw40") = false then + QAErrorlog "Macro-Security Warning is up though document should have no macro! Macro disabled" + end if + SecurityWarning.Cancel + end if + Sleep 1 + + Kontext "AlienWarning" + if AlienWarning.Exists then + AlienWarning.Ok + printlog "- Alien warning passed" end if - SecurityWarning.Cancel - end if - Sleep 1 - - Kontext "AlienWarning" - if AlienWarning.Exists then - AlienWarning.Ok - printlog "- Alien warning passed" - end if - - ' HTML-File can't be exported as odf this way - if GetExtention(ImportFileList(i)) <> "html" then - - sExportFile = WorkDirectory & "ExportedFile" & i & ".odf" - Printlog "- Save as : " & ConvertPath ( sExportFile ) - if hFileSaveAsWithFilterKill (sExportFile, "writer8") = true then - printlog "- done" - printlog "- close file" - Call hCloseDocument - Printlog "- Open previous saved file" - Call hFileOpenWithFilter (sExportFile, "writer8") - printlog "- done" - ' Check for macro alert - Kontext "SecurityWarning" - if SecurityWarning.Exists then - if inStr(ImportFileList(i),"sw40") = false then - QAErrorlog "Macro-Security Warning is up though document should have no macro! Macro disabled" + ' HTML-File can't be exported as odf this way + if GetExtention(ImportFileList(i)) <> "html" then + + sExportFile = WorkDirectory & "ExportedFile" & i & ".odf" + Printlog "- Save as : " & ConvertPath ( sExportFile ) + if hFileSaveAsWithFilterKill (sExportFile, "writer8") = true then + printlog "- done" + printlog "- close file" + Call hCloseDocument + + Printlog "- Open previous saved file" + Call hFileOpenWithFilter (sExportFile, "writer8") + printlog "- done" + ' Check for macro alert + Kontext "SecurityWarning" + if SecurityWarning.Exists then + if inStr(ImportFileList(i),"sw40") = false then + QAErrorlog "Macro-Security Warning is up though document should have no macro! Macro disabled" + end if + SecurityWarning.Cancel end if - SecurityWarning.Cancel + Sleep 1 + else + Warnlog "Unable to save file: " & sExportFile end if - Sleep 1 else - Warnlog "Unable to save file: " & sExportFile + printlog "- HTML-file is not exported this way" end if - else - printlog "- HTML-file is not exported this way" - end if - - printlog "- Close all open files." - Do Until GetDocumentCount = 0 - Call hCloseDocument - Loop + + printlog "- Close all open files." + Do Until GetDocumentCount = 0 + Call hCloseDocument + Loop + endif next i 'File endcase @@ -190,7 +193,6 @@ testcase tExportAllReadableFormatsIntoThemselves end if Dim AvailableFilters( 35 ) as String - Dim TemplateFilterFile as String Dim SavedCorrectly as Boolean Dim ImportFileList ( 300 ) as String Dim ExportFileList ( 300 ) as String @@ -205,7 +207,6 @@ testcase tExportAllReadableFormatsIntoThemselves Dim iCounter as integer Dim DocumentCount as integer - TemplateFilterFile = ConvertPath ( gTesttoolPath + "writer\optional\input\filterlist.txt") sWorkDirectory = ( ConvertPath ( gOfficePath + "user\work\" + gPlatgroup + "\export\")) sImportDir = ConvertPath ( gTesttoolPath + "writer\optional\input\import\") @@ -220,155 +221,150 @@ testcase tExportAllReadableFormatsIntoThemselves end if app.Mkdir sWorkDirectory - QAErrorlog "#i102221#Pocketword-filter seems broken." - - For iCurrentFileIndex = 1 to 16 + For iCurrentFileIndex = 7 to 7 select case iCurrentFileIndex - case 1 : sCurrentFile = "xml2.odt" - sCurrentFilter = "writer8" - case 2 : sCurrentFile = "wpsfile.wps" - sCurrentFilter = "Text (encoded)" - case 3 : sCurrentFile = "dostext.txt" - sCurrentFilter = "Text (encoded)" - case 4 : sCurrentFile = "sw30.sdw" - sCurrentFilter = "StarWriter 3.0" - case 5 : sCurrentFile = "sw50.vor" - sCurrentFilter = "StarWriter 5.0 Vorlage/Template" - case 6 : sCurrentFile = "sw31.sdw" - sCurrentFilter = "StarWriter 3.0" - case 7 : sCurrentFile = "sw31.vor" - sCurrentFilter = "StarWriter 3.0 Vorlage/Template" - case 8 : sCurrentFile = "sw40.sdw" - sCurrentFilter = "StarWriter 4.0" - case 9 : sCurrentFile = "sw40_sp2.vor" - sCurrentFilter = "StarWriter 4.0 Vorlage/Template" - case 10 : sCurrentFile = "sw50.sdw" - sCurrentFilter = "StarWriter 5.0" - case 11 : sCurrentFile = "html.html" - sCurrentFilter = "HTML (StarWriter)" - case 12 : sCurrentFile = "rtf.rtf" - sCurrentFilter = "Rich Text Format" - case 13 : sCurrentFile = "sw60.sxw" - sCurrentFilter = "StarOffice XML (Writer)" - case 14 : sCurrentFile = "winw97.doc" - sCurrentFilter = "MS Word 97" - case 15 : sCurrentFile = "winword6.doc" - sCurrentFilter = "MS Word 95" - case 16 : sCurrentFile = "wintext.txt" - sCurrentFilter = "Text (encoded)" -' case 17 : sCurrentFile = "pocketword.psw" -' sCurrentFilter = "PocketWord File" - - -'TODO: 18-23 not applyable. Can be opened, but saving in the format is not supported. - -' case 18 : sCurrentFile = "unixtext.txt" -' sCurrentFilter = "Text" -' case 19 : sCurrentFile = "sw2.sdw" -' sCurrentFilter = "StarWriter 2.0" -' case 20 : sCurrentFile = "amipro3.sam" -' sCurrentFilter = "Ami Pro 1.x-3.1 (W4W)" -' case 21 : sCurrentFile = "mactext.txt" -' sCurrentFilter = "Mac Write 4.x 5.0 (W4W)" -' case 22 : sCurrentFile = "sw1.sdw" -' sCurrentFilter = "StarWriter 1.0" -' case 23 : sCurrentFile = "swdoc.txt" -' sCurrentFilter = "Text (encoded) (StarWriter/GlobalDocument)" -' case 24 : sCurrentFile = "hangul.hwp" -' sCurrentFilter = "writer_MIZI_Hwp_97" + case 1 : sCurrentFile = "xml2.odt" + sCurrentFilter = "writer8" + case 2 : sCurrentFile = "wpsfile.wps" + sCurrentFilter = "Text (encoded)" + case 3 : sCurrentFile = "dostext.txt" + sCurrentFilter = "Text (encoded)" + case 4 : sCurrentFile = "sw30.sdw" + sCurrentFilter = "StarWriter 3.0" + case 5 : sCurrentFile = "sw50.vor" + sCurrentFilter = "StarWriter 5.0 Vorlage/Template" + case 6 : sCurrentFile = "sw31.sdw" + sCurrentFilter = "StarWriter 3.0" + case 7 : sCurrentFile = "sw31.vor" + sCurrentFilter = "StarWriter 3.0 Vorlage/Template" + case 8 : sCurrentFile = "sw40.sdw" + sCurrentFilter = "StarWriter 4.0" + case 9 : sCurrentFile = "sw40_sp2.vor" + sCurrentFilter = "StarWriter 4.0 Vorlage/Template" + case 10 : sCurrentFile = "sw50.sdw" + sCurrentFilter = "StarWriter 5.0" + case 11 : sCurrentFile = "html.html" + sCurrentFilter = "HTML (StarWriter)" + case 12 : sCurrentFile = "rtf.rtf" + sCurrentFilter = "Rich Text Format" + case 13 : sCurrentFile = "sw60.sxw" + sCurrentFilter = "StarOffice XML (Writer)" + case 14 : sCurrentFile = "winw97.doc" + sCurrentFilter = "MS Word 97" + case 15 : sCurrentFile = "winword6.doc" + sCurrentFilter = "MS Word 95" + case 16 : sCurrentFile = "wintext.txt" + sCurrentFilter = "Text (encoded)" +' case 17 : sCurrentFile = "pocketword.psw" +' sCurrentFilter = "PocketWord File" +' TODO: 18-23 not applyable. Can be opened, but saving in the format is not supported. +' case 18 : sCurrentFile = "unixtext.txt" +' sCurrentFilter = "Text" +' case 19 : sCurrentFile = "sw2.sdw" +' sCurrentFilter = "StarWriter 2.0" +' case 20 : sCurrentFile = "amipro3.sam" +' sCurrentFilter = "Ami Pro 1.x-3.1 (W4W)" +' case 21 : sCurrentFile = "mactext.txt" +' sCurrentFilter = "Mac Write 4.x 5.0 (W4W)" +' case 22 : sCurrentFile = "sw1.sdw" +' sCurrentFilter = "StarWriter 1.0" +' case 23 : sCurrentFile = "swdoc.txt" +' sCurrentFilter = "Text (encoded) (StarWriter/GlobalDocument)" +' case 24 : sCurrentFile = "hangul.hwp" +' sCurrentFilter = "writer_MIZI_Hwp_97" end select - printlog " - Export of File nr " + iCurrentFileIndex + " started." - sLoadFile = sImportDir & sCurrentFile - sSaveFile = sWorkDirectory & "filenr_" & iCurrentFileIndex - - try - - ' Load In-file - Call hFileOpenWithFilter(sLoadFile, sCurrentFilter, false) - - kontext "active" - if active.exists(2) then - active.ok - warnlog "Error with file " + sLoadFile + " as " + sSaveFile + "." - end if - - Kontext "TextImport" - if TextImport.Exists then - TextImport.Ok - end if - - Kontext "Filterauswahl" - if Filterauswahl.Exists then - Filterauswahl.Cancel - end if - - Kontext "AsciiFilterOptionen" - if AsciiFilterOptionen.Exists then AsciiFilterOptionen.Ok - Kontext "SecurityWarning" - if SecurityWarning.Exists(3) then SecurityWarning.Ok - Kontext "DocumentWriter" - if DocumentWriter.Exists(3) then - Do until DocumentWriter.StatusIsProgress = false - wait 500 - Loop - else - Kontext "DocumentCalc" - if DocumentCalc.Exists(3) then - Do until DocumentCalc.StatusIsProgress = false - wait 500 - Loop - else - Warnlog "Neither DocumentWriter or DocumentCalc existed? Some other dialogue in focus?" - end if - end if - - ' Check for macro alert - Kontext "SecurityWarning" - if SecurityWarning.Exists then - if inStr(currentfile,"sw40") = false then - QAErrorlog "Macro-Security Warning is up though document should have no macro! Macro disabled" - end if - SecurityWarning.Cancel - end if - Sleep 1 - - Kontext "AlienWarning" - if AlienWarning.Exists then AlienWarning.Ok - - ' Save Out-file - Call hFileSaveAsWithFilterKill(sSaveFile, sCurrentFilter) - - kontext "active" - if active.exists(2) then - active.ok - warnlog "Error saving file " + sLoadFile + " as " + sSaveFile + "." - goto Cleanup - end if - - ' Load Out-file again - Call hFileOpenWithFilter(sSaveFile, sCurrentFilter, false) - - ' Check for macro alert - Kontext "SecurityWarning" - if SecurityWarning.Exists then - if inStr(currentfile,"sw40") > 0 then - QAErrorlog "Macro-Security Warning is up though document should have no macro! Macro disabled" - end if - SecurityWarning.Cancel - end if - Sleep 1 - - catch - Warnlog "Error with file: " + sLoadFile - endcatch + sSaveFile = sWorkDirectory & "filenr_" & iCurrentFileIndex & "." & GetExtention ( sCurrentFile ) + printlog "- Export of File nr " + iCurrentFileIndex + " started" + printlog " - Save file: " & sLoadFile + printlog " - to file: " & sSaveFile + + + ' Load In-file + Call hFileOpenWithFilter(sLoadFile, sCurrentFilter, false) + + kontext "active" + if active.exists(2) then + active.ok + warnlog "Error with file " + sLoadFile + " as " + sSaveFile + "." + end if + + Kontext "TextImport" + if TextImport.Exists then + TextImport.Ok + end if + + Kontext "Filterauswahl" + if Filterauswahl.Exists then + Filterauswahl.Cancel + end if + + Kontext "AsciiFilterOptionen" + if AsciiFilterOptionen.Exists then AsciiFilterOptionen.Ok + Kontext "SecurityWarning" + if SecurityWarning.Exists(3) then SecurityWarning.Ok + Kontext "DocumentWriter" + if DocumentWriter.Exists(3) then + Do until DocumentWriter.StatusIsProgress = false + wait 500 + Loop + else + Kontext "DocumentCalc" + if DocumentCalc.Exists(3) then + Do until DocumentCalc.StatusIsProgress = false + wait 500 + Loop + else + Warnlog "Neither DocumentWriter or DocumentCalc existed? Some other dialogue in focus?" + end if + end if + + ' Check for macro alert + Kontext "SecurityWarning" + if SecurityWarning.Exists then + if inStr(currentfile,"sw40") = false then + QAErrorlog "Macro-Security Warning is up though document should have no macro! Macro disabled" + end if + SecurityWarning.Cancel + end if + Sleep 1 + + Kontext "AlienWarning" + if AlienWarning.Exists then AlienWarning.Ok + + ' Save Out-file + Call hFileSaveAsWithFilterKill(sSaveFile, sCurrentFilter) + + kontext "active" + if active.exists(2) then + active.ok + warnlog "Error saving file " + sLoadFile + " as " + sSaveFile + "." + goto Cleanup + end if + + ' Load Out-file again + Call hFileOpenWithFilter(sSaveFile, sCurrentFilter, false) + + ' Check for macro alert + Kontext "SecurityWarning" + if SecurityWarning.Exists then + if inStr(currentfile,"sw40") > 0 then + QAErrorlog "Macro-Security Warning is up though document should have no macro! Macro disabled" + end if + SecurityWarning.Cancel + end if + Sleep 1 Cleanup: kontext "active" if active.exists(2) then active.ok - warnlog "Error with file " + sLoadFile + " as " + sSaveFile + "." + Select Case iCurrentFileIndex + case 7: QAErrorlog "#i106758#Saving StarWriter 3 template corrupts file" + case else + warnlog "Error with file " + sLoadFile + " as " + sSaveFile + "." + end select end if printlog " Close all open files." @@ -420,132 +416,79 @@ testcase tExportTop5FormatsIntoTop5 '// Start of the LOAD-Loop For iCurrentLoadFileIndex = 1 to 4 Select case iCurrentLoadFileIndex - case 1 : sCurrentLoadFile = "xml2.odt" - sCurrentLoadFilter = "writer8" - case 2 : sCurrentLoadFile = "sw60.sxw" - sCurrentLoadFilter = "StarOffice XML (Writer)" - case 3 : sCurrentLoadFile = "winw97.doc" - sCurrentLoadFilter = "MS Word 97" - case 4 : sCurrentLoadFile = "rtf.rtf" - sCurrentLoadFilter = "Rich Text Format" - case 5 : sCurrentLoadFile = "html.html" - sCurrentLoadFilter = "HTML (StarWriter)" + case 1 : sCurrentLoadFile = sImportDir & "xml2.odt" + sCurrentLoadFilter = "writer8" + case 2 : sCurrentLoadFile = sImportDir & "sw60.sxw" + sCurrentLoadFilter = "StarOffice XML (Writer)" + case 3 : sCurrentLoadFile = sImportDir & "winw97.doc" + sCurrentLoadFilter = "MS Word 97" + case 4 : sCurrentLoadFile = sImportDir & "rtf.rtf" + sCurrentLoadFilter = "Rich Text Format" + case 5 : sCurrentLoadFile = sImportDir & "html.html" + sCurrentLoadFilter = "HTML (StarWriter)" End select - printlog " - Export of File nr " + iCurrentLoadFileIndex + " started." - - call fLoadTheFile((sImportDir & sCurrentLoadFile), sCurrentLoadFilter) - + printlog "- Export of File nr " + iCurrentLoadFileIndex + " started." + printlog " - Save file: " & sCurrentLoadFile + '/// Here comes the SAVE-Loop For iCurrentSaveFileIndex = 1 to 5 - Select case iCurrentSaveFileIndex - case 1 : sCurrentSaveFile = "SavedFile_l" + iCurrentLoadFileIndex + "_s1.odt" - sCurrentSaveFilter = "writer8" - case 2 : sCurrentSaveFile = "SavedFile_l" + iCurrentLoadFileIndex + "_s2.sxw" - sCurrentSaveFilter = "StarOffice XML (Writer)" - case 3 : sCurrentSaveFile = "SavedFile_l" + iCurrentLoadFileIndex + "_s3.doc" - sCurrentSaveFilter = "MS Word 97" - case 4 : sCurrentSaveFile = "SavedFile_l" + iCurrentLoadFileIndex + "_s4.rtf" - sCurrentSaveFilter = "Rich Text Format" - case 5 : sCurrentSaveFile = "SavedFile_l" + iCurrentLoadFileIndex + "_s5.html" - sCurrentSaveFilter = "HTML (StarWriter)" - End select - - Call hFileSaveAsWithFilterKill((sWorkDirectory & sCurrentSaveFile), sCurrentSaveFilter) - - if hFileExists (sWorkDirectory & sCurrentSaveFile) then - - 'Check if the saved file can be loaded - call fLoadTheFile((sWorkDirectory & sCurrentSaveFile), sCurrentSaveFilter) - - 'Close the opened file - Do Until GetDocumentCount = 1 - Call hCloseDocument - Loop - end if + if hFileOpenWithFilter((sCurrentLoadFile), sCurrentLoadFilter) = true then + Select case iCurrentSaveFileIndex + case 1 : sCurrentSaveFile = sWorkDirectory & "SavedFile_l" + iCurrentLoadFileIndex + "_s1.odt" + sCurrentSaveFilter = "writer8" + case 2 : sCurrentSaveFile = sWorkDirectory & "SavedFile_l" + iCurrentLoadFileIndex + "_s2.sxw" + sCurrentSaveFilter = "StarOffice XML (Writer)" + case 3 : sCurrentSaveFile = sWorkDirectory & "SavedFile_l" + iCurrentLoadFileIndex + "_s3.doc" + sCurrentSaveFilter = "MS Word 97" + case 4 : sCurrentSaveFile = sWorkDirectory & "SavedFile_l" + iCurrentLoadFileIndex + "_s4.rtf" + sCurrentSaveFilter = "Rich Text Format" + case 5 : sCurrentSaveFile = sWorkDirectory & "SavedFile_l" + iCurrentLoadFileIndex + "_s5.html" + sCurrentSaveFilter = "HTML (StarWriter)" + End select + + printlog " - " & iCurrentSaveFileIndex & ". to file: " & sCurrentSaveFile + if hFileSaveAsWithFilterKill(sCurrentSaveFile, sCurrentSaveFilter) = true then + printlog " - close all open documents" + Do Until GetDocumentCount = 0 + Call hCloseDocument + Loop + printlog " - check if file exists" + if hFileExists (sCurrentSaveFile) then + printlog " - success" + printlog " - reload previously saved file" + if hFileOpenWithFilter(sCurrentSaveFile, sCurrentSaveFilter) = true then + printlog " - success" + else + Warnlog "error loading file: " & sCurrentSaveFile + end if + Do Until GetDocumentCount = 0 + Call hCloseDocument + Loop + else + Warnlog "Saved file doesn't exist" + 'Close the opened file + Do Until GetDocumentCount = 0 + Call hCloseDocument + Loop + end if + else + Warnlog "Error saving file: " & sCurrentLoadFile + 'Close the opened file + Do Until GetDocumentCount = 0 + Call hCloseDocument + Loop + end if + else + Warnlog "Error loading file: " & sCurrentLoadFile + 'Close the opened file + Do Until GetDocumentCount = 0 + Call hCloseDocument + Loop + end if Next iCurrentSaveFileIndex - '/// Here ends the Save-Loop - - Cleanup: - kontext "active" - if active.exists(2) then - active.ok - warnlog "Error. Last file processed: " + sCurrentLoadFile + " as " + sCurrentSaveFile + "." - end if - - printlog " Close all open files." - - Do Until GetDocumentCount = 0 - Call hCloseDocument - Loop - - printlog " - File nr " + iCurrentLoadFileIndex + " completed." + printlog "- Export of File nr " + iCurrentLoadFileIndex + " completed." Next iCurrentLoadFileIndex '// End of the LOAD-Loop. endcase - -'--------------------------------------------------------------------------------------------------------------------- - -function fLoadTheFile(sLoadFile as string, sCurrentFilter as string) - - try - ' Load In-file - Call hFileOpenWithFilter(sLoadFile, sCurrentFilter, false) - - kontext "active" - if active.exists(2) then - active.ok - warnlog "Error with file " + sLoadFile + " as " + sSaveFile + "." - end if - - Kontext "TextImport" - if TextImport.Exists then - TextImport.Ok - end if - - Kontext "Filterauswahl" - if Filterauswahl.Exists then - Filterauswahl.Cancel - end if - - Kontext "AsciiFilterOptionen" - if AsciiFilterOptionen.Exists then AsciiFilterOptionen.Ok - Kontext "SecurityWarning" - if SecurityWarning.Exists(3) then SecurityWarning.Ok - Kontext "DocumentWriter" - if DocumentWriter.Exists(3) then - Do until DocumentWriter.StatusIsProgress = false - wait 500 - Loop - else - Kontext "DocumentCalc" - if DocumentCalc.Exists(3) then - Do until DocumentCalc.StatusIsProgress = false - wait 500 - Loop - else - Warnlog "Neither DocumentWriter or DocumentCalc existed? Some other dialogue in focus?" - end if - end if - - ' Check for macro alert - Kontext "SecurityWarning" - if SecurityWarning.Exists then - if inStr(currentfile,"sw40") > 0 then - QAErrorlog "Macro-Security Warning is up though document should have no macro! Macro disabled" - end if - SecurityWarning.Cancel - end if - Sleep 1 - - Kontext "AlienWarning" - if AlienWarning.Exists then AlienWarning.Ok - - catch - Warnlog "Error with file: " + sLoadFile - endcatch -end function 'fLoadTheFile - -'------------------------------------------------------------------------------------------------------------------------------------------------ - diff --git a/testautomation/writer/optional/includes/table/w_204a_.inc b/testautomation/writer/optional/includes/table/w_204a_.inc index 4b18bb064fe2..9ab42295d521 100755 --- a/testautomation/writer/optional/includes/table/w_204a_.inc +++ b/testautomation/writer/optional/includes/table/w_204a_.inc @@ -355,19 +355,13 @@ testcase sTableMergeCell Call hNewDocument - ' set marks to find - Call wTypeKeys "NULL<return>" - Call wTypeKeys "Start<return>" - Call wTypeKeys "End<return>" - Call wTypeKeys "NULL<return><up><up>" - temp (1) = "Table1" - '/// Insert a table with 10 columns and 7 rows + printlog "Insert a table with 10 columns and 7 rows" Call TBOhTabelleEinfuegen (temp (1) ,0,1,0,1,"10",tHeight:="7") ' insert table + printlog "Point cursor out of the table" Call wTypeKeys "<MOD1 END>", 2 - Call wTypeKeys "<up><up>" - '/// Insert a table with 10 columns and 10 rows + printlog "Insert a table with 10 columns and 10 rows" temp (1) = "Table2" Call TBOhTabelleEinfuegen (temp (1) ,0,0,1,1,"10",tHeight:="10") ' insert table @@ -383,49 +377,21 @@ testcase sTableMergeCell Call wTypeKeys "<down><shift down>" ' 2 vertical (1,2) & (1,3) TableMergeCells : inc ac : dec fc Call wTypeKeys "<down><up><shift down><shift up>" ' merge again - 'Warnlog "Merge cells will crash when only one cell is selected (#i33394)" TableMergeCells - ' go to top of table, move to end & count + printlog "Go to top of table" Call wTypeKeys "<mod1 home>" - for i=1 to fc - Call wTypeKeys "<right>" - next i - Call wTypeKeys "<down>" - Call wTypeKeys "<shift end>" ' right after/outside the table -> - try - EditCopy - catch - Warnlog "Test didn't find the end of the table, stops here!" - Call hCloseDocument - goto endsub - endcatch - if (GetClipboardText <> "End") then - Warnlog "Test didn't find the end of the table, stops here! Found:" & GetClipboardtext - Call hCloseDocument - goto endsub - end if - ' undo & check where we are + printlog "Undo all cell mergers (3 times)" for i=1 to ac - EditUndo + try + EditUndo + wait 500 + catch + Warnlog "Edit / Undo disabled on Undo step: " & i + endcatch next i - - sleep (3) - temp (2) = hGetTableName() - if (temp(2) <> temp(1)) then warnlog " --- wrong table? schould be : "+temp (1)+ ", is : "+temp(2) - EditUndo ' go one step further - EditUndo ' go one step further - Call wTypeKeys "<up><shift end>" - EditCopy - temp(2) = GetClipboardText - Call wTypeKeys "<down><shift home>" - EditCopy - temp(3) = GetClipboardText - if ((temp(2) <> "Start") AND (temp(3) <> "End")) then - warnlog "there is smth. wrong with the undo stuff !!! is:"+temp(3) +" and:"+temp(2)+" should:End Start" - end if - '/// Close document + printlog "Close document" Call hCloseDocument endcase diff --git a/testautomation/writer/optional/input/hyphenation/tHyphenation.odt b/testautomation/writer/optional/input/hyphenation/tHyphenation.odt Binary files differindex 8854a645a9d7..b2b0494cd4e7 100755 --- a/testautomation/writer/optional/input/hyphenation/tHyphenation.odt +++ b/testautomation/writer/optional/input/hyphenation/tHyphenation.odt diff --git a/testautomation/writer/optional/w_hyphenation.bas b/testautomation/writer/optional/w_hyphenation.bas index e71c1ad8a978..0a4fe264f5ab 100644 --- a/testautomation/writer/optional/w_hyphenation.bas +++ b/testautomation/writer/optional/w_hyphenation.bas @@ -41,15 +41,17 @@ sub main use "writer\tools\includes\w_tools.inc" use "writer\tools\includes\w_tool4.inc" + use "writer\tools\includes\w_tools_hyphenation.inc" use "writer\optional\includes\hyphenation\w_hyphenation.inc" printlog Chr(13) + "******* Writer - Hyphenation - Test *******" Call hStatusIn ( "writer" , "w_hyphenation.bas" ) Call wEnableHyphenation(true) - Call tHyphenation_1 'Test Hyphenation using ctrl and "-" - Call tHyphenation_2 'Test Hyphenation using Tools/Hyphenation ,test like fol-lowing - Call tHyphenation_3 'Test Hyphenation using Tools/Hyphenation ,test like follow-ing + Call tHyphenation_1 + Call tHyphenation_2 + Call tHyphenation_3 + Call tHyphenation_4 Call wEnableHyphenation(false) Call hStatusOut diff --git a/testautomation/writer/required/includes/w_005b_.inc b/testautomation/writer/required/includes/w_005b_.inc index ce7ce264e3b1..0e4f8ea17f23 100755 --- a/testautomation/writer/required/includes/w_005b_.inc +++ b/testautomation/writer/required/includes/w_005b_.inc @@ -892,9 +892,16 @@ testcase tFormatAlignmentArea Call hNewDocument printlog " Paste a rectangle from draw via clipboard" - Call wZeichenobjektEinfuegen ( "Rechteck", 45, 30, 55, 45 ) - sleep (1) - Call wObjektSelektieren ( 43, 25, 60, 50 ) + if gPlatgroup = "unx" then + Call wZeichenobjektEinfuegen ( "Rechteck", 10, 30, 20, 45 ) + sleep (1) + gMouseClick ( 15, 38 ) + else + Call wZeichenobjektEinfuegen ( "Rechteck", 45, 30, 55, 45 ) + sleep (1) + Call wObjektSelektieren ( 43, 25, 60, 50 ) + endif + Sleep 1 try printlog " Format / Anchor / As Character" @@ -1151,7 +1158,11 @@ testcase tFormatStyleEdit printlog " Insert a textobject from toolbar" Sleep 2 - Call gMouseMove(50, 20, 70, 40) + if gPlatgroup = "unx" then + Call gMouseMove(10, 20, 30, 40) + else + Call gMouseMove(50, 20, 70, 40) + endif hUseAsyncSlot( "FormatStyleBold" ) printlog " Format / Style / Bold" @@ -1220,7 +1231,11 @@ testcase tFormatAlignmentEdit Textobjekt.Click printlog " Insert a textbox via 'Draw functions' toolbar" - Call gMouseMove(50, 20, 70, 40) + if gPlatgroup = "unx" then + Call gMouseMove(10, 20, 30, 40) + else + Call gMouseMove(50, 20, 70, 40) + endif printlog " Insert some text in document" Call wTypeKeys ("Ein Wort") @@ -1259,7 +1274,11 @@ testcase tFormatLineSpacing Textobjekt.Click printlog " In a textbox via 'Draw Functions' toolbox" - Call gMouseMove(50, 20, 70, 40) + if gPlatgroup = "unx" then + Call gMouseMove(10, 20, 30, 40) + else + Call gMouseMove(50, 20, 70, 40) + endif Sleep 1 printlog " Format / Spacing / Single line" @@ -1300,7 +1319,11 @@ testcase tFormatParagraphEdit Textobjekt.Click printlog " In a textbox via 'Draw Functions' toolbox" - Call gMouseMove(50, 20, 70, 40) + if gPlatgroup = "unx" then + Call gMouseMove(10, 20, 30, 40) + else + Call gMouseMove(50, 20, 70, 40) + endif printlog " Format / Paragraph " hUseAsyncSlot( "FormatParagraph" ) diff --git a/testautomation/writer/required/includes/w_007_.inc b/testautomation/writer/required/includes/w_007_.inc index d19c4bcc3dc2..056145bdbf37 100755 --- a/testautomation/writer/required/includes/w_007_.inc +++ b/testautomation/writer/required/includes/w_007_.inc @@ -1302,7 +1302,7 @@ testcase tMasterDocToolsHyphenation Kontext "Silbentrennung" printlog " Close upcoming 'Hyphenation' dialog" - if ( Silbentrennung.Exists() ) then + if ( Silbentrennung.Exists( 2 ) ) then Call DialogTest ( Silbentrennung ) Silbentrennung.Cancel else diff --git a/testautomation/writer/required/includes/w_020_.inc b/testautomation/writer/required/includes/w_020_.inc index 62bffb9b8018..05d11681efe7 100755 --- a/testautomation/writer/required/includes/w_020_.inc +++ b/testautomation/writer/required/includes/w_020_.inc @@ -421,7 +421,11 @@ testcase t_TB_Form wait 500 Label.Click printlog " Insert a textbox from toolbox" - Call hMalZeichnenMitSelektion ( 57, 20, 68, 25 ) + if gplatgroup = "unx" then + Call hMalZeichnenMitSelektion ( 10, 40, 21, 25 ) + else + Call hMalZeichnenMitSelektion ( 57, 20, 68, 25 ) + endif printlog "+ Open Control Properties" Call sMenufunktionen("-Textbox-") end if @@ -450,7 +454,11 @@ testcase t_TB_Form Combobox.Click printlog " Insert a Combobox from toolbox" Wait 500 - Call hMalZeichnenMitSelektion ( 57, 30, 68, 35 ) + if gPlatgroup = "unx" then + Call hMalZeichnenMitSelektion ( 41, 40, 52, 35 ) + else + Call hMalZeichnenMitSelektion ( 57, 30, 68, 35 ) + endif printlog "+ Step through pages of upcoming Autopilot" Call sAutopilot_ListboxCombobox("Combo") printlog "+ Open Control Properties" diff --git a/testautomation/writer/tools/includes/w_tools_hyphenation.inc b/testautomation/writer/tools/includes/w_tools_hyphenation.inc new file mode 100644 index 000000000000..c49c07a7f3f2 --- /dev/null +++ b/testautomation/writer/tools/includes/w_tools_hyphenation.inc @@ -0,0 +1,85 @@ +'************************************************************************** +'* 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: w_tools_hyphenation.inc,v $ +'* +'* $Revision: 1.2 $ +'* +'* last change: $Author: vg $ $Date: 2008-08-18 12:43:40 $ +'* +'* 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 : helge.delfs@sun.com ** +'* ** +'* short description : Misc tools for writer hyphenation tests ** +'* ** +'\****************************************************************** + + + +function fPrepareHyphenationDocument(testWord as string) + + Dim SpaceTickCount as integer + + SpaceTickCount = 1 + Do + Call wTypeKeys "<Mod1 Home>" + Call wTypeKeys "<Down>" + Call wTypeKeys "<Mod1 Shift Right>" + try + EditCopy + catch + endcatch + if trim(GetClipboardText) <> testWord then + EditSearchAndReplace + Kontext "FindAndReplace" + SearchFor.SetText testWord + SearchNow.Click + Kontext "Active" + if Active.Exists then + if Active.GetRT = 304 then + try + active.Yes + catch + Warnlog Active.Gettext + Active.ok + endcatch + end if + end if + Kontext "FindAndReplace" + FindAndReplace.Close + Call wTypeKeys "<Mod1 Left>" + Call wTypeKeys "<Space>" + inc SpaceTickCount + if SpaceTickCount >= 30 then + fPrepareHyphenationDocument = false + exit do + end if + else + fPrepareHyphenationDocument = true + exit do + end if + Loop + +end function |