1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: id_001.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 10:42:41 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* Owner : wolfram.garten@sun.com
36 '* short description :
38 '***********************************************************************************
40 ' #1 tiFileReload (sFileIn as string)
41 ' #1 tiFileVersion (sFileIn as string)
45 ' #1 tmFileNewFromTemplate
52 ' #1 tmFilePrinterSetting
53 '\**********************************************************************************
58 dim sFileName as string ' test document & new created doc
59 ' dim sFormula as string ' container for formula to create document with
61 dim sFilter (50) as string
65 dim Exlist(100) as string ' files to be deleted
66 dim sFile as string ' filename to export
67 dim sPath as string ' filename to export
69 if (gApplication = "IMPRESS") then
70 ExtensionString = "odp"
72 ExtensionString = "odg"
75 sFilter (0) = 0 ' initalize ;-)...
77 sFileName = "graphics\required\input\tbo_alf_." + ExtensionString ' this is the file with all features
78 sFile = "isas_" ' this is the filename of the export files
79 sPath = ConvertPath ( gOfficePath + "user/work/graphics/required/"+gApplication+"\"+ gPlatform) ' this is the export path
80 if dir (sPath) = "" then
84 if gSamePC = TRUE then ' delete export directory
85 GetFileList ( sPath, sFile+"*", Exlist() )
86 if KillFileList ( Exlist() ) <> TRUE then
87 Warnlog "Couldn't delete all Files in Output-Export-Directory, the followings are still there:"
88 for i=1 to ListCount ( Exlist() )
89 printlog " <> " + Exlist(i)
94 Call hFileOpen ( ConvertPath(gTesttoolPath + sFileName) )
98 ' to use the helper fileSaveAs functions i get alll available filters...
101 Kontext "SpeichernDlg"
103 if i=0 then x = Dateityp.GetItemCount
104 if (i) then ' set border, whenm start from beginning/end
105 y = i ' set filter from beginning
107 y = x-3 ' set filter from end
109 ListAppend(sFilter(), Dateityp.GetItemText (y))
112 y = ListCount(sFilter())
114 if gtSYSName = "Linux" then y=y-1
115 '#i45961# - last part of filter-list deactivated due to BUG - FHA
116 'TODO: JSI->FHA please verify if this special handling needed after the issue has been fixed.
119 sFileName = sPath + sFile + (i)
120 hFileSaveAsWithFilter (sFileName, sFilter(i), TRUE )
122 if messagebox.exists then
123 messagebox.Yes ' to go on ....
125 printlog " saved with filter ("+i+"/"+y+"): "+ sFilter(i)
127 ' TODO TBO: small check, if correct filter was used!
132 if Messagebox.exists then
133 printlog "Messagebox about informationloss... :-) that's OK: 'Text in the messagebox: "+Messagebox.GetText+"'"
137 '-----------------------------------------------------------------
143 GetFileList ( sFileName, sFile + "*", sFilter() )
146 x = ListCount ( sFilter() )
148 printlog "("+i+"/"+x+"): "+sFilter(i)
149 hFileOpen ( sFilter(i) )
151 If hIsNamedDocLoaded (sFilter(i), true) Then
152 printlog " used filter: " + hGetUsedFilter()
154 sTemp = left(right(sFilter(i),2),1)
155 if ( (sTemp = "t") OR (sTemp = "o") ) then
156 printlog "document is --- TEMPLATE?! --- "
158 qaErrorlog "#116563# document didn't get loaded "
164 ' Call hCloseDocument
167 testcase tiFileReload
171 if (gApplication = "IMPRESS") then
172 ExtensionString = "odp"
174 ExtensionString = "odg"
177 Datei$= (ConvertPath (gOfficePath + "user/work/graphics/required/version1." + ExtensionString))
179 if app.dir(ConvertPath (gOfficePath + "user/work/graphics/required/")) = "" then
180 app.mkdir (ConvertPath (gOfficePath + "user/work/graphics/required/"))
184 Call hFileSaveAsKill (Datei$)
188 Call hFileOpen (Datei$)
207 if Dir (Datei$) <> "" AND gSamePC = TRUE then kill Datei$
210 testcase tiFileVersion
214 if (gApplication = "IMPRESS") then
215 ExtensionString = "odp"
217 ExtensionString = "odg"
220 Datei$= (ConvertPath (gOfficePath + "user/work/graphics/required/erwin." + ExtensionString))
221 'if dir (ConvertPath (gOfficePath + "user/work/graphics/required/")) = "" then
222 if dir (Datei$) = "" then app.mkdir (ConvertPath (gOfficePath + "user/work/graphics/required/"))
225 Call hFileSaveAsKill (Datei$)
229 Call hFileOpen (Datei$)
236 Warnlog "- File / Versions not accessible!"
241 Call DialogTest ( Versionen )
243 Kontext "VersionskommentarEingeben"
244 Call DialogTest ( VersionskommentarEingeben )
245 VersionskommentarEingeben.Cancel
249 ' if Dir (Datei$) <> "" AND gSamePC = TRUE then kill Datei$
252 testcase tiFilePassword
256 dim sFileName as string ' test document & new created doc
257 ' dim sFormula as string ' container for formula to create document with
260 dim sFilter (50) as string
264 dim Exlist(100) as string ' files to be deleted
265 dim sFileIn as string ' filename to import
266 dim sFile as string ' filename to export
267 dim sPath as string ' and path to export
269 if (gApplication = "IMPRESS") then
270 ExtensionString = "odp"
272 ExtensionString = "odg"
275 sFile = "isp__" ' this is the filename of the export files
276 sPath = ConvertPath ( gOfficePath + "user/work/graphics/required/"+gApplication+"\"+ gPlatform+"\") ' this is the export path
278 if dir (sPath) = "" then app.mkdir (sPath)
279 sFileIn = (sPath + sFile + "." + ExtensionString)
280 if gSamePC = TRUE then ' delete export directory
281 GetFileList ( sPath, sFile+"*", Exlist() )
282 if KillFileList ( Exlist() ) <> TRUE then
283 Warnlog "Couldnt delete all Files in Output-Export-Directory, the followings are still there:"
284 for i=1 to ListCount ( Exlist() )
285 printlog " <> " + Exlist(i)
293 Kontext "SpeichernDlg"
294 Datei$ = ConvertPath ( sFileIn )
295 printlog " will use the file: "+Datei$
296 if Dir (Datei$) <> "" then
300 Dateiname.SetText Datei$
304 PasswortName.SetText "12345"
305 PasswortBestaetigen.Settext "54321"
309 if Messagebox.Exists(1) then
312 Warnlog "- Wrong password not recognized"
315 PasswortName.SetText "12345"
316 PasswortBestaetigen.SetText "12345"
325 Dateiname.SetText Datei$
328 Kontext "PasswordFileOpen"
329 PasswortName.SetText "34567"
333 Printlog "- Wrong password not accepted"
336 if Not Messagebox.Exists(1) then
337 Warnlog "Wrong password while loading not recognized"
340 printlog "Wrong password on loading ok - recogniced"
343 Kontext "PasswordFileOpen"
344 PasswortName.SetText "12345"
348 Kontext "SpeichernDlg"
349 Dateiname.SetText Datei$
350 if (Passwort.IsChecked <> TRUE) then
351 Warnlog "Password has to be checked! :-("
356 if Messagebox.Exists(5) then
360 if (Passwort.Exists(5) = FALSE)then
361 Warnlog "- Password dialog Didn't pop up after pressing save"
365 PasswortName.SetText "a12345"
366 PasswortBestaetigen.SetText "a12345"
375 Dateiname.SetText Datei$
377 Kontext "PasswordFileOpen"
379 PasswortName.SetText "a12345"
383 Kontext "SpeichernDlg"
384 Dateiname.SetText Datei$
385 if (Passwort.IsChecked <> TRUE) then
386 Warnlog "Password has to be checked! :-("
391 if Messagebox.Exists(5) then Messagebox.Yes
393 if (Passwort.Exists(5))then
394 Warnlog "- Password dialog didn't pop up after pressing save"
403 testcase tiFileTemplates
406 FileTemplatesOrganize
407 Kontext "DVVerwalten"
409 Call DialogTest (DVVerwalten)
411 PopuplisteLinks.Select 2
413 PopuplisteRechts.Select 2
418 Call DialogTest (OeffnenDlg)
422 Kontext "DVVerwalten"
425 if gtSYSName = "Solaris x86" then
426 qaErrorLog "#i62423# - FileTemplatesAddressBookSource outcommented under x86. - FHA"
428 FileTemplatesAddressBookSource
429 Printlog "- AddressBookAssignment"
430 kontext "AddressBookSource"
431 Call DialogTest (AddressBookSource)
433 kontext "AddressSourceAutopilot"
434 AddressSourceAutopilot.Cancel
435 kontext "AddressBookSource"
436 AddressBookSource.Cancel
440 Printlog "- Save template"
442 Kontext "Dokumentvorlagen"
444 Call DialogTest (Dokumentvorlagen)
448 Kontext "DVVerwalten"
449 Call DialogTest (DVVerwalten)
453 Kontext "Dokumentvorlagen"
455 Dokumentvorlagen.Cancel
460 Printlog "- Edit template"
464 Call DialogTest (OeffnenDlg)
468 Warnlog "- There are problems with File-Template-Save"
479 if active.exists(5) then
481 qaerrorlog "There is no printer available - please install one on your system!"
485 Call DialogTest (DruckenDlg)
489 Kontext "DruckerZusaetzeDraw"
490 Call DialogTest (DruckerZusaetzeDraw)
491 DruckerZusaetzeDraw.Cancel
499 '-----------------------------------------------------------
500 '******************* M A T H dito *************************
501 '-----------------------------------------------------------
504 testcase tmFileNewFromTemplate
508 Kontext "TemplateAndDocuments"
509 if TemplateAndDocuments.NotExists then
510 Warnlog "Dialog Templates and Documents are not up!"
513 Call DialogTest (TemplateAndDocuments)
516 TemplateAndDocuments.Cancel
527 UebergeordneterOrdner.Click
530 Call DialogTest ( OeffnenDlg )
537 printlog "- File Close"
538 hNewDocument ' just for the records: I open ONE document
542 Kontext ' Expecting "Modified, do you want to close?"
543 if active.exists (5) then
544 printlog " Ok, active came up: " + active.gettext
545 Active.Cancel ' No, not this time
547 warnlog "active missing (1)"
553 Active.Yes ' but now - records: this document is closed
556 Kontext "SpeichernDlg"
557 Call DialogTest ( SpeichernDlg )
561 FileClose ' now the office gets closed! (if there were no modifications!)
566 '-----------------------------------------------------------
573 Kontext "SpeichernDlg"
574 UebergeordneterOrdner.click
576 Call DialogTest (SpeichernDlg)
577 Kontext "SpeichernDlg"
584 testcase tmFileSaveAs
592 Kontext "SpeichernDlg"
593 if (SpeichernDlg.exists (5) = FALSE) then
594 warnlog "FileSaveAs dialog is not visible"
599 UebergeordneterOrdner.click
603 kontext "NeuerOrdner"
605 Kontext "SpeichernDlg"
607 Call DialogTest (SpeichernDlg)
609 Kontext "SpeichernDlg"
615 testcase tmFileSaveAll
616 printlog "- File SaveAll"
621 Printlog " open 2. window"
625 Printlog " call save all"
627 Printlog " cancel 1. save"
628 Kontext "SpeichernDlg"
631 Printlog " cancel 2. save"
633 Kontext "SpeichernDlg"
638 Kontext "SpeichernDlg"
640 printlog "smth had been typed in the starting window (just a hint ;-) )"
642 printlog "--------- no other window wants to get saved. :-)"
646 Printlog " hCloseDocument both"
649 Printlog " first closed"
652 Printlog " second closed"
656 testcase tmFileProperties
657 printlog "- File Properties"
663 active.SetPage TabDokument
664 Kontext "TabDokument"
665 Call DialogTest ( TabDokument )
668 active.SetPage TabDokumentInfo
669 Kontext "TabDokumentInfo"
670 Call DialogTest ( TabDokumentInfo )
672 'Deactivating this part because of #i95523#:
674 'active.SetPage TabBenutzer
675 'Kontext "TabBenutzer"
676 'Call DialogTest ( TabBenutzer )
678 ' Kontext "InfonamenBearbeiten"
679 ' Call DialogTest (InfonamenBearbeiten)
680 'InfonamenBearbeiten.Cancel
683 active.SetPage TabInternet
684 Kontext "TabInternet"
685 Call DialogTest (TabInternet)
691 testcase tmFilePrinterSetting
692 printlog "- File Printersettings"
697 if active.exists(5) then
699 qaerrorlog "There is no printer available - please install one on your system!"
702 Kontext "DruckerEinrichten"
703 Call DialogTest (DruckerEinrichten)
705 DruckerEinrichten.Cancel
710 testcase tdFileExport
716 Kontext "ExportierenDlg"
717 Call DialogTest ( ExportierenDlg )
718 UebergeordneterOrdner.Click
719 Kontext "SpeichernDlg"
720 x=Dateityp.getitemcount
721 if x <> 18 then warnlog "the number of filters is not 18, it is: " + x
730 printlog "- File Close"
734 FileExit "SynchronMode", TRUE
739 if MessageBox.Exists(1) then ' this is the messagebox from the first window!
740 Printlog MessageBox.GetText
748 if MessageBox.Exists(1) then
749 Warnlog "MsgBox popped up and there were no changes in the document"
750 Printlog MessageBox.GetText
758 printlog "this exit is wanted :-)"
762 call hStartTheOffice ' from master.inc
764 printlog "catch AGAIN"
766 Kontext "SD_Praesentation"
767 if SD_Praesentation.exists (2) then
768 ViewToolbarsPresentation