From 12c0a556f54e4ee726797cca2fee23c610ccbcc6 Mon Sep 17 00:00:00 2001 From: Joerg Sievers Date: Mon, 16 Jun 2008 10:51:24 +0000 Subject: changed structure which will be included into the CWS process. --- testautomation/math/optional/includes/m_101_.inc | 700 +++++++++++++++++++++ testautomation/math/optional/includes/m_105.inc | 697 ++++++++++++++++++++ testautomation/math/optional/includes/m_106_.inc | 71 +++ testautomation/math/optional/input/101_1.sxm | Bin 0 -> 3284 bytes testautomation/math/optional/input/filter/math.sxw | Bin 0 -> 5399 bytes .../math/optional/input/filter/precal_test.doc | Bin 0 -> 143360 bytes .../math/optional/input/filter/quantum_field.doc | Bin 0 -> 219648 bytes .../math/optional/input/filter/seventh_grade.doc | Bin 0 -> 244224 bytes testautomation/math/optional/m_lvl1.bas | 65 ++ testautomation/math/required/includes/m_001_.inc | 691 ++++++++++++++++++++ testautomation/math/required/includes/m_002_.inc | 138 ++++ testautomation/math/required/includes/m_003_.inc | 183 ++++++ testautomation/math/required/includes/m_004_.inc | 292 +++++++++ testautomation/math/required/includes/m_005_.inc | 315 ++++++++++ testautomation/math/required/includes/m_006_.inc | 59 ++ testautomation/math/required/includes/m_007_.inc | 281 +++++++++ testautomation/math/required/includes/m_010_.inc | 676 ++++++++++++++++++++ testautomation/math/required/includes/m_020_.inc | 78 +++ .../math/required/input/ShortLicense.oxt | Bin 0 -> 9406 bytes testautomation/math/required/input/test.odt | Bin 0 -> 6725 bytes .../math/required/input/unknown-dependency.oxt | Bin 0 -> 1633 bytes testautomation/math/required/m_updt.bas | 81 +++ 22 files changed, 4327 insertions(+) create mode 100755 testautomation/math/optional/includes/m_101_.inc create mode 100644 testautomation/math/optional/includes/m_105.inc create mode 100755 testautomation/math/optional/includes/m_106_.inc create mode 100755 testautomation/math/optional/input/101_1.sxm create mode 100755 testautomation/math/optional/input/filter/math.sxw create mode 100755 testautomation/math/optional/input/filter/precal_test.doc create mode 100755 testautomation/math/optional/input/filter/quantum_field.doc create mode 100755 testautomation/math/optional/input/filter/seventh_grade.doc create mode 100755 testautomation/math/optional/m_lvl1.bas create mode 100755 testautomation/math/required/includes/m_001_.inc create mode 100755 testautomation/math/required/includes/m_002_.inc create mode 100755 testautomation/math/required/includes/m_003_.inc create mode 100755 testautomation/math/required/includes/m_004_.inc create mode 100755 testautomation/math/required/includes/m_005_.inc create mode 100755 testautomation/math/required/includes/m_006_.inc create mode 100755 testautomation/math/required/includes/m_007_.inc create mode 100755 testautomation/math/required/includes/m_010_.inc create mode 100755 testautomation/math/required/includes/m_020_.inc create mode 100755 testautomation/math/required/input/ShortLicense.oxt create mode 100644 testautomation/math/required/input/test.odt create mode 100755 testautomation/math/required/input/unknown-dependency.oxt create mode 100755 testautomation/math/required/m_updt.bas diff --git a/testautomation/math/optional/includes/m_101_.inc b/testautomation/math/optional/includes/m_101_.inc new file mode 100755 index 000000000..b45a5b5ed --- /dev/null +++ b/testautomation/math/optional/includes/m_101_.inc @@ -0,0 +1,700 @@ +'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: m_101_.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 11:51:22 $ +'* +'* 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 +'* +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* Owner : thorsten.bosbach@sun.com +'* +'* short description : +'* +'\****************************************************************** + + dim cActFilter as string ' used filter for save + Const cActFilterExt = ".sxm" ' used filter for save (extension) + +sub m_101_ + cActFilter = gMathFilter + Printlog Chr(13) + "-- File Menu --" + +' tFileNew +' Call Autopilot 'in Inc\desktop\autopilo.inc +' Call tFileClose + Call tFileSave + Call tFileSaveAs + Call tFilePassword ' check which filtertypes enable saving with password + Call tFileOpen_1 ' just load all previous saved files in this test + Call tFileOpen_2 ' load testfiles for filters + gApplication = "Writer" + Call tToolsCatalog ' code is in m_105_.inc, but i want to print he result, so i needed to moove teh call to here + gApplication = "Math" + Call tFilePrint ' writer dokument with math ole's +' Call tFileSaveAll +' Call tFileNewLoad +' Call tFileVersions +' tDocumentAsEmail +' Call tFileProperties +' Call tFilePrintersetting +' Call tFileEnd + +end sub + +testcase tFileSave + dim sFileName as string ' test document & new created doc + dim sFormula as string ' container for formula to create document with + dim Exlist(30) as string + dim sTemp as string + dim i,x,y as integer + + '/// if not exists : gOfficePath + '\\user\\math\\level1\\', create it ///' + if app.dir (ConvertPath ( gOfficePath + "user/work/math") ) = "" then + app.mkdir ConvertPath ( gOfficePath + "user/work/math") + endif + if app.dir (ConvertPath ( gOfficePath + "user/work/math/level1")) = "" then + app.mkdir ConvertPath ( gOfficePath + "user/work/math/level1") + endif + + sFileName = ConvertPath ( gOfficePath + "user/work/math/level1") + Printlog "'/// deleting all files in output directory: \\user\\work\\math\\level1\\ ///'" + if gSamePC = TRUE then ' delete export directory + GetFileList ( sFileName, "*.*", Exlist() ) + if KillFileList ( Exlist() ) <> TRUE then + Warnlog "Couldn't delete all Files in Output-Export-Directory, the followings are still there:" + for i=1 to ListCount ( Exlist() ) + printlog " <> " + Exlist(i) + next i + end if + end if + +' should be default format?! + +'/// take formulatext from loaded file -> language independant! ///' + sFormula = TBOloadFormulaFromFile() + + hNewDocument +'/// write formula down ///' + SchreibenInMathdok (sFormula) + sleep 3 + hFileSaveAsKill (sFileName + "filesave.sxm") +' Get used filter name + FileSaveAs + sleep 2 + Kontext "SpeichernDlg" + sTemp = Dateityp.GetSelText + SpeichernDlg.Cancel + +'/// file save with default filter as: "\\user\\work\\math\\level1\\filesave...." ///' + + printlog " saved with filter: "+ sTemp + Call hCloseDocument +endcase + +testcase tFileSaveAs + dim sFileName as string ' test document & new created doc + dim sFormula as string ' container for formula to create document with + dim sTemp as string + dim sFilter (50) as string + dim i,x,y as integer + dim bAlienWarning as boolean + + sFilter (0) = 0 ' initalisize ;-)... + +'/// take formulatext from loaded file -> language independant! ///' + sFormula = TBOloadFormulaFromFile + + hNewDocument +'/// write formula down ///' + SchreibenInMathdok sFormula + sleep 3 + +'/// start loop 3 times for: ///' +'///+ StarOffice 6.0 Formula ///' +'///+ StarMath 5.0 ///' +'///+ MathML 1.01 ///' +'/// to be language independant, select first, second last and last filter from list -> but try to check the names :-) ///' + +' to use the helper fileSaveAs functions i get all available filters... + ListAppend(sFilter(), "StarOffice XML (Math)") + ListAppend(sFilter(), "math8") + + bAlienWarning = isCheckedWarnAlienFormat + if (NOT bAlienWarning) then + qaErrorLog "Somebody disabled 'Alien Warnings' in the options, will enable it again now." + isCheckedWarnAlienFormat(true) + endif + + for i = 1 to (ListCount(sFilter())) + sFileName = convertpath( gOfficePath + "user/work/math/level1/fsas_"+(i)) + sleep 1 + printlog "going to save: '"+sFileName+"'" + sleep 1 + '----- try to WorkAround focus change --------- + kontext "DocumentMath" + DocumentMath.mouseDown 10,10 + DocumentMath.mouseUp 10,10 + '----------------------------------------------- + hFileSaveAsWithFilterKill (sFileName, sFilter(i), TRUE ) + '/// file save with filter as: "output\\math\\fsas_[0,1,2]" ///' + ' Alien Warning has not to appear on the first one: Default format .odf + Kontext "AlienWarning" + if AlienWarning.exists(5) then + if (1=i) then + warnlog "- AlienWarning on default file format! Not OK!" + else + printlog "- AlienWarning" + endif + AlienWarning.ok + endif + printlog " saved with filter ("+i+"/2): "+ sFilter(i) + next i +'/// TODO: small check, if correct filter was used! ///' + sleep 3 + fileclose + sleep 3 + kontext "active" + if active.exists then + printlog "active about informationloss... :-) that's OK: '"+active.GetText+"'" + active.yes + endif +endcase + +testcase tFileOpen_1 +'/// a small loop, to load all files previous saved ///' + dim sFileName as string ' test document & new created doc + dim sFormula as string ' container for formula to create document with + dim sFileList (30) as string + dim sTemp as string + dim i,x,y as integer + +'///load documents from "output\\math\\" /// + sFileName = ConvertPath ( gOfficePath + "user/work/math/level1/" ) + GetFileList ( sFileName, "*.*", sFileList() ) + + x = ListCount ( sFileList() ) + for i = 1 to x + printlog "("+i+"/"+x+"): "+sFileList(i) + hFileOpen ( sFileList(i) ) + Sleep 2 + If hIsNamedDocLoaded (sFileList(i)) Then + printlog " used filter: " + hGetUsedFilter() + else + warnlog "document didn't get loaded" + endif + hCloseDocument + sleep 2 + next i +endcase + +testcase tFileOpen_2 +'/// a small loop, to load a testfile for every non SO filter files ///' +'/// files are taken from: http://www.dessci.com/en/products/mathtype/win/samples/ ///' + dim sFileName as string ' test document & new created doc + dim sFormula as string ' container for formula to create document with + dim sFileList (30) as string + dim sTemp as string + dim i,x,y as integer + +'///load documents from "input\\math\\level1\\filter\\" /// + sFileName = ConvertPath ( gTesttoolPath + "math/optional/input/level1/filter/" ) + GetFileList ( sFileName, "*.*", sFileList() ) + + x = ListCount ( sFileList() ) + for i = 1 to x + printlog "("+i+"/"+x+"): "+sFileList(i) + hFileOpen ( sFileList(i) ) + Sleep 20 + If hIsNamedDocLoaded (sFileList(i)) Then + printlog " used filter: " + hGetUsedFilter() + else + warnlog "document didn't get loaded" + endif + hCloseDocument + next i +endcase + +testcase tFilePassword + dim i,x as integer + dim sTemp as string + const cFilterCount = 4 + dim sFilterName as string + dim sFilter as string + dim sFilterExt() as string + + Printlog "'///- Check each Filter if password is possible ///" + + ' make sure saving in latest math filter works, checking global filtername and if necessary change it + sFilter = hGetUIFiltername("math8") + sFilterExt() = hGetFilternameExtension("math8") + sFilterName = sFilter + " (." + sFilterExt(0) + ")" + printlog sFilterName + printlog gMathFilter + gMathFilter = sFilterName + + hNewDocument + SchreibenInMathdok "a over b" + + FileSaveAs + Kontext "SpeichernDlg" + + '/// check amount of available filters (6) ///' + x = Dateityp.GetItemCount + if x <> cFilterCount then warnlog " The Filter count is wrong! Have to be ("+cFilterCount+"), but are: "+x +' Check: (1): Open Office Formula (.oof) +' Check: (2): MathML 1.01 (.mml) +' Check: (5): StarMath 5.0 (.smf) +' Check: (6): StarOffice 6.0/7 Formula (.sxm) + +'/// check if any other then gMathFilter is password able; and if gMathFilter is password able ///' + for i = 1 to x + Dateityp.Select i + sleep (5) + sTemp = Dateityp.GetSelText + printlog " Check: (" + i + "/" + x +"): " +sTemp + if Passwort.isEnabled then + if NOT((instr(sTemp,gMathFilter) = 1)OR(instr(sTemp," (.sxm)") > 1)) then + warnlog "(" + i + "/" + x +"): '"+sTemp+"' Password Checkbox: Enabled" + endif + else + if (instr(sTemp,gMathFilter) = 1)OR(instr(sTemp," (.sxm)") > 1) then + warnlog "(" + i + "/" + x +"): '"+sTemp+"' Password Checkbox: Disabled" + endif + endif + next i + + SpeichernDlg.Cancel + hCloseDocument +endcase + +function TBOloadFormulaFromFile () as string +'/// load an existing document: "input\\math\\101_1.sxm" /// +'///+ take formula out of command window /// +'///+ save it into a variable /// +'/// close dokument /// + Call hFileOpen ( ConvertPath(gTesttoolPath + "math/optional/input/101_1.sxm") ) + kontext "dokumentwriter" + EditSelectAllMath + EditCopy + TBOloadFormulaFromFile = GetClipboardText +' printlog "-----TBOloadFormulaFromFile: will return: '"+TBOloadFormulaFromFile+"'" + hCloseDocument +end function + +testcase tFilePrint +'/// I create a writer document and insert the object formula from the standard testfile: ///' +'///+ There will be a graphic, how it should look like and the object///' +'///+ AND there was the formula already inserted as object!///' +'///+ in different languages...///' +'/// Document is called: "input\\math\\101_2.sxw /// +'///+ Image is available at: "input\\math\\101_2.gif///' + + dim sFormula as string ' container for formula to create document with + dim sFileName as string + dim bChecked as boolean + dim sTemp as string + dim sTemp1 as string + dim bLanguage as boolean + dim bString as boolean + dim iLanguage as integer + dim sFoundLanguage as string + dim bError as boolean + dim iTimeOut as integer + + printlog "- File Print" + + bError = FALSE + sFormula = TBOloadFormulaFromFile() + + Call hFileOpen ( ConvertPath(gTesttoolPath + "math/optional/input/101_2.sxw") ) + TBOmakeWriteable() + + '/// find the translated formula in the document and get the language it belongs to ///' + '///+ compare it to the officelanguage ///' + kontext "DocumentWriter" + DocumentWriter.TypeKeys "" + bLanguage = hFindeImDokument("{"+ iSprache +"}") + kontext "DocumentWriter" + DocumentWriter.TypeKeys "" + hFindeImDokument ("\{"+ iSprache +"\}.*\{"+ iSprache +"\}", TRUE, TRUE) + try + editcopy + catch + printlog "editcopy failed." + setClipboard("") + endcatch + sFoundLanguage = GetClipboardText + If NOT bLanguage then + qaErrorLog "This Language (" + iSprache + ") is not supported in this test right now! Add the following string to the document: " +ConvertPath(gTesttoolPath + "math/optional/input/101_2.sxw") + else + kontext "DocumentWriter" + DocumentWriter.TypeKeys "" + if bError then + DocumentWriter.TypeKeys "" + endif + DocumentWriter.TypeKeys "" + editcopy + stemp = GetClipboardText + if (left(sTemp,1) = "{") then + ' language number is monadic + sTemp = right(sTemp,1) + endif + iLanguage = val(sTemp) + if (iSprache <> iLanguage) then + warnlog "hmm, smth is wrong :-(; found translated text for language: "+val(GetClipboardText) + ", but looked for: "+iSprache + endif + endif + kontext "DocumentWriter" + DocumentWriter.TypeKeys "" + bString = hFindeImDokument (sFormula) + If NOT bString then + if bLanguage then + warnlog "The translation changed! If It is a ProductPatch, then this is a bug; else update the document by calling TBO.:" +ConvertPath(gTesttoolPath + "math/optional/input/101_2.sxw") + endif + printlog sFormula + endif + sleep 1 + try + editcopy + catch + If (bString AND bLanguage) then + warnlog "Edit-Copy failed." + endif + endcatch + printlog "found.......................... '"+GetClipboardText+"'" + printlog "looked for..................... '"+sFormula+"'" + printlog "found language............. '"+sFoundLanguage+"'" + if (GetClipboardText <> sFormula) then + If (bString AND bLanguage) then + warnlog "difference to reference!" + endif + else + printlog "FOUND entry for the language!: '"+ iLanguage +"'" + endif + + kontext "DocumentWriter" + DocumentWriter.TypeKeys "" + DocumentWriter.TypeKeys gPCname + " " + iSprache + " " + gLanguage + " " + gPlatgroup + " " + gPlatform + "" + '/// Insert the loaded and automatical 'translated' formulatext in writer as text ///' + hFindeImDokument ("TBO_INSERTED") + kontext "DocumentWriter" + DocumentWriter.TypeKeys sFormula + DocumentWriter.TypeKeys "" + + sleep (2) + '/// call: Insert->Object->Formula ///' + InsertObjectFormulaWriter + '/// write formula down ///' + SchreibenInMathdok (sFormula) + sleep 3 + '/// exit formula object ///' + kontext "DokumentWriter" 'Commands'CommandsMath'DocumentMath don't work :-[ + DokumentWriter.MouseDown 99,99 + DokumentWriter.MouseUp 99,99 + DokumentWriter.MouseDown 99,99 + DokumentWriter.MouseUp 99,99 + + sFileName = convertpath( gOfficePath + "user/work/math/level1/ftc_a.odt") + if (hFileExists(sFileName)) then + '/// goto end of page; insert page break ///' + kontext "DokumentWriter" + DokumentWriter.typeKeys "" + sleep 1 + DokumentWriter.typeKeys "" + sleep 1 + DokumentWriter.typeKeys "" + sleep 1 + DokumentWriter.typeKeys "" + sleep 1 + '/// insert frame ///' + try + InsertFrame + catch + printlog "Catched because of failed mouse action, try to leafe math in oposite corner" + kontext "DokumentWriter" + DokumentWriter.MouseDown 1,1 ' TBO: i don't like to do it this way, + DokumentWriter.MouseUp 1,1 ' but using .TypeKeys doesn't work + DokumentWriter.MouseDown 1,1 ' that way i expected in math via ole :-[ + DokumentWriter.MouseUp 1,1 + kontext "DokumentWriter" + DokumentWriter.typeKeys "" + sleep 1 + DokumentWriter.typeKeys "" + sleep 1 + DokumentWriter.typeKeys "" + sleep 1 + DokumentWriter.typeKeys "" + sleep 1 + '/// insert frame ///' + InsertFrame + endcatch + sleep 1 + Kontext + active.setPage TabType + kontext "TabType" + RelativeWidth.check + RelativeHeight.check + Width.setText "100" + Height.setText "98" + RelativeWidth.unCheck + RelativeHeight.unCheck + AutoHoehe.Check + TabType.OK + kontext "DokumentWriter" + sleep 1 + DokumentWriter.typeKeys "" + sleep 1 + + '/// load file from testcase 'tToolsCatalog' to get a hardcopy ///' + InsertFileWriter + Kontext "GeneralFileDialog" + Dateiname.setText sFileName + Oeffnen.click + sleep 60 + + '/// do some nice formatting ///' + FormatColumns + Kontext "FormatColumn" + Columns.setText "2" + FormatColumn.TypeKeys "" + iTimeOut = 1 + while ((NOT AutoWidth.isEnabled) AND (iTimeOut < 30)) + sleep 1 + printlog "Waiting for control to be enabled: (" + iTimeOut + "/30)" + iTimeOut = iTimeOut +1 + Kontext "FormatColumn" + FormatColumn.TypeKeys "" + wend + Kontext "FormatColumn" + bChecked = AutoWidth.isChecked + AutoWidth.UnCheck + sTemp = Width1.getText + Width1.typeKeys("") + Width1.more + sTemp1 = Width1.getText + Width1.setText(sTemp) + if (bChecked) then + AutoWidth.UnCheck + endif + FormatColumn.OK + + FormatParagraph + Kontext + active.setPage TabTabulator + kontext "TabTabulator" + Position.setText sTemp + Neu.click + Position.setText sTemp1 + Neu.click + try + TabTabulator.OK + catch + warnlog "Timeout on closing " + iTimeOut = 1 + while ((iTimeOut > 0) AND (iTimeOut < 30)) + try + Kontext "DocumentWriter" + DocumentWriter.typeKeys "" + iTimeOut = iTimeOut * (-1) + catch + sleep (10) + inc(iTimeOut) + endcatch + wend + printlog "Duration: " + (iTimeOut * 10) + endcatch + else + qaErrorLog "File doesn't exists: '" + sFileName + "'" + endif + + '/// print file ///' + try + Fileprint + sleep 2 + kontext + if active.exists(2) then + active.ok + qaerrorlog "There is no printer available - please install one on your system!" + sleep 2 + Kontext "DruckenDlg" + DruckenDlg.cancel + else + sleep 2 + Kontext "DruckenDlg" + DruckenDlg.Ok + endif + sleep 2 + kontext + if active.exists(2) then + active.ok + qaerrorlog "There is no printer available - please install one on your system!" + sleep 2 + endif + catch + warnlog "FilePrint is not accessible, because closing Formula failed :-( ?!" + endcatch + hFileSaveAsWithFilterKill (convertpath( gOfficePath + "user/work/fileprint" + iSprache + ".odt"), gWriterFilter) + Call hCloseDocument +endcase + + +function TBOmakeWriteable() + ' check if writeable! (especially for HTML Doks!!) + sleep (3) + try + UseBindings + FormatStyleBold + sleep 2 + FormatStyleBold + catch + '/// make document writeable :-)///' + kontext "Funktionsleiste" + printlog "!!!!!!!!!!!!!!!!!!!!!!!!!!!!doc was ReadOnly, changed it to writeable. (maybe wrong access rights?)" + Bearbeiten.click + kontext + if active.exists (5) then + Printlog " active, accessrights ?!: '"+active.GetText+"'" + active.yes + endif + endcatch + sleep (3) +end function + +function isCheckedWarnAlienFormat (optional bChange as boolean) + dim uno + dim ap + dim apara(1) As new com.sun.star.beans.PropertyValue + dim xViewRoot + dim temp() + dim bLocal as boolean + dim sFileFunction as string + dim i as integer + + if isMissing(bChange) then + ' should work, else give soffice the commandline + try + uno=getUnoApp + catch + qaErrorLog (sFileFunction+"UNO-Port wasn't set on startup of office; will set it now again.") + uno=hGetUnoService() + endcatch + if (isNull(ap)) then + warnlog(sFileFunction+"Couldn't create Uno access") + ' think about switching to do it manual? + exit function + endif + ap=uno.createInstance("com.sun.star.configuration.ConfigurationProvider") + if (isNull(ap)) then + warnlog(sFileFunction+"Couldn't create Configuration access") + exit function + endif + apara(0).Name="nodepath" + apara(1).Name="lazywrite" + apara(1).Value=False + '() Tools->Options->Load/Save->General + '/org.openoffice.Office.Common/Save/Document WarnAlienFormat + apara(0).Value="/org.openoffice.Office.Common/Save/Document" + xViewRoot=ap.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess",aPara()) + bLocal = xViewRoot.getByName("WarnAlienFormat") + xViewRoot.dispose() + else + ToolsOptions + call hToolsOptions ("LoadSave", "General") + bLocal = WarnWhenSavingAlienFormat.isChecked + if bChange then + WarnWhenSavingAlienFormat.check + else + WarnWhenSavingAlienFormat.unCheck + endif + Kontext "ExtrasOptionenDlg" + ExtrasOptionenDlg.OK + sleep 4 + endif + isCheckedWarnAlienFormat = bLocal +end function + +function hSpeichernUnterMitFilterKillTBO (sFileName as String, sFilterName, optional bAutoFileExtension as boolean) as boolean + Dim sDerName as string + Dim sDerText as string + Dim ApplicatStrg as string + Dim bFileSaved as boolean + Dim bAlienNotAllowed as boolean + + sDerName = ConvertPath (sFileName) + + if hFileExists (sDerName) = TRUE then + try + app.kill (sDerName) + catch + Exceptlog + endcatch + end if + + if FileExists(sDerName) then + warnlog "file '" & sDerName & "' couldn't be deleted. Exiting function now..." + exit function + end if + + sleep (1) + FileSaveAs + Kontext "SpeichernDlg" + if SpeichernDlg.Exists(2) then + DateiTyp.Select sFilterName + sleep (3) + DateiName.SetText sDerName + sleep (3) + 'Saving the document + Speichern.Click + sleep (1) + + Kontext + if Active.Exists(2) then + if Active.GetRT = 304 then + sDerText = Active.GetText + warnlog sDerText + try + Active.OK + printlog "OK" + catch + active.yes + printlog "YES" + endcatch + Kontext "SpeichernDlg" + if SpeichernDlg.Exists(1) then + SpeichernDlg.Cancel + end if + bFileSaved = FALSE + end if + end if + + else + warnlog "'Save'-dialog is not visible. Document has not been saved!" + end if +end function + + diff --git a/testautomation/math/optional/includes/m_105.inc b/testautomation/math/optional/includes/m_105.inc new file mode 100644 index 000000000..3e8ded606 --- /dev/null +++ b/testautomation/math/optional/includes/m_105.inc @@ -0,0 +1,697 @@ +'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: m_105.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 11:51:22 $ +'* +'* 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 +'* +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* Owner : thorsten.bosbach@sun.com +'* +'* short description : +'* +'******************************************************************** +'* +' #1 tToolsOptions +' #1 tToolsConfigure +' #1 tToolsCatalog +' #1 tToolsCatalogNew +'* +'\****************************************************************** + +sub m_105 + printlog Chr(13) + "-- m_105 --" + Call tToolsOptions + Call tToolsConfigure +' tToolsCatalog get's called in m_101_.inc to get it also printed there! + qaerrorlog "#i64504# Symbol set name is not saved on exiting OOo" + 'Call tToolsCatalogNew +end sub + +testcase tToolsOptions + dim irgendwas(7) as boolean + dim sProzent as string + dim sTemp as string + dim i as integer + dim iItemCount as integer + + '/// open application ///' + Call hNewDocument + '/// Tools->Options ///' + printlog ("'/// - save states ///") + ToolsOptions + sleep 1 + hToolsOptions ("FORMULA", "SETTINGS") + + irgendwas(1) = DruckeTitelzeile.IsChecked + irgendwas(2) = DruckeFormeltext.IsChecked + irgendwas(3) = DruckeRahmen.IsChecked + irgendwas(4) = Originalgroesse.IsChecked + irgendwas(5) = DerSeiteAnpassen.IsChecked + irgendwas(6) = Skalierung.IsChecked + irgendwas(7) = Ignorieren.IsChecked + if Skalierung.IsChecked then sProzent = Prozent.GetText + + printlog ("'/// - all states inverting ///") + + if irgendwas(1) Then DruckeTitelzeile.UnCheck Else DruckeTitelzeile.Check + if irgendwas(2) Then DruckeFormeltext.UnCheck Else DruckeFormeltext.Check + if irgendwas(3) Then DruckeRahmen.UnCheck Else DruckeRahmen.Check + if irgendwas(7) Then Ignorieren.UnCheck Else Ignorieren.Check + + Skalierung.Check + Prozent.ToMax + sTemp = Prozent.GetText + + Kontext "OptionenDlg" + OptionenDlg.OK + + printlog ("'/// - SO quit - start ///") + +TBOrestart + + printlog ("'/// - checking states ///") + ToolsOptions + hToolsOptions ("FORMULA", "SETTINGS") + + If ( irgendwas(1) = DruckeTitelzeile.IsChecked ) Then WarnLog "DruckeTitelzeile state changed" + If ( irgendwas(2) = DruckeFormeltext.IsChecked ) Then WarnLog "DruckeFormeltext state changed" + If ( irgendwas(3) = DruckeRahmen.IsChecked ) Then WarnLog "DruckeRahmen state changed" + If ( irgendwas(7) = Ignorieren.IsChecked ) Then WarnLog "Ignorieren state changed" + + If True <> Skalierung.IsChecked Then WarnLog "Skalierung state changed" + If sTemp <> Prozent.GetText Then WarnLog "Prozent state changed" + + printlog ("'/// - all UnCheck -> o ///") + + DruckeTitelzeile.UnCheck + DruckeFormeltext.UnCheck + DruckeRahmen.UnCheck + Ignorieren.UnCheck + + Kontext "OptionenDlg" + OptionenDlg.OK + + printlog ("'/// - check if all UnChecked ///") + ToolsOptions + hToolsOptions ("FORMULA", "SETTINGS") + + If DruckeTitelzeile.IsChecked Then WarnLog "DruckeTitelzeil x" + If DruckeFormeltext.IsChecked Then WarnLog "DruckeFormeltext x" + If DruckeRahmen.IsChecked Then WarnLog "DruckeRahmen x" + If Ignorieren.IsChecked Then WarnLog "Ignorieren x" + + If sTemp <> Prozent.GetText Then WarnLog "Prozent state changed" + + Printlog ("'/// - all Check -> x ///") + + DruckeTitelzeile.Check + DruckeFormeltext.Check + DruckeRahmen.Check + Ignorieren.Check + + DerSeiteAnpassen.Check + + Kontext "OptionenDlg" + OptionenDlg.OK + + printlog ("'/// - check if all Checked ///") + '----- WorkAround i48383 Tools->Options run on wrong window; Target OOo later --------- + kontext "DocumentMath" + DocumentMath.mouseDown 10,10 + DocumentMath.mouseUp 10,10 + '----------------------------------------------- + ToolsOptions + hToolsOptions ("FORMULA", "SETTINGS") + + try + If True <> DruckeTitelzeile.IsChecked Then WarnLog "DruckeTitelzeil o" + catch + Kontext "ExtrasOptionenDlg" + warnlog "Getting source of error... TBO: " + iItemCount = Optionsliste.getItemCount + for i = 1 to iItemCount + printlog "("+i+"/"+iItemCount+"): '"+ Optionsliste.getItemText(i)+ "'" + next i + Kontext "TabDruckenMath" + endcatch + If True <> DruckeFormeltext.IsChecked Then WarnLog "DruckeFormeltext o" + If True <> DruckeRahmen.IsChecked Then WarnLog "DruckeRahmen o" + If True <> Ignorieren.IsChecked Then WarnLog "Ignorieren o" + + If True <> DerSeiteAnpassen.IsChecked Then WarnLog "DerSeiteAnpassen o" + + printlog ("'/// - restore states ///") + + If ( irgendwas(1) = TRUE ) Then DruckeTitelzeile.Check Else DruckeTitelzeile.UnCheck + If ( irgendwas(2) = TRUE ) Then DruckeFormeltext.Check Else DruckeFormeltext.UnCheck + If ( irgendwas(3) = TRUE ) Then DruckeRahmen.Check Else DruckeRahmen.UnCheck + If ( irgendwas(4) = TRUE ) Then Originalgroesse.Check + If ( irgendwas(5) = TRUE ) Then DerSeiteAnpassen.Check + If ( irgendwas(6) = TRUE ) Then Skalierung.Check + If ( irgendwas(7) = TRUE ) Then Ignorieren.Check Else Ignorieren.UnCheck + + if Skalierung.IsChecked then Prozent.SetText (sProzent) + + '/// close dialog 'Options' with OK ///' + Kontext "OptionenDlg" + OptionenDlg.OK + '/// close application ///' + Call hCloseDocument +endcase + +sub TBOrestart + hCloseDocument + sleep (5) + ExitRestartTheOffice + sleep (10) + hNewDocument + sleep (5) +end sub + +testcase tToolsConfigure + '/// idea from #108930 find double entries of keyboard-keys ///' + dim sKeys(300,2) as string + dim i,a,b as integer + dim sTemp, sTemp2 as string + dim iBugCount(2) as integer + dim c as integer + + '/// open application ///' + Call hNewDocument + sleep 2 + '/// Tools->Configure ///' + ToolsCustomize + sleep 3 + Kontext + '/// switch to tabpage 'Keyboard' ///' + Messagebox.SetPage TabTastatur ' 2 ------------------ + Kontext "TabTastatur" + '/// Check Checkbox 'StarOffice' ///' + StarOffice.Check + Printlog ("-------------------- Keylist for StarOpenOfficeSuite.org --------------------") + i = Tastatur.GetItemCount + sKeys(0,1) = i + sKeys(0,2) = i + for a = 1 to i + try + sKeys(a,1) = Tastatur.GetItemText(a,1) + c = 2 + catch + sKeys(a,1) = Tastatur.GetItemText(a,2) + c = 3 + endcatch + try + sKeys(a,2) = Tastatur.GetItemText(a,c) + catch + sKeys(a,2) = "" + iBugCount(1) = iBugCount(1) + 1 + endcatch + printlog " " + a + " - '" + sKeys(a,1) + "' -- '" + sKeys(a,2) + "'" + next a + sortList(sKeys()) + sTemp2 = sKeys(1,1) + for a = 1 to i + sTemp = Stemp2 + sTemp2 = sKeys(a+1,1) + if (sTemp = sTemp2) then + qaErrorLog " " + a + ". This Key is double: '" + sTemp + "' - These Functions are assigned: '" + sKeys(a,2) + "' + '" + sKeys(a+1,2) + "'" + iBugCount(2) = iBugCount(2) + 1 + endif + next a + + '/// Check Checkbox 'Math' ///' + Application.Check + Printlog ("-------------------- Keylist for Formula ------------------------") + i = Tastatur.GetItemCount + sKeys(0,1) = i + sKeys(0,2) = i + for a = 1 to i + sKeys(a,1) = Tastatur.GetItemText(a,c-1) + try + sKeys(a,2) = Tastatur.GetItemText(a,c) + catch + sKeys(a,2) = "" + iBugCount(1) = iBugCount(1) + 1 + endcatch + printlog " " + a + " - '" + sKeys(a,1) + "' -- '" + sKeys(a,2) + "'" + next a + sortList(sKeys()) + sTemp2 = sKeys(1,1) + for a = 1 to i + sTemp = Stemp2 + sTemp2 = sKeys(a+1,1) + if (sTemp = sTemp2) then + qaErrorLog " " + a + ". This Key is double: '" + sTemp + "' - These Functions are assigned: '" + sKeys(a,2) + "' + '" + sKeys(a+1,2) + "'" + iBugCount(2) = iBugCount(2) + 1 + endif + next a + if (iBugCount(1) > 0) then warnlog "column-entry is empty -> testtool issue" + if (iBugCount(2) > 0) then qaErrorLog "key-names are double" + '/// cancel dialog 'Customize' ///' + TabTastatur.cancel + '/// close application ///' + Call hCloseDocument +endcase + +sub sortList(lsList() as String) + '/// special variation of global routine, because this array is 2-dimensional ///' + Dim Listenanzahl as Integer, i as Integer, j as Integer + Dim Zwischenspeicher as String + Dim Zwischenspeicher2 as String + + ListenAnzahl = Val(lsList(0,1)) + for i=ListenAnzahl-1 to 1 step -1 + for j=1 to i + if uCase ( lsList(j,1) ) > uCase ( lsList(j+1,1) ) then ' downward sorting + Zwischenspeicher = lsList (j,1) ' invert value (i) with value (i+1) + Zwischenspeicher2 = lsList (j,2) ' invert value (i) with value (i+1) + lsList (j,1) = lsList(j+1,1) + lsList (j,2) = lsList(j+1,2) + lsList (j+1,1) = Zwischenspeicher + lsList (j+1,2) = Zwischenspeicher2 + end if + next j + next i +end sub + +testcase tToolsCatalog +' tToolsCatalog get's called in m_101_.inc to get it also printed there! + '/// idea from #111622 Crash on inserting 21. math ole-object ... ///' + dim i, j, x(10), y, z as integer + dim sTemp as string + dim iSymbolSets as integer + dim bChecked as boolean + dim sFileName as string + dim sAllSymbols as string + dim lAllSymbols(100) as string + dim lAllSymbolsSort(100) as string + dim iTimeOut as integer + dim sFilterName as string + dim sFilter as string + dim sFilterExt() as string + dim sNotAllowed() as string + + '/// open Writer application ///' + gApplication = "Writer" + Call hNewDocument + '/// Insert->Object->Formula ///' + InsertObjectFormulaWriter + Kontext "Math" + '/// Tools->Catalog ///' + try + ToolsSymbolsCatalog + catch + warnlog "some slots in chart/math are not working." + call hCloseDocument + goto endsub + endcatch + Kontext "SymboleMath" + symbols.typekeys "" + symbols.typekeys "" + '/// click button "Edit..." ///' + Bearbeiten.Click + Kontext "EditSymbols" + symbols.typekeys "" + symbols.typekeys "" + '/// There are 2 Symbol sets: 1. 'Greek' with 54 entries and 2. 'Special' with 12 entries ///' + '///+ These symbol set names are availble in 2 listboxes 1. 'Old Symbol Set' and 2. 'Symbol Set' ///' + iSymbolSets = OldSymbolSet.GetItemCount + if (iSymbolSets <> 2) then + WarnLog "- OldSymbolSet: '" + iSymbolSets + "' is not 2; expected is 2. ('Special' and 'Greek')" + for i = 1 to iSymbolSets + qaErrorLog "- " + i + ": '" + OldSymbolSet.GetItemText(i) + "'" + next i + else + printlog "- OldSymbolSet: " + iSymbolSets + endif + OldSymbolSet.Select 1 + SymbolSet.Select 1 + x(1) = OldSymbol.GetItemCount + printlog "- 1: OldSymbol: " + x(1) + if (iSymbolSets <> SymbolSet.GetItemCount) then + WarnLog "Count is different; OldSymbolSet: '" + iSymbolSets + "'; SymbolSet: '" + SymbolSet.GetItemCount + "'" + endif + printlog "- 1: Symbol: " + Symbol.GetItemCount + printlog "- SymbolSet: " + SymbolSet.GetItemCount + OldSymbolSet.Select 2 + SymbolSet.Select 2 + x(2) = OldSymbol.GetItemCount + printlog "- 2: OldSymbol: " + x(2) + printlog "- 2: Symbol: " + Symbol.GetItemCount + printlog "- SymbolSet: " + SymbolSet.GetItemCount + '/// cancel dialog 'Edit Symbols' ///' + EditSymbols.Cancel + Kontext "SymboleMath" + '/// close dialog 'Symbols' ///' + SymboleMath.close + Kontext "DocumentWriter" + '///+ click into writer document to leave math ///' + DocumentWriter.mouseDown 1,1 + DocumentWriter.mouseUp 1,1 + '/// type key [delete] in writer document to delete (emtpy) math object ///' + DocumentWriter.typeKeys "" + sleep 1 + sAllSymbols = "" + lAllSymbols(0) = "0" + '/// for all symbol sets do... ///' + for i = 1 to iSymbolSets + '///+ insert for the count of symbols for each symbol set the symbol into the document ///' + for j = 1 to x(i) + printlog "(" + i + "/" + iSymbolSets + ")(" + j + "/" + x(i) + ")" + '///+ Insert->Object->Formula ///' + InsertObjectFormulaWriter ' culprint after 20 calls :-( in #111622 + Kontext "DocumentMath" + '///+ Tools->Catalog ///' + ToolsSymbolsCatalog + Kontext "SymboleMath" + '///+ select the symbolset ///' + Symbolset.Select i + Kontext "SymboleMath" + '///+ type key [home] on dialog 'Symbols'///' + Symbols.TypeKeys "", true + Symbols.TypeKeys "", true ' because doesn't select the first item + '///+ type key [right] i++ times, to jump to next symbol///' + for y = 2 to j + Symbols.TypeKeys "", true + next y + '///+ click button 'Insert' ///' + Uebernehmen.Click + sleep 1 + '///+ close dialog 'Symbols' ///' + try + SymboleMath.close + catch + if ((2=i)AND(11=j))then + warnlog "#i42011# Expected: Timeout on closing Tools->Catalog with this character. (" + i + "/" + iSymbolSets + ")(" + j + "/" + x(i) + ")" + else + warnlog "Not Expected! Timeout on closing Tools->Catalog with this character. (" + i + "/" + iSymbolSets + ")(" + j + "/" + x(i) + ")" + endif + iTimeOut = 1 + while ((iTimeOut > 0) AND (iTimeOut < 30)) + try + Kontext "CommandsMath" + Commands.typeKeys "" + iTimeOut = iTimeOut * (-1) + catch + sleep (10) + inc(iTimeOut) + endcatch + wend + printlog "Duration: " + (iTimeOut * 10) + endcatch + '///+ select text in 'Commands' window ///' + Kontext "CommandsMath" + Commands.typeKeys "" + '/// Edit->Copy ///' + sleep 1 + EditCopy + sTemp = getClipboardText() + Kontext "DocumentWriter" + '///+ click into writer document to leave math ///' + DocumentWriter.mouseDown 1,1 + DocumentWriter.mouseUp 1,1 + '///+ click into writer document to diable selection of math object ///' + DocumentWriter.mouseDown 1,1 + DocumentWriter.mouseUp 1,1 + sleep 1 + '///+ insert the copied text into the document ///' + DocumentWriter.typeKeys " - " + sTemp + ": " + j + "" + sAllSymbols = sAllSymbols + sTemp + listAppend(lAllSymbols(), sTemp) + next j + next i + + if (listCount(lAllSymbols()) <> 66) then + warnlog "There have to be 66 Symbols, but there are: " + listCount(lAllSymbols()) + endif + ' TODO: check sAllSymbols for not allowed characters! + listCopy(lAllSymbols(),lAllSymbolsSort()) + listSort(lAllSymbolsSort()) + sTemp = lAllSymbolsSort(1) + for i = 2 to listCount(lAllSymbolsSort()) + if (sTemp = lAllSymbolsSort(i)) then + warnlog "There are Symbol names double: '" + sTemp + "'" + for j = 1 to listCount(lAllSymbols()) + If (sTemp = lAllSymbols(j)) then + printlog "" + j + ": after: " + lAllSymbols(j-1) + endif + next j + endif + sTemp = lAllSymbolsSort(i) + next i + ' Check for not allowed characters in strings + sNotAllowed = array(" ","_","..") + for i = 1 to listCount(lAllSymbols()) + for j = 0 to uBound(sNotAllowed()) + if inStr(lAllSymbols(i), sNotAllowed(j)) > 0 then + warnlog "("+i+") Character '" + sNotAllowed(j) + "' is not allowed in string: '" + lAllSymbols(i) + "'" + endif + next j + next i + sFileName = convertpath( gOfficePath + "user/work/math/level1/ftc_a.odt") +' hSpeichernUnterMitFilterKill (sFileName+".doc", "Microsoft Word 97/2000/XP (.doc)") + + ' make sure saving in latest writer filter works, checking global filtername and if necessary change it + sFilter = hGetUIFiltername("writer8") + sFilterExt() = hGetFilternameExtension("writer8") + sFilterName = sFilter + " (." + sFilterExt(0) + ")" + printlog sFilterName + printlog gWriterFilter + if (sFilterName <> gWriterFilter) then + gWriterFilter = sFilterName + warnlog "Filtername differs from reference; Changing now globaly: gWriterFilter" + endif + + hSpeichernUnterMitFilterKill (sFileName, gWriterFilter) + '/// close application ///' + Call hCloseDocument +endcase + +testcase tToolsCatalogNew + dim i, j as integer + dim sTemp as string + dim iStartingSymbolSetCount as integer + + Call hNewDocument +'1 + Kontext "Math" + '/// Tools->Catalog ///' + try + ToolsSymbolsCatalog + catch + warnlog "some slots in chart/math are not working." + call hCloseDocument + goto endsub + endcatch + Kontext "SymboleMath" + if SymboleMath.exists then + '/// click button "Edit..." ///' + Bearbeiten.Click + Kontext "EditSymbols" + if EditSymbols.exists then + iStartingSymbolSetCount = SymbolSet.getItemCount + if iStartingSymbolSetCount <> 2 then + qaErrorLog "There are already other symbolsets, instead of 2: " + iStartingSymbolSetCount + for i = 1 to iStartingSymbolSetCount + printlog "("+i+"/"+iStartingSymbolSetCount+"): '" + SymbolSet.getItemText (i) + "'" + next i + else + printlog "Entry condition met; 2 symbolsets only available" + endif + '/// type 'TBOnewSymbolSet' into the combobox 'Symbol set' ///' + SymbolSet.setText "TBOnewSymbolSet" + '/// press buton 'Modify' to add the new Symbolset ///' + modify.click + EditSymbols.ok + else + warnlog "not there" + endif + Kontext "SymboleMath" + if SymboleMath.exists then + sleep 1 + '/// select the new symbol set ///' + try + Symbolset.select "TBOnewSymbolSet" + catch + j=Symbolset.getItemCount + warnLog "New symbolset not created: " + "TBOnewSymbolSet" + for i = 1 to j + printlog "("+i+"/"+j+"): '" + SymbolSet.getItemText (i) + "'" + next i + endcatch + '/// close dialog 'Symbols' ///' + SymboleMath.close + else + warnlog "no dialog" + endif + endif + '/// exit and restart OOo ///' + exitRestartTheOffice +'2 + Call hNewDocument + Kontext "Math" + '/// Tools->Catalog ///' + try + ToolsSymbolsCatalog + catch + warnlog "some slots in chart/math are not working." + call hCloseDocument + goto endsub + endcatch + Kontext "SymboleMath" + if SymboleMath.exists then + '/// click button "Edit..." ///' + Bearbeiten.Click + Kontext "EditSymbols" + if EditSymbols.exists then + i = SymbolSet.getItemCount + if (iStartingSymbolSetCount +1) <> i then + WarnLog "the new symbolset is not available after restart: " + i + "; should be: " + (iStartingSymbolSetCount +1) + endif + try + SymbolSet.select "TBOnewSymbolSet" + catch + qaerrorlog "#i64504# Symbol set name is not saved on exiting OOo" + SymbolSet.select "" + endcatch + SymbolSet.setText "TBOnewSymbolSet" + Symbol.setText "ALPHANEWTBO" + try + add.click + catch + qaerrorlog "no add" + endcatch + EditSymbols.ok + endif + Kontext "SymboleMath" + if SymboleMath.exists then + sleep 1 + '/// select the new symbol set ///' + Symbolset.select "TBOnewSymbolSet" + '/// close dialog 'Symbols' ///' + SymboleMath.close + else + warnlog "no dialog" + endif + endif + '/// exit and restart OOo ///' + exitRestartTheOffice +'3 + Call hNewDocument + Kontext "Math" + '/// Tools->Catalog ///' + try + ToolsSymbolsCatalog + catch + warnlog "some slots in chart/math are not working." + call hCloseDocument + goto endsub + endcatch + Kontext "SymboleMath" + if SymboleMath.exists then + symbolset.select "TBOnewSymbolSet" + '/// click button "Edit..." ///' + Bearbeiten.Click + Kontext "EditSymbols" + if EditSymbols.exists then + i = SymbolSet.getItemCount + 'if (iStartingSymbolSetCount +1) <> i then + 'WarnLog "the new symbolset is not available after restart: " + i + "; should be: " + (iStartingSymbolSetCount +1) + 'endif + try + SymbolSet.select "TBOnewSymbolSet" + catch + warnlog "Symbol set name is not saved on exiting OOo" + SymbolSet.select "" + endcatch + i = Symbol.getItemCount + if i <> 1 then + warnlog "Symbol not available in new Symbolset: intsead of 1: " + i + endif + SymbolSet.setText "TBOnewSymbolSetdelete" + delete.click + EditSymbols.ok + endif + Kontext "SymboleMath" + if SymboleMath.exists then + 'cleanup + for i = 1 to symbolset.getItemCount + sTemp = symbolset.getItemText(i) + 'if sTemp = "" then + 'warnlog "Empty name" + 'endif + printlog ""+i+": '"+sTemp+"'" + next i + try + symbolset.select "TBOnewSymbolSet" + printlog "found: TBOnewSymbolSet" + catch + try + symbolset.select "" + printlog "found: " + catch + qaerrorlog "not expected" + endcatch + endcatch + '/// click button "Edit..." ///' + Bearbeiten.Click + Kontext "EditSymbols" + if EditSymbols.exists then + try + SymbolSet.select "TBOnewSymbolSet" + catch + try + symbolset.select "" + printlog "found: " + catch + qaerrorlog "not expected" + endcatch + endcatch + SymbolSet.setText "TBOnewSymbolSetdelete" + delete.click + EditSymbols.ok + endif + endif + Kontext "SymboleMath" + j = symbolset.getItemCount + if j <> 2 then + warnlog "There is a number != 2 of symbollists listed" + else + printlog "Everything is cleaned up." + endif + for i = 1 to j + printlog ""+i+": '"+symbolset.getitemtext(i)+"'" + next i + '/// close dialog 'Symbols' ///' + SymboleMath.close + endif + '/// close application ///' + Call hCloseDocument +endcase + diff --git a/testautomation/math/optional/includes/m_106_.inc b/testautomation/math/optional/includes/m_106_.inc new file mode 100755 index 000000000..f3cb25b15 --- /dev/null +++ b/testautomation/math/optional/includes/m_106_.inc @@ -0,0 +1,71 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: m_106_.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 11:51:22 $ +'* +'* 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 +'* +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* Owner : thorsten.bosbach@sun.com +'* +'* short description : +'* +'\****************************************************************** + +sub M_106_ + printlog Chr(13) + "-- Tools-Menue --" + Call tExtrasFormelImportieren +end sub + +testcase tExtrasFormelImportieren + dim i,x as integer + +'/// check if formula is loaded in same window ///' + + Call hNewDocument + + '/// check amount of available filters (6) (inc. one seperator) ///' + ToolsImportFormula + Kontext "OeffnenDlg" + x = Dateityp.GetItemCount + if x <> cFilterCountLoad then warnlog " The Filter count is wrong! Have to be ("+cFilterCountLoad+"), but are: "+x + printlog "------------- this is the filter list: ------------" + for i = 1 to x + try + Printlog " "+i+": " + Dateityp.GetItemText (i) + catch + printlog "fail ------------" + endcatch + next i + OeffnenDlg.Cancel + Sleep 2 + + Call hCloseDocument +endcase + + diff --git a/testautomation/math/optional/input/101_1.sxm b/testautomation/math/optional/input/101_1.sxm new file mode 100755 index 000000000..e2190231b Binary files /dev/null and b/testautomation/math/optional/input/101_1.sxm differ diff --git a/testautomation/math/optional/input/filter/math.sxw b/testautomation/math/optional/input/filter/math.sxw new file mode 100755 index 000000000..c9f514a4e Binary files /dev/null and b/testautomation/math/optional/input/filter/math.sxw differ diff --git a/testautomation/math/optional/input/filter/precal_test.doc b/testautomation/math/optional/input/filter/precal_test.doc new file mode 100755 index 000000000..c10c4014a Binary files /dev/null and b/testautomation/math/optional/input/filter/precal_test.doc differ diff --git a/testautomation/math/optional/input/filter/quantum_field.doc b/testautomation/math/optional/input/filter/quantum_field.doc new file mode 100755 index 000000000..cccc8b038 Binary files /dev/null and b/testautomation/math/optional/input/filter/quantum_field.doc differ diff --git a/testautomation/math/optional/input/filter/seventh_grade.doc b/testautomation/math/optional/input/filter/seventh_grade.doc new file mode 100755 index 000000000..5ffe187b5 Binary files /dev/null and b/testautomation/math/optional/input/filter/seventh_grade.doc differ diff --git a/testautomation/math/optional/m_lvl1.bas b/testautomation/math/optional/m_lvl1.bas new file mode 100755 index 000000000..a9658b251 --- /dev/null +++ b/testautomation/math/optional/m_lvl1.bas @@ -0,0 +1,65 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: m_lvl1.bas,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 11:51:22 $ +'* +'* 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 +'* +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* Owner : thorsten.bosbach@sun.com +'* +'* short description : Math Function Test +'* +'\****************************************************************** + +global cFilterCountLoad as integer + +sub main + use "math\optional\includes\m_101_.inc" + use "math\optional\includes\m_105.inc" + use "math\optional\includes\m_106_.inc" + + printlog Chr(13) + "******* Math - Function - Test ******* " + + cFilterCountLoad = 7 + + Call hStatusIn ( "Math","m_lvl1.bas" ) + + Call m_101_ 'Filemenue + Call m_105 'Options + Call m_106_ 'Tools Menue + + Call hStatusOut +end sub + +sub LoadIncludeFiles + use "global\system\includes\master.inc" + use "global\system\includes\gvariabl.inc" + Call GetUseFiles + gApplication = "Math" +end sub diff --git a/testautomation/math/required/includes/m_001_.inc b/testautomation/math/required/includes/m_001_.inc new file mode 100755 index 000000000..ffac00408 --- /dev/null +++ b/testautomation/math/required/includes/m_001_.inc @@ -0,0 +1,691 @@ +'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: m_001_.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 11:51:23 $ +'* +'* 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 +'* +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* Owner : thorsten.bosbach@sun.com +'* +'* short description : +'* +'\***************************************************************** + + global cActFilter as string ' used filter for save + Const cActFilterExt = ".odf" ' used filter for save (extension) + +' "StarMath 5.0" ".smf" +' Datei$ = convertpath( gOfficePath + "user\work\killme" + cActFilterExt) +' Datei$ = convertpath( gOfficePath + "user\work\Erwin2"+cActFilterExt) +' Datei = convertpath(gofficepath + "user\work\test"+cActFilterExt) + +sub M_001_ + Printlog Chr(13) + "-- File Menu m_001_ --" + + cActFilter = gMathFilter + + Call tmFileNew + Call tmFileOpen +' Call Autopilot 'in Inc\desktop\autopilo.inc + Call tmFileClose + Call tmFileSave + Call tmFileSaveAs + Call tmFileSaveAll + Call tmFileReload + Call tmFileVersions + Call tmExportAsPDF + Call tmFileProperties + Call tmFilePrint + Call tmFilePrinterSetting + Call tmFilePassword +end sub + +testcase tmFileNew +'/// open application ///' + Call hNewDocument + '/// File->New->Templates and Documents ///' + FileNewFromTemplate + sleep 3 + Kontext "TemplateAndDocuments" + if TemplateAndDocuments.exists (5) then + try + '/// klick button 'Organize' ///' + Organize.click + kontext "DVVerwalten" + if DVVerwalten.exists (5) then + Call DialogTest (DVVerwalten) + sleep 1 + '/// close dialog 'Template Management' ///' + DVVerwalten.close + else + warnlog "DVVerwalten didn't exist :-(" + endif + catch + warnlog "error ;-) - 1" + endcatch + else + warnlog "templates and dokuments didn't exist :-(" + endif + try + sleep 1 + kontext "TemplateAndDocuments" + sleep 1 + Call DialogTest ( TemplateAndDocuments ) + catch + warnlog "no dialogtest possibele :-(" + endcatch + +' TBO i don't get in deep here, because it is not math specific +' and IMHO it doesn't make that sense here! +' should be enoug in writer... + '/// close dialog 'Templates and Documents' ///' + TemplateAndDocuments.Cancel +'/// close application ///' + Call hCloseDocument +endcase + +testcase tmFilePassword + Dim DokumentPfad$ + Dim Datei$ +'/// open application ///' +while (getDocumentCount > 0) +hCloseDocument +wend + hNewDocument + '/// type a formula ///' + SchreibenInMathdok "a over b" + + printlog "'/// - save doc as "+cActFilter+" with passwd - ///'" + FileSaveAs + Kontext "SpeichernDlg" + Datei$ = convertpath( gOfficePath + "user\work\killme" + cActFilterExt) + if Dir (Datei$) <> "" then kill Datei$ + printlog " Testfile: "+Datei$ + 'Dateityp.Select (cActFilter) + Passwort.Check + Dateiname.SetText Datei$ + Speichern.Click + Kontext "Active" + if Active.Exists (5) then + ' TBO: ??? what will be ??! + Printlog "(1/5) " + Active.GetText + Active.Yes + end if + + printlog "'/// Try wrong passwd confirmation ///'" + Sleep 2 + Kontext "Passwort" + sleep (2) + try + PasswortName.SetText "12345" + PasswortBestaetigen.Settext "54321" + Passwort.OK + Sleep 2 + catch + warnlog "had to ask for passwd!!!!" + endcatch + Kontext + if (Active.Exists (5) = FALSE ) then + Warnlog "Wrong passwordinput not detected" + else + Printlog "(2/5) " + Active.GetText + Active.OK + end if + + printlog "'/// Now do it right ///'" + Kontext "Passwort" + try + PasswortName.SetText "12345" + PasswortBestaetigen.Settext "12345" + Passwort.OK + catch + warnlog "had to ask for passwd!!!!" + endcatch + + Sleep 2 + printlog "'/// Gotcha & Close file/window ///'" + FileClose + sleep 1 + + printlog "'/// load again with wrong passwd ///'" + Call hFileOpen Datei$ + sleep 1 + Kontext "PasswordFileOpen" + try + Passwortname.SetText "34567" + PasswordFileOpen.OK + catch + warnlog "had to ask for passwd!!!!" + endcatch + Kontext "Active" + if Active.Exists(5) then + Printlog "(3/5) " + Active.GetText + Active.Ok + else + Warnlog "Wrong passwordinput not detected by loading the document" + end if + + printlog "'///load now with right passwd ///'" + Sleep 3 + 'Call hDateiOeffnen Datei$ + Kontext "PasswordFileOpen" + try + Passwortname.SetText "12345" + PasswordFileOpen.OK + catch + warnlog "had to ask for passwd!!!!" + endcatch + Sleep 2 + + printlog "'/// - save doc with new name under 6.... (has to be automagical selected by loading this doc!) w/o passwd - ///'" + Datei$ = convertpath( gOfficePath + "user\work\Erwin2"+cActFilterExt) + if Dir (Datei$) <> "" then kill Datei$ + FileSaveAs + Kontext "SpeichernDlg" + Dateiname.SetText Datei$ + if (Passwort.IsChecked <> TRUE) then + Warnlog "#i36015# Password has to be checked! :-(" + Passwort.Check + printlog "will be forced checked no!" + endif + Speichern.Click + Kontext "Messagebox" + '/// (if messagebox comes up, say YES) ///' + if Messagebox.Exists(2) then + Messagebox.Yes + endif + '/// password dialog has to show up! ///' + Kontext "Passwort" + if (Passwort.Exists(5) = FALSE)then + Warnlog "- Password dialog Didn't popped up after pressing save" + else + Kontext "Passwort" + '/// type password "a12345", confirm password: "a12345" -> RIGHT ///' + PasswortName.SetText "a12345" + PasswortBestaetigen.SetText "a12345" + Passwort.OK + sleep 2 + '/// close document ///' + FileClose + sleep 1 + endif + '/// open document ///' + FileOpen + sleep 1 + Kontext "OeffnenDlg" + Dateiname.SetText Datei$ + Oeffnen.Click + Kontext "PasswordFileOpen" + sleep 1 + '/// type password: "a12345" -> RIGHT ///' + PasswortName.SetText "a12345" + PasswordFileOpen.OK + sleep 5 + '/// File->SaveAs ///' + FileSaveAs + Kontext "SpeichernDlg" + Dateiname.SetText Datei$ + if (Passwort.IsChecked <> TRUE) then + Warnlog "#i36015# Password has to be checked! :-(" + Passwort.Check + printlog "will be forced checked no!" + endif + Passwort.UnCheck + '/// press 'save', without changing any checkbox! -> file has to be saved WITH password protection ///' + Speichern.Click + Kontext "Messagebox" + '/// (if messagebox comes up, say YES) ///' + if Messagebox.Exists(2) then Messagebox.Yes + '/// password dialog needn't to show up! ///' + Kontext "Passwort" + if (Passwort.Exists(5))then + Warnlog "- Password dialog neeedn't popped up after pressing save" + Kontext "Passwort" + password.cancel + '/// close document ///' + FileClose + else + '/// close document ///' + hCloseDocument + end if + hNewDocument + kontext "selectionmath" + if selectionmath.exists then + selectionmath.close + endif +endcase + +testcase tmFileReload + Dim Datei as String + dim sFilterName as string + dim sFilter as string + dim sFilterExt() as string + + Datei = convertpath(gofficepath + "user\work\test"+cActFilterExt) + if Dir (Datei) <> "" then kill (Datei) + + ' make sure saving in latest math filter works, checking global filtername and if necessary change it + sFilter = hGetUIFiltername("math8") + + '/// open application ///' + hNewDocument + '/// type a formula ///' + call hTBOtypeInDoc + '/// File->Save As ///' + FileSaveAs + Kontext "SpeichernDlg" + '/// select the actual default file format ///' + Dateityp.Select (hFindFilterPosition( sFilter )) + '/// type a file name ///' + Dateiname.SetText Datei + '/// click button 'save' ///' + Speichern.Click + Kontext "Active" + if Active.Exists(2) then Active.Yes + sleep 3 + '/// File->Close ///' + FileClose + Kontext + if MessageBox.Exists (1) then + WarnLog "After Saving and Closing the following MessageBox appears: " + MessageBox.GetText + MessageBox.Yes + end if + + '/// open just saved file ///' + Call hFileOpen Datei + '/// type a formula ///' + call hTBOtypeInDoc + sleep (3) + '/// File->Reload ///' + FileReload + sleep (3) + Kontext + if Active.Exists (1) then + PrintLog "Say no to: " + Active.GetText + '/// say NO to active ///' + active.No + else + WarnLog "Missing smth to say no to! " + end if + + Sleep 3 + '/// File->Reload ///' + FileReload + Kontext + if Active.Exists (1) then + PrintLog "Said yes to: " + Active.GetText + '/// say YES to active ///' + active.Yes + end if + '/// close application ///' + Call hCloseDocument +endcase + +testcase tmFileVersions + Dim Datei as String + + Datei = ConvertPath (gOfficePath & "user/work/test"+cActFilterExt) + if app.Dir (Datei) <> "" then app.kill (Datei) + + '/// open application ///' + Call hNewDocument + sleep 2 + '/// type a formula ///' + SchreibenInMathdok "a over b" + '/// save file ///' + Call hFileSaveAs(Datei) + Sleep 3 + try + '/// File->Versions ///' + FileVersions + catch + Warnlog "- File / Versions not accessible!" + goto endsub + endcatch + + Kontext "Versionen" + Call DialogTest ( Versionen ) + '/// click button 'Save New Version' ///' + Speichern.Click + Kontext "VersionskommentarEingeben" + Call DialogTest ( VersionskommentarEingeben ) + '/// cancel dialog 'Insert Version Comment' ///' + VersionskommentarEingeben.Cancel + Kontext "Versionen" + '/// close dialog 'Version of ...' ///' + Versionen.Close + '/// close application ///' + Call hCloseDocument + if app.Dir (Datei) <> "" then app.kill Datei +endcase + +testcase tmFilePrint +'/// open application ///' + Call hNewDocument + sleep 3 + '/// File->Print ///' + FilePrint + kontext + if active.exists(2) then + active.ok + qaerrorlog "There is no printer available - please install one on your system!" + endif + sleep 2 + Kontext "DruckenDlg" + Call DialogTest (DruckenDlg) + '/// cancel dialog 'Print' ///' + DruckenDlg.Cancel + sleep 2 +'/// close application ///' + Call hCloseDocument +endcase + +'----------------------------------------------------------- +'******************* I D dito ************************* +'----------------------------------------------------------- + +testcase tmFileOpen +'/// open application ///' + call hNewDocument + '/// File->Open ///' + FileOpen + Kontext "OeffnenDlg" + '/// klick button 'Up one level' ///' + UebergeordneterOrdner.Click + '/// klick button 'Default Directory' ///' + Standard.Click + '/// check checkbox 'Read Only' ///' + NurLesen.check + Call DialogTest ( OeffnenDlg ) + '/// cancel dialog 'Open' ///' + OeffnenDlg.Cancel + Sleep 2 + '/// close application ///' + Call hCloseDocument +endcase + +testcase tmFileClose +'/// open application ///' + hNewDocument ' just for the records: i open ONE document + '/// type a formula ///' + call hTBOtypeInDoc + sleep (2) + '/// File->Close ///' + FileClose + Kontext ' expecting 'modified, do you want to close?' + if active.exists (5) then + printlog " ok, active came up: " + active.gettext + '/// say NO to active about 'modified stuff :-)' ///' + Active.Cancel ' no, not this time + else + warnlog "active missing (1)" + endif + sleep (2) + '/// File->Close ///' + FileClose + Kontext + '/// say YES to active about 'modified stuff :-)' ///' + Active.Yes ' but now - records: this document is closed + sleep (2) + Kontext "SpeichernDlg" + Call DialogTest ( SpeichernDlg ) + '/// cancel dialog 'Save As' ///' + SpeichernDlg.Cancel + sleep (2) + + '/// File->Close ///' + FileClose ' now the office gets closed! (if there were no modifications!) + Kontext + if active.exists (5) then Active.No + sleep (2) +endcase + +testcase tmFileSave +'/// open application ///' + hNewDocument + '/// type a formula ///' + call hTBOtypeInDoc + '/// File->Save ///' + FileSave + sleep 2 + Kontext "SpeichernDlg" + UebergeordneterOrdner.click + Standard.Click +' NeuerOrdner.Click +' DateiAuswahl.TypeKeys "Hallo" +' DateiLoeschen +' Kontext "Messagebox" +' MessageBox.Yes + Call DialogTest (SpeichernDlg) + '/// cancel dialog 'Save' ///' + SpeichernDlg.Cancel + sleep 2 + '/// close application ///' + Call hCloseDocument +endcase + +testcase tmFileSaveAs +'/// open application ///' + hNewDocument + sleep (2) + '/// type a formula ///' + call hTBOtypeInDoc + '/// File->Save As ///' + FileSaveAs + sleep 1 + Kontext "SpeichernDlg" + if (SpeichernDlg.exists (5) = FALSE) then + warnlog "error :-(" + endif + sleep 2 + '/// check ceckbox 'save with Password' ///' + Passwort.check + '/// UNcheck ceckbox 'save with Password' ///' + Passwort.uncheck + '/// click button 'up one level' ///' + UebergeordneterOrdner.click + '/// click button 'default directory' ///' + Standard.Click + '/// click button 'create new directory' ///' + NeuerOrdner.click + kontext "NeuerOrdner" + '/// cancel dialog 'create new folder' ///' + NeuerOrdner.cancel + Kontext "SpeichernDlg" + Call DialogTest (SpeichernDlg) + '/// cancel dialog 'Save As' ///' + SpeichernDlg.Cancel + sleep (2) + '/// close application ///' + Call hCloseDocument +endcase + +testcase tmFileSaveAll +'/// open application ///' + hNewDocument + '/// type a formula ///' + call hTBOtypeInDoc + Printlog " '/// open 2. window ///" + hNewDocument + '/// type a formula ///' + call hTBOtypeInDoc + + Printlog " call save all" + '/// File->Save All ///' + FileSaveAll + Printlog " cancel 1. save" + Kontext "SpeichernDlg" + if SpeichernDlg.exists(5) then + '/// cancel dialog 'save as' ///' + SpeichernDlg.Cancel + else + qaErrorlog "First File save dialog did not show up." + endif + Printlog " cancel 2. save" + Kontext "SpeichernDlg" + if SpeichernDlg.exists(5) then + '/// cancel dialog 'save as' ///' + SpeichernDlg.Cancel + else + qaErrorlog "Second File save dialog did not show up." + endif + + try + Kontext "SpeichernDlg" + SpeichernDlg.Cancel + printlog "smth had been typed in the starting window (just a hint ;-) )" + catch + printlog "--------- no other window want's to get saved. :-)" + endcatch + + Sleep 2 + Printlog " hCloseDocument both" + '/// close document ///' + Call hCloseDocument + sleep 2 + Printlog " first closed" + '/// close application ///' + try + Call hCloseDocument + catch + printlog "any catching?" + endcatch + sleep 1 + Printlog " second closed" + sleep (5) +endcase + +testcase tmExportAsPDF + dim sPDF as string + dim sTemp as string + + sPDF = "PDF - Portable Document Format (.pdf)" + + '/// open application ///' + Call hNewDocument + + '/// click the button 'Export Directly as PDF' on the Functionbar ///' + kontext "Standardbar" + Sleep 5 + ExportAsPDF.click + ' the 'Export as PDF' dialog has to come up, with the only 'File type' 'PDF - Portable Document Format (.pdf)' + kontext "ExportAsPDFDlg" + sTemp = Dateityp.GetSelText + if (sTemp <> sPDF) then + Warnlog "filter for PDF export is missing :-( should: '" + sPDF + "'; is: '" + + "'" + endif + '///+ - set Textbox 'File name' to "abc" ///' + Dateiname.SetText "abc" + '///+ - use the cursor keys in the filebrowser ///' + DateiAuswahl.TypeKeys "" + '///+ - click on the button 'Up one level' ///' + UebergeordneterOrdner.Click + '///+ - click on the button 'Create New Directory' ///' + NeuerOrdner.Click + kontext "NeuerOrdner" + '///+ - - in the dialog $Foldername set textfield 'New' to 'abc' ///' + OrdnerName.SetText "abc" + '///+ - - cancel dialog $Foldername ///' + NeuerOrdner.cancel + kontext "ExportAsPDFDlg" + '///+ - click on the button 'Default Directory' ///' + Standard.Click + '///+ - cancel dialog ///' + Kontext "ExportierenDlg" + ExportierenDlg.Cancel + + '/// close application ///' + Call hCloseDocument +endcase + +testcase tmFileProperties +'/// open application ///' + Call hNewDocument + '/// File->Properties... ///' + FileProperties + + Kontext + '/// select tabpage 'General' ///' + active.SetPage TabDokument + Kontext "TabDokument" + Call DialogTest ( TabDokument ) + + Kontext + '/// select tabpage 'Description' ///' + active.SetPage TabDokumentInfo + Kontext "TabDokumentInfo" + Call DialogTest ( TabDokumentInfo ) + + Kontext + '/// select tabpage 'User defined' ///' + active.SetPage TabBenutzer + Kontext "TabBenutzer" + Call DialogTest ( TabBenutzer ) + '/// click button 'info fields' ///' + Infofelder.Click + Kontext "InfonamenBearbeiten" + Call DialogTest (InfonamenBearbeiten) + '/// close dialog 'edit field names' ///' + InfoNamenBearbeiten.Cancel + + Kontext + '/// select tabpage 'Internet' ///' + active.SetPage TabInternet + Kontext "TabInternet" + Call DialogTest (TabInternet) + TabInternet.Cancel + '/// close application ///' + Call hCloseDocument +endcase + +testcase tmFilePrinterSetting +'/// open application ///' + Call hNewDocument + sleep 3 + '/// File->Printer Settings ///' + FilePrintersettings + kontext + if active.exists(2) then + active.ok + qaerrorlog "There is no printer available - please install one on your system!" + endif + Kontext "DruckerEinrichten" + Call DialogTest (DruckerEinrichten) + sleep 2 + '/// cancel dialog 'printer setup' ///' + DruckerEinrichten.Cancel + sleep 2 + '/// close application ///' + Call hCloseDocument +endcase + +sub hTBOtypeInDoc + SchreibenInMathdok "a over b" +end sub + diff --git a/testautomation/math/required/includes/m_002_.inc b/testautomation/math/required/includes/m_002_.inc new file mode 100755 index 000000000..f13f83fff --- /dev/null +++ b/testautomation/math/required/includes/m_002_.inc @@ -0,0 +1,138 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: m_002_.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 11:51:23 $ +'* +'* 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 +'* +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* Owner : thorsten.bosbach@sun.com +'* +'* short description : +'* +'\***************************************************************** + +sub M_002_ + printlog Chr(13) + "-- Edit Menu m_002_ --" + + Call tmEditUndoRedo + Call tmEditAllClipboard + Call tmEditMarker + Call tmEditFailure +end sub + +testcase tmEditUndoRedo + '/// Edit / Undo and Edit / Redo /// + '/// open application ///' + hNewDocument + kontext "DocumentMath" + '/// type something into the document ///' + call hTBOtypeInDoc + try + '/// Edit->Undo ///' + EditUndo + catch + warnlog "edit->undo doesn't work :-(" + endcatch + Sleep 2 + '/// Edit->Redo ///' + EditRedo + Sleep 2 + '/// close application ///' + Call hCloseDocument +endcase + +testcase tmEditAllClipboard + '/// open application ///' + hNewDocument + kontext "DocumentMath" +' DocumentMath.TypeKeys Eingabe not working +' kontext "Commands" also not working -- only way to type smth is clippboard +' Commands.TypeKeys Eingabe + + '/// type something into the document ///' + call hTBOtypeInDoc + '/// Edit->Select All ///' + EditSelectAllMath + Sleep 2 + '/// Edit->Cut ///' + EditCut + Sleep 2 + '/// Edit->Paste ///' + EditPaste + Sleep 2 + '/// Edit->Paste ///' + EditPaste + Sleep 2 + '/// Edit->Select All ///' + EditSelectAllMath + Sleep 2 + '/// Edit->Copy ///' + EditCopy + Sleep 2 + '/// Edit->Paste ///' + EditPaste + Sleep 2 + '/// close application ///' + Call hCloseDocument +endcase + +testcase tmEditMarker + '/// open application ///' + hNewDocument + '/// type something into the document ///' + SchreibenInMathdok "Nonsense" + '/// Edit->Previous Marker ///' + EditPreviousMarker + '/// Edit->Previous Marker ///' + EditPreviousMarker + Sleep 2 + '/// Edit->Next Marker ///' + EditNextMarker + Sleep 2 + '/// close application ///' + Call hCloseDocument +endcase + +testcase tmEditFailure + '/// open application ///' + hNewDocument + '/// type something into the document ///' + SchreibenInMathdok "Nonsense" + '/// Edit->Next Error ///' + EditNextError + '/// Edit->Next Error ///' + EditNextError + Sleep 2 + '/// Edit->Previous Error ///' + EditPreviousError + Sleep 2 + '/// close application ///' + Call hCloseDocument +endcase + diff --git a/testautomation/math/required/includes/m_003_.inc b/testautomation/math/required/includes/m_003_.inc new file mode 100755 index 000000000..1598dac64 --- /dev/null +++ b/testautomation/math/required/includes/m_003_.inc @@ -0,0 +1,183 @@ +'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: m_003_.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 11:51:23 $ +'* +'* 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 +'* +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* Owner : thorsten.bosbach@sun.com +'* +'* short description : +'* +'\***************************************************************** + +sub M_003_ + printlog Chr(13)+"-- File_View m_003_ --" + + Call tViewZoom + Call tViewUpdate + Call tViewAutomaticRepaint + Call tViewBars + ' ^ View->Status bar + Call tViewOperators + Call tViewEntireDesktop +end sub + +testcase tViewZoom +'/// open application ///' + Call hNewDocument + '/// type something into the document ///' + Call SchreibenInMathdok "What's the matter?" + sleep 2 + UseBindings + '/// View -> Zoom ///' + ViewZoom + Kontext "Massstab" + DialogTest ( Massstab ) + '/// check checkbox 'Entire Page' ///' + GanzeSeite.check + '/// check checkbox 'Page Width' ///' + Seitenbreite.check + '/// check checkbox 'Optmal' ///' + Optimal.check + '/// check checkbox 'Variable' ///' + VergroesserungStufenlos.check + '/// cancel dialog 'Zoom' ///' + Massstab.Cancel + '///View -> Zoom In /// + ViewZoomIn + sleep (2) + '///View -> Zoom Out /// + ViewZoomAll + sleep (2) + '///View -> Show All /// + ViewShowAll + sleep (2) + '/// close application ///' + Call hCloseDocument +endcase + +testcase tViewUpdate +'/// open application ///' + Call hNewDocument + '/// type something into the document ///' + Call SchreibenInMathdok "a sup b" + '/// Edit->Paste ///' + EditPaste + '/// View->Update ///' + ViewUpdate + sleep (2) + '/// close application ///' + Call hCloseDocument +endcase + +testcase tViewAutomaticRepaint +'/// open application ///' + Call hNewDocument + '/// type something into the document ///' + Call SchreibenInMathdok "a sup b" + '/// View->AutoUpdate Display ///' + ViewAutoUpdateDisplay + '/// Edit->Paste ///' + EditPaste + sleep (2) + '/// View->AutoUpdate Display ///' + ViewAutoUpdateDisplay + sleep (2) + '/// close application ///' + Call hCloseDocument +endcase + +testcase tViewBars +'/// open application ///' + Call hNewDocument + '/// type something into the document ///' + SchreibenInMathdok "a sup b" + try + '/// View->Toolbars->Function bar ///' + ViewToolbarsStandard + sleep (2) + '/// View->Toolbars->Function bar ///' + ViewToolbarsStandard + sleep (1) + '/// View->Toolbars->Main Toolbar ///' + ViewToolbarsTools + sleep (2) + '/// View->Toolbars->Main Toolbar ///' + ViewToolbarsTools + sleep (1) + '/// View->Status bar ///' + ViewToolbarsStatusbar + sleep (1) + '/// View->Status bar ///' + ViewToolbarsStatusbar + sleep (1) + catch + warnlog "toolbar slots not accessible" + endcatch + '/// close application ///' + Call hCloseDocument +endcase + +testcase tViewOperators +'/// open application ///' + Call hNewDocument + '/// type something into the document ///' + Call SchreibenInMathdok "a over b" + '/// View->Selection ///' + ViewSelection + sleep (2) + '/// View->Selection ///' + ViewSelection + Kontext "OperatorenMath" + if (NOT OperatorenMath.Exists (2)) then + ViewSelection + printlog "View Selection wasn't visible :-( now is!" + endif + Call DialogTest ( OperatorenMath ) + '/// close application ///' + Call hCloseDocument +endcase + +testcase tViewEntireDesktop +'/// open application ///' + Call hNewDocument + '/// type something into the document ///' + Call SchreibenInMathdok "(a over ba) over (a + 1/2 * b )" + '/// View->Full Screen ///' + ViewFullScreen + sleep 2 + '/// View->Full Screen ///' + ViewFullScreen + sleep 1 + '/// close application ///' + Call hCloseDocument +endcase + + diff --git a/testautomation/math/required/includes/m_004_.inc b/testautomation/math/required/includes/m_004_.inc new file mode 100755 index 000000000..3a84e9b1a --- /dev/null +++ b/testautomation/math/required/includes/m_004_.inc @@ -0,0 +1,292 @@ +'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: m_004_.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 11:51:23 $ +'* +'* 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 +'* +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* Owner : thorsten.bosbach@sun.com +'* +'* short description : +'* +'\***************************************************************** + +sub M_004_ + Printlog Chr(13)+"-- Format Menu m_004_ --" + + Call tFormatFonts + Call tFormatFontsize + Call tFormatDistance + Call tFormatAlignment + Call tFormatTextmode +end sub + +testcase tFormatFonts + Dim i as integer + dim iCount as integer + '/// open application ///' + Call hNewDocument + sleep (5) + '/// Format->Fonts ///' + FormatFonts + Kontext "Schriftarten" + Call DialogTest (Schriftarten) + '/// select every entry from 'Modify' and do ///' + Aendern.OpenMenu + iCount = hMenuItemGetCount + if (iCount <> 7) then + warnlog "There are Entries missing; expected: '7'; found: '" + iCount +"'" + endif + for i=1 to iCount + sleep 2 + printlog " Font for Menuitem Nr. " & i + sleep 2 + hMenuSelectNr ( i ) + Sleep 2 + Kontext "Schriften" + Call DialogTest (Schriften) + if (i<5) then + try + '/// check checkbox 'bold' ///' + fett.check + '/// check checkbox 'italic' ///' + kursiv.check + catch + warnlog "fett and/or kursiv checkbox doesn't exist" + endcatch + else + if (fett.isvisible OR kursiv.isVisible) then + warnlog "fett and/or kursiv checkbox exists" + endif + endif + sleep 1 + '/// cancel dialog 'fonts' ///' + Schriften.Cancel + Sleep 2 + Kontext "Schriftarten" + Aendern.OpenMenu + next i + Kontext "Schriftarten" + hMenuClose + '/// cklick button 'default' ///' + Standard.Click + Kontext "Active" + if active.exists (5) then + Active.No ' should changes ybe saved as default (yes/no) + else + warnlog "should changes be saved as default (yes/no) failed :-(" + endif + Kontext "Schriftarten" + '/// cancel dialog 'fonts' ///' + Schriftarten.Cancel + '/// close document ///' + Call hCloseDocument +endcase + +testcase tFormatFontsize + '/// open application ///' + Call hNewDocument + '/// Format->FontSize ///' + FormatFontSize + Kontext "Schriftgroessen" + Call DialogTest (Schriftgroessen) + '/// press button MORE on 'Base size' ///' + BasisGroesse.more + '/// press button MORE on 'Text' ///' + TextGroesse.more + '/// press button MORE on 'Indexes' ///' + Indizes.more + '/// press button MORE on 'Functions' ///' + Funktionen.more + '/// press button MORE on 'Operators' ///' + Operatoren.more + '/// press button MORE on 'Limits' ///' + Grenzen.more + sleep 1 + '/// press button 'default' ///' + Standard.Click + kontext "active" + if active.exists (5) then + Active.No ' should changes ybe saved as default (yes/no) + else + warnlog "should changes be saved as default (yes/no) failed :-(" + endif + Kontext "Schriftgroessen" + '/// cancel dialog 'Font Sizes' ///' + Schriftgroessen.Cancel + sleep 2 +'/// close document ///' + Call hCloseDocument +endcase + +testcase tFormatDistance + Dim i as integer + '/// open application ///' + Call hNewDocument + '/// Format->Spacing ///' + FormatSpacing + Kontext "Spacing" + Call DialogTest (Spacing) + Category.Open + sleep 1 + for i=1 to hMenuItemGetCount + hMenuSelectNr (i) + Sleep 1 + Call DialogTest2 (Spacing,i) + Select Case i + Case 1 + '/// select 'Spacing' from Category menu ///' + '///+ click MORE button on '' ///' + SpacingSpacing.More + '///+ click MORE button on '' ///' + LineSpacing.More + '///+ click MORE button on '' ///' + RootSpacing.More + Case 2 + '/// select 'Indexing' from Category menu ///' + '///+ click MORE button on '' ///' + Superscript.More + '///+ click MORE button on '' ///' + Subscript.More + Case 3 + '/// select 'Fractions' from Category menu ///' + '///+ click MORE button on '' ///' + Numerator.More + '///+ click MORE button on '' ///' + Denominator.More + Case 4 + '/// select 'Fraction bars' from Category menu ///' + '///+ click MORE button on '' ///' + ExcessLength.More + '///+ click MORE button on '' ///' + Weight.More + Case 5 + '/// select 'Limits' from Category menu ///' + '///+ click MORE button on '' ///' + UpperLimit.More + '///+ click MORE button on '' ///' + LowerLimit.More + Case 6 + '/// select 'Brackets' from Category menu ///' + '///+ click MORE button on '' ///' + ExcessSize.More + '///+ click MORE button on '' ///' + BracketSpacing.More + ScaleAllBrackets.Check + '///+ click MORE button on '' ///' + ExcessSizeAll.More + Case 7 + '/// select 'Matrixes' from Category menu ///' + '///+ click MORE button on '' ///' + MatrixLineSpacing.More + '///+ click MORE button on '' ///' + ColumnSpacing.More + Case 8 + '/// select 'Symbols' from Category menu ///' + '///+ click MORE button on '' ///' + PrimaryHeight.More + '///+ click MORE button on '' ///' + MinimunSpacing.More + Case 9 + '/// select 'Operators' from Category menu ///' + '///+ click MORE button on '' ///' + OperatorsExcessSize.More + '///+ click MORE button on '' ///' + OperatorsSpacing.More + Case 10 + '/// select 'Borders' from Category menu ///' + '///+ click MORE button on '' ///' + BordersLeft.More + '///+ click MORE button on '' ///' + BordersRight.More + '///+ click MORE button on '' ///' + BordersTop.More + '///+ click MORE button on '' ///' + BordersBottom.More + Case Else + warnlog "More items than expected :-(" + End Select + Category.Click + next i + hMenuClose + Sleep 1 + Default.Click + kontext "active" + if active.exists (5) then + Active.No ' should changes ybe saved as default (yes/no) + else + warnlog "should changes be saved as default (yes/no) failed :-(" + endif + Kontext "Spacing" + '/// cancel dialog 'Spacing' ///' + Spacing.Cancel + Sleep 2 +'/// close document ///' + Call hCloseDocument +endcase + +testcase tFormatAlignment + '/// open application ///' + Call hNewDocument + '/// Format->Alignment ///' + FormatAlignment + Kontext "Ausrichtung" + Call DialogTest (Ausrichtung) + '/// check Radiobutton 'Left' ///' + Links.Check + '/// check Radiobutton 'Centered' ///' + Zentriert.Check + '/// check Radiobutton 'Right' ///' + Rechts.Check + '/// check Button 'Default' ///' + Standard.Click + kontext "active" + if active.exists (5) then + Active.No ' should changes ybe saved as default (yes/no) + else + warnlog "should changes be saved as default (yes/no) failed :-(" + endif + Kontext "Ausrichtung" + Ausrichtung.Cancel + '/// close document ///' + Call hCloseDocument +endcase + +testcase tFormatTextmode +'/// open application ///' + Call hNewDocument + '/// Format->Text Mode ///' + FormatTextMode + sleep 1 + '/// Format->Text Mode ///' + FormatTextMode +'/// close document ///' + Call hCloseDocument +endcase + diff --git a/testautomation/math/required/includes/m_005_.inc b/testautomation/math/required/includes/m_005_.inc new file mode 100755 index 000000000..f1c7ff08a --- /dev/null +++ b/testautomation/math/required/includes/m_005_.inc @@ -0,0 +1,315 @@ +'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: m_005_.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 11:51:23 $ +'* +'* 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 +'* +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* Owner : thorsten.bosbach@sun.com +'* +'* short description : +'* +'\***************************************************************** + +sub M_005_ + printlog Chr(13) + "-- Tools Menu m_005_ --" + + Call tToolsCatalog + Call tToolsImportFormula + Call tiToolsMacro + Call tToolsExtensionManager + + Call tToolsCustomize 'global one ! TBO + Call tToolsOptionstest ' global one ! TZ +end sub + +testcase tToolsCatalog + '/// open application ///' + Call hNewDocument + '/// Tools->Catalog ///' + ToolsSymbolsCatalog + Kontext "SymboleMath" + Call Dialogtest (SymboleMath) + printlog "count of 'Symbol set' :" + Symbolset.GetItemCount + '/// click button 'Edit...' ///' + Bearbeiten.Click + Kontext "EditSymbols" + Call DialogTest (EditSymbols) + OldSymbol.GetItemCount + OldSymbolSet.GetItemCount + Symbol.GetItemCount + SymbolSet.GetItemCount + Subset.GetItemCount + Typeface.GetItemCount + '/// select last item in listbox 'Font' ///' + Font.Select (Font.GetItemCount) + sleep 1 + '/// Click Button 'Modify' ///' + Modify.Click + sleep 1 + '/// Click Button 'Delete' ///' + Delete.Click + sleep 1 + '/// Click Button 'Add' ///' + Add.Click + sleep 1 + '/// cancel dialog 'Edit Symbols' ///' + EditSymbols.Cancel + Kontext "SymboleMath" + '/// click button 'Insert' ///' + Uebernehmen.Click + Sleep 2 + '/// close dialog 'Symbols' ///' + SymboleMath.close + '/// close application ///' + Call hCloseDocument +endcase + +testcase tToolsImportFormula + '/// open application ///' + Call hNewDocument + Sleep 3 + '/// Tools->Import->Formula ///' + ToolsImportFormula + Kontext "OeffnenDlg" + Kontext "OeffnenDlg" + UebergeordneterOrdner.Click + Standard.Click + Call DialogTest ( OeffnenDlg ) + '/// cancel dialog 'Insert' ///' + OeffnenDlg.Cancel + Sleep 2 + '/// close application ///' + Call hCloseDocument +endcase + +testcase tiToolsMacro +'/// open application ///' + Call hNewDocument + sleep 2 + '/// try to call Tools->Macros...->Record Macro => this has to fail, it is only aloowed from writer and Calc ///' + try + ToolsMacroRecordMacro + Warnlog "I can record macros in this application :-(" + catch + Printlog "i can't record macros in this application :-)" + endcatch +'/// Tools->Macro ///' + ToolsMacro + Kontext "Makro" + Call DialogTest ( Makro ) +'/// click button 'organizer...' ///' + Verwalten.Click + + Kontext +'/// switch to tabpage 'Modules' ///' + Messagebox.SetPage TabModule + Kontext "TabModule" + Call DialogTest ( TabModule ) + + Kontext +'/// switch to tabpage 'Libraries' ///' + Messagebox.SetPage TabBibliotheken + Kontext "TabBibliotheken" + Call DialogTest ( TabBibliotheken ) +'/// click lbutton 'append' ///' + Hinzufuegen.Click + Kontext "Messagebox" + if Messagebox.Exists (5) then + if Messagebox.GetRT = 304 then + Warnlog Messagebox.Gettext + Messagebox.Ok + endif + end if + Kontext "OeffnenDlg" +'/// cancel dialog 'append libraries' ///' + OeffnenDlg.Cancel + Kontext "TabBibliotheken" +'/// click button 'new' ///' + Neu.Click + kontext "NeueBibliothek" + sleep 1 'Bibliotheksname +'/// cancel dialog 'new library' ///' + NeueBibliothek.cancel + Kontext "TabBibliotheken" +'/// close dialog 'macro organizer' ///' + TabBibliotheken.Close + + Kontext "Makro" +'/// close dialog 'macro' ///' + Makro.Cancel +'/// close application ///' + Call hCloseDocument +endcase + +testcase tToolsExtensionManager + dim sPath as string + dim sTemp as string + dim sTemp2 as string + dim x as integer + + sPath = convertPath(gTestToolPath+"math/required/input/") + '/// open application ///' + Call hNewDocument + sleep 2 + '/// call Tools - Package/Extension manager ///' + ToolsPackageManager + kontext "PackageManager" + If PackageManager.exists(10) then + DialogTest(PackageManager) + '/// going to top of package list and explode every line, until the button 'Add' is enabled ///' + '/// should be 'My Packages' ///' + BrowsePackages.typeKeys("") + if (Not Add.isEnabled) then + warnlog "Couldn't find a way to enable the Add button - aborting" + goto endsub + endif + '/// click button 'Add' ///' + Add.click + '/// Add Package(s)... dialg comes up ///' + Kontext "OeffnenDlg" + if OeffnenDlg.exists(5) then + '/// put filename into field ///' + Dateiname.setText (sPath + "unknown-dependency.oxt") + '/// press button 'Open' ///' + Oeffnen.click + else + warnlog "Add Package(s)... dialog didn't came up" + endif + + 'Asking for whom to install; All: YES, Me: NO, nobody: Cancel + kontext + if active.exists(5) then + sTemp = active.getText + try + active.yes + catch + 'printlog sTemp + endcatch + endif + + '/// Progress dialog comes up ///' + Kontext "AddingPackages" + if AddingPackages.exists(1) then + printlog " - AddingPackages dialog exists" + DialogTest(AddingPackages) + endif + + '/// If any error happens, an active comes up, telling what is wrong ///' + Kontext + if active.exists(5) then + sTemp = active.getText + printlog sTemp + active.ok + endif + + '/// If there are any unsatisfied dependencies, they are shown now ///' + Kontext "UnsatisfiedDependencies" + if UnsatisfiedDependencies.exists(10) then + printlog " - UnsatisfiedDependencies dialog exists" + DialogTest(UnsatisfiedDependencies) + '/// close dialog if available, extension will not be installed ///' + UnsatisfiedDependencies.ok + endif + + Kontext "AddingPackages" + x=0 + while AddingPackages.exists(1) AND (x<6) + printlog "AddingPackages..." + sleep 5 + x=x+1 + wend + + kontext "PackageManager" + Add.click + '/// Add Package(s)... dialg comes up ///' + Kontext "OeffnenDlg" + if OeffnenDlg.exists(5) then + '/// put filename into field ///' + Dateiname.setText (sPath + "ShortLicense.oxt") + '/// press button 'Open' ///' + Oeffnen.click + else + warnlog "Add Package(s)... dialog didn't came up" + endif + + 'Asking for whom to install; All: YES, Me: NO, nobody: Cancel + kontext + if active.exists(5) then + sTemp = active.getText + try + active.yes + catch + 'printlog sTemp + endcatch + endif + + '/// Progress dialog comes up ///' + Kontext "AddingPackages" + if AddingPackages.exists(1) then + printlog " - AddingPackages dialog exists" + endif + + '/// If any error happens, an active comes up, telling what is wrong ///' + Kontext + if active.exists(5) then + sTemp = active.getText + printlog sTemp + active.ok + endif + + '/// If there is a license, it is shown now ///' + Kontext "ExtensionSoftwareLicenseAgreement" + if ExtensionSoftwareLicenseAgreement.exists(10) then + DialogTest (ExtensionSoftwareLicenseAgreement) + printlog " - ExtensionSoftwareLicenseAgreement dialog exists" + ExtensionSoftwareLicenseAgreement.CANCEL + kontext + if active.exists(5) then + qaerrorlog "#i73307# Alzheimer feature extension licensing '" + active.getText + "'" + active.ok + endif + endif + + Kontext "AddingPackages" + x=0 + while AddingPackages.exists(1) AND (x<6) + printlog "AddingPackages..." + sleep 5 + x=x+1 + wend + + '/// Close extension manager ///' + kontext "PackageManager" + PackageManager.OK + else + warnlog "Couldn't call Tools -> Package manager - aborting test" + endif + Call hCloseDocument +endcase diff --git a/testautomation/math/required/includes/m_006_.inc b/testautomation/math/required/includes/m_006_.inc new file mode 100755 index 000000000..43f71895e --- /dev/null +++ b/testautomation/math/required/includes/m_006_.inc @@ -0,0 +1,59 @@ +'************************************************************************** +'* 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: m_006_.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 11:51:23 $ +'* +'* 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 +'* +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* Owner : thorsten.bosbach@sun.com +'* +'* short description : +'* +'\***************************************************************** + +sub m_006_ + + printlog Chr(13) + "-- Window-Menu --" + + Call tWindowNewWindow + +end sub + +'----------------------------------------------------------- +testcase tWindowNewWindow + PrintLog "- Window/NewWindow" + + Call hNewDocument + Call SchreibenInMathdok "f(x) = x sup 2 + 2x" + + WindowNewWindow + Sleep 2 + hCloseDocument +endcase + + diff --git a/testautomation/math/required/includes/m_007_.inc b/testautomation/math/required/includes/m_007_.inc new file mode 100755 index 000000000..9fc13b765 --- /dev/null +++ b/testautomation/math/required/includes/m_007_.inc @@ -0,0 +1,281 @@ +'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: m_007_.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 11:51:23 $ +'* +'* 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 +'* +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* Owner : thorsten.bosbach@sun.com +'* +'* short description : Test the Help Menu +'* +'\***************************************************************** + +sub M_007_ + printlog Chr(13)+ "-- Help-Menu m_007_ --" + Call tmHelpHelpAgent + Call tmHelpTips + Call tmHelpExtendedTips + Call tmHelpAboutStarOffice + Call tmHelpContents 'wrn:1 +end sub + +'----------------------------------------------------------- +'******************* I D dito ************************* +'----------------------------------------------------------- + + +testcase tmHelpHelpAgent + '/// open application ///' + Call hNewDocument + + hTBOtypeInDoc + + HelpHelpAgent ' it's just a switch + sleep 2 + HelpHelpAgent + + '/// close application ///' + Call hCloseDocument +endcase + +testcase tmHelpTips + '/// open application ///' + Call hNewDocument + hTBOtypeInDoc + + HelpTips + Sleep 2 + HelpTips + + '/// close application ///' + Call hCloseDocument +endcase + +testcase tmHelpExtendedTips + '/// open application ///' + Call hNewDocument + hTBOtypeInDoc + + HelpEntendedHelp + Sleep (2) + HelpEntendedHelp + + '/// close application ///' + Call hCloseDocument +endcase + +testcase tmHelpAboutStarOffice + '/// open application ///' + Call hNewDocument + hTBOtypeInDoc + + HelpAboutStarOffice + Kontext "UeberStarMath" + DialogTest (UeberStarMath) + UeberStarMath.OK + + '/// close application ///' + Call hCloseDocument +endcase + +testcase tmHelpContents + dim i as integer + + '/// open application ///' + Call hNewDocument + '/// Help->Contents ///' + sleep 1 + try + HelpContents + catch + qaerrorlog "argh!" + endcatch + sleep(8) + kontext "StarOfficeHelp" + if Not StarOfficeHelp.Exists then + Warnlog "Help is not up!" + else + '/// get the number of entries in the listbox 'select Help modul' ///' + try + Printlog "HelpAbout: '" + HelpAbout.GetItemCount +"'" + catch + Index.Click + qaErrorLog "#i55563# Used Index Button" + Printlog "HelpAbout: '" + HelpAbout.GetItemCount +"'" + endcatch + try + '################ left half ################ + '/// on the left half of the dialog: ///' + '///+ change to the tabpage 'Contents' ///' + TabControl.SetPage ContentPage + '///+ get the number of entries in the listbox 'MAin help themes' ///' + Printlog "SearchContent: '" + SearchContent.GetItemCount + "'" + '///+ change to the tabpage 'Index' ///' + TabControl.SetPage IndexPage + '///+ get the number of entries in the listbox 'Search term' ///' + Printlog "SearchIndex: '" + SearchIndex.GetItemCount + "'" + sleep 5 + '///+ click on button 'Display' ///' + DisplayIndex.Click + sleep 5 + '///+ change to the tabpage 'Find' ///' + TabControl.SetPage FindPage + '///+ get the number of entries in the listbox 'Search term' ///' + Printlog "SearchFind: '" + SearchFind.GetItemCount + "'" + '///+ click on button 'Find' -> It has to be disabled #107880# ///' + try + FindButton.Click + warnlog "Find button is enabled, but no text was enterd to search for: BUG!" + catch + printlog "Find without text entered to search for didn't work: OK" + endcatch + '///+ Enter 'recumbent' in textfield 'Search term' ///' + SearchFind.SetText "recumbent" + '///+ click on button 'Find' ///' + qaerrorlog "#i84151# Crash on using find button since src680m238 - disabled find button." + 'FindButton.Click + kontext + '///+ Messagebox comes up about: 'No topics found.' say OK ///' + if (active.exists (2) )then + Printlog "active came up: '" + active.gettext + "'" + active.ok + endif + kontext "StarOfficeHelp" + '///+ check checkbox 'Complete words only' ///' + FindFullWords.Check + '///+ check checkbox 'Find in headings only' ///' + FindInHeadingsOnly.Check + '///+ get the number of entries in the listbox 'List of headings' ///' + Printlog "Result: '" + Result.GetItemCount + "'" + '///+ click on button 'Display' ///' + DisplayFind.Click + '///+ change to the tabpage 'Bookmarks' ///' + TabControl.SetPage BookmarksPage + '///+ get the number of entries in the listbox 'Bookmark list' ///' + Printlog "Bookmarks: '" + Bookmarks.GetItemCount + "'" + '///+ click on button 'Display' ///' + DisplayBookmarks.Click + '################ right half ################ + '/// on the right half of teh dialog: ///' + '################ toolbar ################ + Kontext "TB_Help" + '///+ click on button 'Hide/Show Navigation Pane' ///' + Index.Click + sleep 1 + '///+ click on button 'Hide/Show Navigation Pane' ///' + Index.Click + '///+ click on button 'First Page' ///' + GoToStart.Click + '///+ click on button 'Previous Page' ///' + Backward.Click + '///+ click on button 'Next Page' ///' + Forward.Click + '///+ click on button 'Print ...' ///' + PrintButton.Click + kontext + if active.exists(2) then + active.ok + qaerrorlog "There is no printer available - please install one on your system!" + endif + sleep 2 + kontext "DruckenDLG" + '/// On the dialog 'Print' press the button 'Cancel' ///' + DruckenDLG.cancel + Kontext "TB_Help" + '///+ click on button 'Add to Bookmarks ...' ///' + SetBookmarks.Click + Kontext "AddBookmark" + '///+ on the dialog 'Add to Bookmarks ...' get the text from the editfield 'Bookmark' and press button 'Cancel' ///' + Printlog "Bookmarkname: '" + Bookmarkname.GetText + "'" + AddBookmark.Cancel + '################ help display ################ + kontext "HelpContent" + '///+ open the Context Menu of the Frame 'Help Content' and count the entries ///' + HelpContent.OpenContextMenu + Printlog " i: " + hMenuItemGetCount + hMenuClose() + '################ right scroolbar ################ + kontext "HelpContent" + '///+ click on button 'Previous Page' ///' + if HelpContentUP.IsVisible then + HelpContentUP.Click + kontext + if active.exists(5) then + qaerrorlog "Messagebox comes up! ##" + printlog "active: '" + active.getText + "'" + active.no + endif + endif + kontext "HelpContent" + '///+ click on button 'Navigation' ///' + if HelpContentNAVIGATION.IsVisible then + HelpContentNAVIGATION.Click + endif + kontext "NavigationsFenster" + '/// on the toolbox 'Navigation' press the window close button 'X' ///' + NavigationsFenster.Close + kontext "HelpContent" + '///+ click on button 'Next Page' ///' + if HelpContentDOWN.IsVisible then + HelpContentDOWN.Click + kontext + if active.exists(5) then + qaerrorlog "Messagebox comes up! ##" + printlog "active: '" + active.getText + "'" + active.no + endif + endif + catch + warnlog "something is not working in the help-window :-(" + endcatch + kontext "StarOfficeHelp" +' StarOfficeHelp.TypeKeys "" ' alt F4 ' doesn't work +' StarOfficeHelp.TypeKeys "" ' strg w ' doesn't work + '/// close the help with the keys [strg]+[F4] ///' + Printlog "trying to close the help now" + try + StarOfficeHelp.TypeKeys "" ' strg F4 supported since bug #103586# + catch + Warnlog "failed to close the help window :-(" + endcatch +' kontext "HelpContent" +' HelpContent.TypeKeys "" ' strg w ' doesn't work +' HelpContent.TypeKeys "" ' alt f4 ' doesn't work +' HelpContent.TypeKeys "" ' strg f4 supported since bug #103586# + kontext "StarOfficeHelp" + if StarOfficeHelp.Exists then + warnlog "Help still up!" + endif + endif + '/// close application ///' + Call hCloseDocument +endcase + + diff --git a/testautomation/math/required/includes/m_010_.inc b/testautomation/math/required/includes/m_010_.inc new file mode 100755 index 000000000..204ad3a91 --- /dev/null +++ b/testautomation/math/required/includes/m_010_.inc @@ -0,0 +1,676 @@ +'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: m_010_.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 11:51:23 $ +'* +'* 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 +'* +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* Owner : thorsten.bosbach@sun.com +'* +'* short description : +'* +'\***************************************************************** +'/// If a function button is not visible, the test exists. ///' + +sub M_010_ + + printlog Chr(13) + "-- Operators --" + + Call tAllUnaerBinaer + Call tAllRelations + Call tAllMixOperators + Call tAllFunctions + Call tAllOperators + Call tAllAttributes + Call tAllBrackets + Call tAllFormats + Call tOthers + +end sub + + +'----------------------------------------------------------- +testcase tAllUnaerBinaer + PrintLog "- SelectionWindow : All UnaerBinaer" + Call hNewDocument + + Kontext "AuswahlMath" + If AuswahlMath.notexists(2) then + ViewSelection + endif + ' others don't work ?? OperatorenMAth, SelectionMAth, ViewSelection... + Kontext "OperatorenMath" + + UnaereBinaere.Click + Sleep 1 + Kontext "AuswahlMath" + Call DialogTest2 ( AuswahlMath, 1 ) + +try + Plus.Click + Call Bereinigen + Minus.Click + Call Bereinigen + PlusMinus.Click + Call Bereinigen + MinusPlus.Click + Call Bereinigen + Additions.Click + Call Bereinigen + Multiplikation.Click + Call Bereinigen + MultiplikationKreuz.Click + Call Bereinigen + MultiplikationStern.Click + Call Bereinigen + Subtraktions.Click + Call Bereinigen + Division.Click + Call Bereinigen + DivisionDoppelpunkt.Click + Call Bereinigen + DivisionSchraegstrich.Click + Call Bereinigen + LogischesNICHT.Click + Call Bereinigen + LogischesUND.Click + Call Bereinigen + LogischesODER.Click + Call Bereinigen + Verkettung.Click +catch + warnlog "failed!" +endcatch + + Call hCloseDocument +endcase +'----------------------------------------------------------- +testcase tAllRelations + PrintLog "- SelectionWindow : All Relations" + Call hNewDocument + + Kontext "AuswahlMath" + If AuswahlMath.notexists(2) then AuswahlMath + Relationen.Click + Sleep 1 + Call DialogTest2 ( AuswahlMath, 2 ) + +try + IstGleich.Click + Call Bereinigen + IstUngleich.Click + Call Bereinigen + IstKongruentZu.Click + Call Bereinigen + IstOrthogonalZu.Click + Call Bereinigen + IstKleinerAls.Click + Call Bereinigen + IstGroesserAls.Click + Call Bereinigen + IstUngefaehrGleich.Click + Call Bereinigen + IstParallelZu.Click + Call Bereinigen + IstKleinerGleich.Click + Call Bereinigen + IstGroesserGleich.Click + Call Bereinigen + IstAehnlichOderGlech.Click + Call Bereinigen + IstProportionalZu.Click + Call Bereinigen + IstKleinerGleich2.Click + Call Bereinigen + IstGroesserGleich2.Click + Call Bereinigen + IstAehnlichZu.Click + Call Bereinigen + StrebtGegen.Click + Call Bereinigen + DoppelterPfeilNachLinks.Click + Call Bereinigen + DoppelterPfeilNachLinksUndRechts.Click + Call Bereinigen + DoppelterPfeilNachRechts.Click + Call Bereinigen + Teilt.Click + Call Bereinigen + TeiltNicht.Click + +catch + warnlog "failed!" +endcatch + + Call hCloseDocument +endcase +'----------------------------------------------------------- +testcase tAllMixOperators + PrintLog "- SelectionWindow : All SetOperators" + Call hNewDocument + + Kontext "AuswahlMath" + If AuswahlMath.notexists(2) then AuswahlMath + MengenOperatoren.Click + Sleep 1 + Call DialogTest2 ( AuswahlMath, 3 ) + +try + IstEnthaltenIn.Click + Call Bereinigen + IstNichtEnthaltenIn.Click + Call Bereinigen + Enthaelt.Click + Call Bereinigen + Durchschnitt.Click + Call Bereinigen + Vereinigung.Click + Call Bereinigen + Differenz.Click + Call Bereinigen + Quotientenmenge.Click + Call Bereinigen + Teilmenge.Click + Call Bereinigen + TeilmengeOderGleich.Click + Call Bereinigen + Obermenge.Click + Call Bereinigen + ObermengeOderGleich.Click + Call Bereinigen + NichtTeilmenge.Click + Call Bereinigen + NichtTeilmengeOderGleich.Click + Call Bereinigen + NichtObermenge.Click + Call Bereinigen + NichtObermengeOderGleich.Click + Call Bereinigen + Aleph.Click + Call Bereinigen + LeereMenge.Click + Call Bereinigen + MengeDerGanzenZahlen.Click + Call Bereinigen + MengeDerKomplexenZahlen.Click + Call Bereinigen + MengeDerNatuerlichenZahlen.Click + Call Bereinigen + MengeDerRationalenZahlen.Click + Call Bereinigen + MengeDerReellenZahlen.Click + +catch + warnlog "failed!" +endcatch + + Call hCloseDocument +endcase +'----------------------------------------------------------- +testcase tAllFunctions + PrintLog "- OperatorWindow AllFunctions" + Call hNewDocument + + Kontext "AuswahlMath" + If AuswahlMath.notexists(2) then AuswahlMath + Funktionen.Click + Sleep 1 + Call DialogTest2 ( AuswahlMath, 4 ) + +try + Absolutwert.Click + Call Bereinigen + Fakultaet.Click + Call Bereinigen + Quadratwurzel.Click + Call Bereinigen + NteWurzel.Click + Call Bereinigen + NatuerlicheExponentialfunktion.Click + Call Bereinigen + NatuerlicherLogarithmus.Click + Call Bereinigen + Exponentialfunktion.Click + Call Bereinigen + Logarithmus.Click + Call Bereinigen + Sinus.Click + Call Bereinigen + Cosinus.Click + Call Bereinigen + Tangens.Click + Call Bereinigen + Cotangens.Click + Call Bereinigen + Hyperbelsinus.Click + Call Bereinigen + Hyperbelcosinus.Click + Call Bereinigen + Hyperbeltangens.Click + Call Bereinigen + Hyperbelcotangens.Click + Call Bereinigen + Arcussinus.Click + Call Bereinigen + Arcuscosinus.Click + Call Bereinigen + Arcustangens.Click + Call Bereinigen + Arcuscotangens.Click + Call Bereinigen + Areahyperbelsinus.Click + Call Bereinigen + Areahyperbelcosinus.Click + Call Bereinigen + Areahyperbeltangens.Click + Call Bereinigen + Areahyperbelcotangens.Click + Call Bereinigen + SuperscriptRechts.Click + +catch + warnlog "failed!" +endcatch + + Call hCloseDocument +endcase +'----------------------------------------------------------- +testcase tAllOperators + PrintLog "- Auwahlfenster : Operators" + Call hNewDocument + + Kontext "AuswahlMath" + If AuswahlMath.notexists(2) then AuswahlMath + Operatoren.Click + Sleep 1 + Call DialogTest2 ( AuswahlMath, 5 ) + +try + Limes.Click + Call Bereinigen + Summe.Click + Call Bereinigen + Produkt.Click + Call Bereinigen + Coprodukt.Click + Call Bereinigen + Integral.Click + Call Bereinigen + DoppeltesIntegral.Click + Call Bereinigen + DreifachesIntegral.Click + Call Bereinigen + 'EsExistiertEin.Click + ' Call Bereinigen + Kurvenintegral.Click + Call Bereinigen + DoppeltesKurvenintegral.Click + Call Bereinigen + DreifachesKurvenintegral.Click + Call Bereinigen + 'FuerAlle.Click + ' Call Bereinigen + UntereUndObereGrenze.Click + Call Bereinigen + UntereGrenze.Click + Call Bereinigen + ObereGrenze.Click + +catch + warnlog "failed!" +endcatch + + Call hCloseDocument +endcase + +'----------------------------------------------------------- +testcase tAllAttributes + PrintLog "- SelectionWindow : All Attributes" + Call hNewDocument + + Kontext "AuswahlMath" + If AuswahlMath.notexists(2) then AuswahlMath + Attribute.Click + Sleep 1 + Call DialogTest2 ( AuswahlMath, 6 ) + +try + AccentNachRechts.Click + Call Bereinigen + AccentNachLinks.Click + Call Bereinigen + UmgekehrtesDach.Click + Call Bereinigen + Breve.Click + Call Bereinigen + Ueberstrich.Click + Call Bereinigen + Vektorpfeil.Click + Call Bereinigen + Dach.Click + Call Bereinigen + Tilde.Click + Call Bereinigen + Kreis.Click + Call Bereinigen + Punkt.Click + Call Bereinigen + DoppelterPunkt.Click + Call Bereinigen + DreifacherPunkt.Click + Call Bereinigen + LinieUeber.Click + Call Bereinigen + LinieUnter.Click + Call Bereinigen + LinieDurch.Click + Call Bereinigen + Transparent.Click + Call Bereinigen + Fettschrift.Click + Call Bereinigen + KursiveSchrift.Click + Call Bereinigen + GroesseAendern.Click + Call Bereinigen + FontAendern.Click + Call Bereinigen + BreiterVektorpfeil.Click + Call Bereinigen + BreitesDach.Click + Call Bereinigen + BreiteTilde.Click + +catch + warnlog "failed!" +endcatch + + Call hCloseDocument +endcase + +'----------------------------------------------------------- +testcase tAllBrackets + PrintLog "- SelectionWindow : All Bracketings" + Call hNewDocument + + Kontext "AuswahlMath" + If AuswahlMath.notexists(2) then AuswahlMath + Klammerungen.Click + Sleep 1 + Call DialogTest2 ( AuswahlMath, 7 ) + +try + RundeKlammern.Click + Call Bereinigen + EckigeKlammern.Click + Call Bereinigen + SpitzeKlammern.Click + Call Bereinigen + GeschweifteKlammern.Click + Call Bereinigen + EinfacheLinien.Click + Call Bereinigen + DoppelteLinien.Click + Call Bereinigen + GruppierungsKlammern.Click + Call Bereinigen + RundeKlammernSkalierbar.Click + Call Bereinigen + EckigeKlammernSkalierbar.Click + Call Bereinigen + SpitzeKlammernSkalierbar.Click + Call Bereinigen + GeschweifteKlammernSkalierbar.Click + Call Bereinigen + EinfacheLinienSkalierbar.Click + Call Bereinigen + DoppelteLinienSkalierbar.Click + Call Bereinigen + DoppelteEckigeKlammern.Click + Call Bereinigen + EckigeKlammernSkalierbar2.Click + Call Bereinigen + GeschweifteKlammerObenSkalierbar.Click + Call Bereinigen + GeschweifteKlammerUntenSkalierbar.Click + Call Bereinigen + OperatorKlammern.Click + Call Bereinigen + OperatorKlammernSkalierbar.Click + +catch + warnlog "failed!" +endcatch + + Call hCloseDocument +endcase + +'----------------------------------------------------------- +testcase tAllFormats + dim i as integer + + PrintLog "- SelectionWindow : All Formattings" + Call hNewDocument + + Kontext "AuswahlMath" + If AuswahlMath.notexists(2) then AuswahlMath + Formatierungen.Click + Sleep 1 + Call DialogTest2 ( AuswahlMath, 8 ) + + i = 0 +try + NeueZeileBeginnen.Click + inc i + Printlog " i: "+i + Call Bereinigen + KleinerZwischenraum.Click + inc i + Printlog " i: "+i + Call Bereinigen + Zwischenraum.Click + inc i + Printlog " i: "+i + Call Bereinigen + SubscriptRechts.Click + inc i + Printlog " i: "+i + Call Bereinigen + VertikaleAnordnung2Elemente.Click + inc i + Printlog " i: "+i + Call Bereinigen + VertikaleAnordnung.Click + inc i + Printlog " i: "+i + Call Bereinigen + MatrixAnordnung.Click + inc i + Printlog " i: "+i + Call Bereinigen + SuperscriptRechts.Click + inc i + Printlog " i: "+i + Call Bereinigen + LinksbuendigAusrichten.Click + inc i + Printlog " i: "+i + Call Bereinigen + ZentriertHorizontalAusrichten.Click + inc i + Printlog " i: "+i + Call Bereinigen + RechtsbuendigAusrichten.Click + inc i + Printlog " i: "+i + Call Bereinigen + SubscriptLinks.Click + inc i + Printlog " i: "+i + Call Bereinigen + 'NachObenAusrichten.Click + ' Call Bereinigen + 'ZentriertVertikalAusrichten.Click + ' Call Bereinigen +' NachUntenAusrichten.Click + ' Call Bereinigen + SuperscriptLinks.Click + inc i + Printlog " i: "+i + Call Bereinigen + SuperscriptOben.Click + inc i + Printlog " i: "+i + Call Bereinigen + SuperscriptRechts.Click + inc i + Printlog " i: "+i + Call Bereinigen + SubscriptUnten.Click +catch + warnlog "failed!" +endcatch + + Call hCloseDocument +endcase + +testcase tOthers + dim i as integer + + PrintLog "- SelectionWindow : Others" + Call hNewDocument + + Kontext "SelectionMath" + If SelectionMath.notexists(2) then + ViewSelection + endif + Others.Click + Sleep 1 + Kontext "AuswahlMath" + Call DialogTest2 ( AuswahlMath, 9 ) + Kontext "SelectionMath" + + i = 0 +try +' there might be a problem with the new group .... :TB_Gruppen Sonstiges +' Nope, its the same as Formatierungen... + + ThereExists.Click + inc i + Printlog " i: "+i + Call Bereinigen + ForAll.Click + inc i + Printlog " i: "+i + Call Bereinigen + HBar.Click + inc i + Printlog " i: "+i + Call Bereinigen + Kontext "AuswahlMath" + Imaginaerteil.Click + inc i + Printlog " i: "+i + Call Bereinigen + LambdaQuer.Click + inc i + Printlog " i: "+i + Call Bereinigen + Nabla.Click + inc i + Printlog " i: "+i + Call Bereinigen + Partial.Click + inc i + Printlog " i: "+i + Call Bereinigen + PfeilNachLinks.Click + inc i + Printlog " i: "+i + Call Bereinigen + PfeilNachOben.Click + inc i + Printlog " i: "+i + Call Bereinigen + PfeilNachRechts.Click + inc i + Printlog " i: "+i + Call Bereinigen + PfeilNachUnten.Click + inc i + Printlog " i: "+i + Call Bereinigen + PunkteMittig.Click + inc i + Printlog " i: "+i + Call Bereinigen + PunkteNachOben.Click + inc i + Printlog " i: "+i + Call Bereinigen + PunkteUnten.Click + inc i + Printlog " i: "+i + Call Bereinigen + PunkteVertikal.Click + inc i + Printlog " i: "+i + Call Bereinigen + Realteil.Click + inc i + Printlog " i: "+i + Call Bereinigen + Unendlich.Click + inc i + Printlog " i: "+i + Call Bereinigen + WeierstrassP.Click + inc i + Printlog " i: "+i + Call Bereinigen + PunkteNachUnten.Click + inc i + Printlog " i: "+i +catch + warnlog "failed!" +endcatch + + Call hCloseDocument +endcase + +sub Bereinigen + sleep 2 +' ViewUpdate +' Sleep 2 +' EditSelectAllMath +' Wait 500 +' EditCut + Sleep 1 +end sub + diff --git a/testautomation/math/required/includes/m_020_.inc b/testautomation/math/required/includes/m_020_.inc new file mode 100755 index 000000000..12aaa17db --- /dev/null +++ b/testautomation/math/required/includes/m_020_.inc @@ -0,0 +1,78 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: m_020_.inc,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 11:51:23 $ +'* +'* 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 +'* +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* Owner : thorsten.bosbach@sun.com +'* +'* short description : +'* +'\***************************************************************** + +sub m_020_ + printlog Chr(13)+ "-- Toolbar m_020_ --" + call tMainToolbar +end sub + +testcase tMainToolbar + '/// open application ///' + Call hNewDocument + '/// type something into document ///' + hTBOtypeInDoc + kontext "Toolbar" + '/// click buttons on Main Toolbar ///' + '/// click 'Zoom in' ///' + Vergroessern.Click + '/// click 'Zoom out' ///' + Verkleinern.Click + '/// click 'Zoom 100%' ///' + ZoomHundertProzent.Click + '/// click 'Zoom inEntire Formula' ///' + GanzeFormel.Click + '/// click 'Refresh' ///' + FormelAktualisieren.Click + '/// click 'Formula Cursor' ///' + FormulaCursor.Click + '/// click 'Symbols' ///' + FormelSymbole.Click + kontext "SymboleMath" + if (SymboleMath.exists <> TRUE) then + warnlog "Symbols Dialog didn't came up :-(" + else + '/// close dialog 'Symbols' ///' + SymboleMath.close + endif + kontext "Toolbar" + '/// click 'Formula Cursor' ///' + FormulaCursor.Click + '/// close application ///' + Call hCloseDocument +endcase diff --git a/testautomation/math/required/input/ShortLicense.oxt b/testautomation/math/required/input/ShortLicense.oxt new file mode 100755 index 000000000..7e1998843 Binary files /dev/null and b/testautomation/math/required/input/ShortLicense.oxt differ diff --git a/testautomation/math/required/input/test.odt b/testautomation/math/required/input/test.odt new file mode 100644 index 000000000..6136112b3 Binary files /dev/null and b/testautomation/math/required/input/test.odt differ diff --git a/testautomation/math/required/input/unknown-dependency.oxt b/testautomation/math/required/input/unknown-dependency.oxt new file mode 100755 index 000000000..7c2a22c6d Binary files /dev/null and b/testautomation/math/required/input/unknown-dependency.oxt differ diff --git a/testautomation/math/required/m_updt.bas b/testautomation/math/required/m_updt.bas new file mode 100755 index 000000000..f40648e83 --- /dev/null +++ b/testautomation/math/required/m_updt.bas @@ -0,0 +1,81 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: m_updt.bas,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-16 11:51:23 $ +'* +'* 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 +'* +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* Owner : thorsten.bosbach@sun.com +'* +'* short description : Math Update Test +'* +'\***************************************************************** + +sub main + use "math\required\includes\m_001_.inc" + use "math\required\includes\m_002_.inc" + use "math\required\includes\m_003_.inc" + use "math\required\includes\m_004_.inc" + use "math\required\includes\m_005_.inc" + use "math\required\includes\m_006_.inc" + use "math\required\includes\m_007_.inc" ' help + use "math\required\includes\m_010_.inc" + use "math\required\includes\m_020_.inc" ' toolbars + + Call hStatusIn ( "Math","m_updt.bas" ) + + PrintLog Chr(13) + " Math_Update Test " + +'/// Duration ca. 30 minutes ///' + Call M_002_ ' EditMenu + Call M_003_ ' View-Menu + Call M_004_ ' Format-Menu + Call M_005_ ' Tools Menu + Call M_006_ ' Window-Menu + Call M_007_ ' Help-Menu + Call tHelpCheckForUpdates + Call m_020_ ' toolbars + Call M_010_ ' Operators + Call M_001_ ' File Menu + Call tFileExportAsPDF + + Call hStatusOut +end sub + +'---------------------------------------------- +sub LoadIncludeFiles + use "global\system\includes\master.inc" + use "global\system\includes\gvariabl.inc" + use "global\required\includes\g_option.inc" + use "global\required\includes\g_customize.inc" + use "global\required\includes\g_001.inc" + use "global\required\includes\g_009.inc" + gApplication = "MATH" + Call GetUseFiles +end sub -- cgit v1.2.3