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: m_001_.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 11:51:23 $
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 : thorsten.bosbach@sun.com
36 '* short description :
38 '\*****************************************************************
40 global cActFilter as string ' used filter for save
41 Const cActFilterExt = ".odf" ' used filter for save (extension)
43 ' "StarMath 5.0" ".smf"
44 ' Datei$ = convertpath( gOfficePath + "user\work\killme" + cActFilterExt)
45 ' Datei$ = convertpath( gOfficePath + "user\work\Erwin2"+cActFilterExt)
46 ' Datei = convertpath(gofficepath + "user\work\test"+cActFilterExt)
49 Printlog Chr(13) + "-- File Menu m_001_ --"
51 cActFilter = gMathFilter
55 ' Call Autopilot 'in Inc\desktop\autopilo.inc
65 Call tmFilePrinterSetting
70 '/// open application ///'
72 '/// File->New->Templates and Documents ///'
75 Kontext "TemplateAndDocuments"
76 if TemplateAndDocuments.exists (5) then
78 '/// klick button 'Organize' ///'
81 if DVVerwalten.exists (5) then
82 Call DialogTest (DVVerwalten)
84 '/// close dialog 'Template Management' ///'
87 warnlog "DVVerwalten didn't exist :-("
90 warnlog "error ;-) - 1"
93 warnlog "templates and dokuments didn't exist :-("
97 kontext "TemplateAndDocuments"
99 Call DialogTest ( TemplateAndDocuments )
101 warnlog "no dialogtest possibele :-("
104 ' TBO i don't get in deep here, because it is not math specific
105 ' and IMHO it doesn't make that sense here!
106 ' should be enoug in writer...
107 '/// close dialog 'Templates and Documents' ///'
108 TemplateAndDocuments.Cancel
109 '/// close application ///'
113 testcase tmFilePassword
116 '/// open application ///'
117 while (getDocumentCount > 0)
121 '/// type a formula ///'
122 SchreibenInMathdok "a over b"
124 printlog "'/// - save doc as "+cActFilter+" with passwd - ///'"
126 Kontext "SpeichernDlg"
127 Datei$ = convertpath( gOfficePath + "user\work\killme" + cActFilterExt)
128 if Dir (Datei$) <> "" then kill Datei$
129 printlog " Testfile: "+Datei$
130 'Dateityp.Select (cActFilter)
132 Dateiname.SetText Datei$
135 if Active.Exists (5) then
136 ' TBO: ??? what will be ??!
137 Printlog "(1/5) " + Active.GetText
141 printlog "'/// Try wrong passwd confirmation ///'"
143 Kontext "PasswordFileSave"
146 Password.SetText "12345"
147 PasswordConfirm.Settext "54321"
151 warnlog "had to ask for passwd!!!!"
154 if (Active.Exists (5) = FALSE ) then
155 Warnlog "Wrong passwordinput not detected"
157 Printlog "(2/5) " + Active.GetText
161 printlog "'/// Now do it right ///'"
162 Kontext "PasswordFileSave"
164 Password.SetText "12345"
165 PasswordConfirm.Settext "12345"
168 warnlog "had to ask for passwd!!!!"
172 printlog "'/// Gotcha & Close file/window ///'"
176 printlog "'/// load again with wrong passwd ///'"
177 Call hFileOpen Datei$
179 Kontext "PasswordFileOpen"
181 Passwortname.SetText "34567"
184 warnlog "had to ask for passwd!!!!"
187 if Active.Exists(5) then
188 Printlog "(3/5) " + Active.GetText
191 Warnlog "Wrong passwordinput not detected by loading the document"
194 printlog "'///load now with right passwd ///'"
196 'Call hDateiOeffnen Datei$
197 Kontext "PasswordFileOpen"
199 Passwortname.SetText "12345"
202 warnlog "had to ask for passwd!!!!"
206 printlog "'/// - save doc with new name under 6.... (has to be automagical selected by loading this doc!) w/o passwd - ///'"
207 Datei$ = convertpath( gOfficePath + "user\work\Erwin2"+cActFilterExt)
208 if Dir (Datei$) <> "" then kill Datei$
210 Kontext "SpeichernDlg"
211 Dateiname.SetText Datei$
212 if (Passwort.IsChecked <> TRUE) then
213 Warnlog "#i36015# Password has to be checked! :-("
215 printlog "will be forced checked no!"
219 '/// (if messagebox comes up, say YES) ///'
220 if Messagebox.Exists(2) then
223 '/// password dialog has to show up! ///'
224 Kontext "PasswordFileSave"
225 if (PasswordFileSave.Exists(5) = FALSE)then
226 Warnlog "- Password dialog Didn't popped up after pressing save"
228 Kontext "PasswordFileSave"
229 '/// type password "a12345", confirm password: "a12345" -> RIGHT ///'
230 Password.SetText "a12345"
231 PasswordConfirm.SetText "a12345"
234 '/// close document ///'
238 '/// open document ///'
242 Dateiname.SetText Datei$
244 Kontext "PasswordFileOpen"
246 '/// type password: "a12345" -> RIGHT ///'
247 PasswortName.SetText "a12345"
250 '/// File->SaveAs ///'
252 Kontext "SpeichernDlg"
253 Dateiname.SetText Datei$
254 if (Passwort.IsChecked <> TRUE) then
255 Warnlog "#i36015# Password has to be checked! :-("
257 printlog "will be forced checked no!"
260 '/// press 'save', without changing any checkbox! -> file has to be saved WITH password protection ///'
263 '/// (if messagebox comes up, say YES) ///'
264 if Messagebox.Exists(2) then Messagebox.Yes
265 '/// password dialog needn't to show up! ///'
266 Kontext "PasswordFileSave"
267 if (PasswordFileSave.Exists(5))then
268 Warnlog "- Password dialog neeedn't popped up after pressing save"
269 Kontext "PasswordFileSave"
270 passwordFileSave.cancel
271 '/// close document ///'
274 '/// close document ///'
279 testcase tmFileReload
281 dim sFilterName as string
282 dim sFilter as string
283 dim sFilterExt() as string
285 Datei = convertpath(gofficepath + "user\work\test"+cActFilterExt)
286 if Dir (Datei) <> "" then kill (Datei)
288 ' make sure saving in latest math filter works, checking global filtername and if necessary change it
289 sFilter = hGetUIFiltername("math8")
291 '/// open application ///'
293 '/// type a formula ///'
295 '/// File->Save As ///'
297 Kontext "SpeichernDlg"
298 '/// select the actual default file format ///'
299 Dateityp.Select (hFindFilterPosition( sFilter ))
300 '/// type a file name ///'
301 Dateiname.SetText Datei
302 '/// click button 'save' ///'
305 if Active.Exists(2) then Active.Yes
307 '/// File->Close ///'
310 if MessageBox.Exists (1) then
311 WarnLog "After Saving and Closing the following MessageBox appears: " + MessageBox.GetText
315 '/// open just saved file ///'
317 '/// type a formula ///'
320 '/// File->Reload ///'
324 if Active.Exists (1) then
325 PrintLog "Say no to: " + Active.GetText
326 '/// say NO to active ///'
329 WarnLog "Missing smth to say no to! "
333 '/// File->Reload ///'
336 if Active.Exists (1) then
337 PrintLog "Said yes to: " + Active.GetText
338 '/// say YES to active ///'
341 '/// close application ///'
345 testcase tmFileVersions
348 Datei = ConvertPath (gOfficePath & "user/work/test"+cActFilterExt)
349 if app.Dir (Datei) <> "" then app.kill (Datei)
351 '/// open application ///'
354 '/// type a formula ///'
355 SchreibenInMathdok "a over b"
357 Call hFileSaveAs(Datei)
360 '/// File->Versions ///'
363 Warnlog "- File / Versions not accessible!"
368 Call DialogTest ( Versionen )
369 '/// click button 'Save New Version' ///'
371 Kontext "VersionskommentarEingeben"
372 Call DialogTest ( VersionskommentarEingeben )
373 '/// cancel dialog 'Insert Version Comment' ///'
374 VersionskommentarEingeben.Cancel
376 '/// close dialog 'Version of ...' ///'
378 '/// close application ///'
380 if app.Dir (Datei) <> "" then app.kill Datei
384 '/// open application ///'
387 '/// File->Print ///'
390 if active.exists(2) then
392 qaerrorlog "There is no printer available - please install one on your system!"
396 Call DialogTest (DruckenDlg)
397 '/// cancel dialog 'Print' ///'
400 '/// close application ///'
404 '-----------------------------------------------------------
405 '******************* I D dito *************************
406 '-----------------------------------------------------------
409 '/// open application ///'
414 '/// klick button 'Up one level' ///'
415 UebergeordneterOrdner.Click
416 '/// klick button 'Default Directory' ///'
418 '/// check checkbox 'Read Only' ///'
420 Call DialogTest ( OeffnenDlg )
421 '/// cancel dialog 'Open' ///'
424 '/// close application ///'
429 '/// open application ///'
430 hNewDocument ' just for the records: i open ONE document
431 '/// type a formula ///'
434 '/// File->Close ///'
436 Kontext ' expecting 'modified, do you want to close?'
437 if active.exists (5) then
438 printlog " ok, active came up: " + active.gettext
439 '/// say NO to active about 'modified stuff :-)' ///'
440 Active.Cancel ' no, not this time
442 warnlog "active missing (1)"
445 '/// File->Close ///'
448 '/// say YES to active about 'modified stuff :-)' ///'
449 Active.Yes ' but now - records: this document is closed
451 Kontext "SpeichernDlg"
452 Call DialogTest ( SpeichernDlg )
453 '/// cancel dialog 'Save As' ///'
457 '/// File->Close ///'
458 FileClose ' now the office gets closed! (if there were no modifications!)
460 if active.exists (5) then Active.No
465 '/// open application ///'
467 '/// type a formula ///'
472 Kontext "SpeichernDlg"
473 UebergeordneterOrdner.click
476 ' DateiAuswahl.TypeKeys "Hallo<Return>"
478 ' Kontext "Messagebox"
480 Call DialogTest (SpeichernDlg)
481 '/// cancel dialog 'Save' ///'
484 '/// close application ///'
488 testcase tmFileSaveAs
489 '/// open application ///'
492 '/// type a formula ///'
494 '/// File->Save As ///'
497 Kontext "SpeichernDlg"
498 if (SpeichernDlg.exists (5) = FALSE) then
502 '/// check ceckbox 'save with Password' ///'
504 '/// UNcheck ceckbox 'save with Password' ///'
506 '/// click button 'up one level' ///'
507 UebergeordneterOrdner.click
508 '/// click button 'default directory' ///'
510 '/// click button 'create new directory' ///'
512 kontext "NeuerOrdner"
513 '/// cancel dialog 'create new folder' ///'
515 Kontext "SpeichernDlg"
516 Call DialogTest (SpeichernDlg)
517 '/// cancel dialog 'Save As' ///'
520 '/// close application ///'
524 testcase tmFileSaveAll
525 '/// open application ///'
527 '/// type a formula ///'
529 Printlog " '/// open 2. window ///"
531 '/// type a formula ///'
534 Printlog " call save all"
535 '/// File->Save All ///'
537 Printlog " cancel 1. save"
538 Kontext "SpeichernDlg"
539 if SpeichernDlg.exists(5) then
540 '/// cancel dialog 'save as' ///'
543 qaErrorlog "First File save dialog did not show up."
545 Printlog " cancel 2. save"
546 Kontext "SpeichernDlg"
547 if SpeichernDlg.exists(5) then
548 '/// cancel dialog 'save as' ///'
551 qaErrorlog "Second File save dialog did not show up."
555 Kontext "SpeichernDlg"
557 printlog "smth had been typed in the starting window (just a hint ;-) )"
559 printlog "--------- no other window want's to get saved. :-)"
563 Printlog " hCloseDocument both"
564 '/// close document ///'
567 Printlog " first closed"
568 '/// close application ///'
572 printlog "any catching?"
575 Printlog " second closed"
579 testcase tmExportAsPDF
583 sPDF = "PDF - Portable Document Format (.pdf)"
585 '/// open application ///'
588 '/// click the button 'Export Directly as PDF' on the Functionbar ///'
589 kontext "Standardbar"
592 ' the 'Export as PDF' dialog has to come up, with the only 'File type' 'PDF - Portable Document Format (.pdf)'
593 kontext "ExportierenDlg"
594 sTemp = Dateityp.GetSelText
595 if (sTemp <> sPDF) then
596 Warnlog "filter for PDF export is missing :-( should: '" + sPDF + "'; is: '" + + "'"
598 '///+ - set Textbox 'File name' to "abc" ///'
599 Dateiname.SetText "abc"
600 '///+ - use the cursor keys in the filebrowser ///'
601 DateiAuswahl.TypeKeys "<home><down>"
602 '///+ - click on the button 'Up one level' ///'
603 UebergeordneterOrdner.Click
604 '///+ - click on the button 'Create New Directory' ///'
606 kontext "NeuerOrdner"
607 '///+ - - in the dialog $Foldername set textfield 'New' to 'abc' ///'
608 OrdnerName.SetText "abc"
609 '///+ - - cancel dialog $Foldername ///'
611 kontext "ExportierenDlg"
612 '///+ - click on the button 'Default Directory' ///'
614 '///+ - cancel dialog ///'
615 Kontext "ExportierenDlg"
616 ExportierenDlg.Cancel
618 '/// close application ///'
622 testcase tmFileProperties
623 '/// open application ///'
625 '/// File->Properties... ///'
629 '/// select tabpage 'General' ///'
630 active.SetPage TabDokument
631 Kontext "TabDokument"
632 Call DialogTest ( TabDokument )
635 '/// select tabpage 'Description' ///'
636 active.SetPage TabDokumentInfo
637 Kontext "TabDokumentInfo"
638 Call DialogTest ( TabDokumentInfo )
641 '/// select tabpage 'Internet' ///'
642 active.SetPage TabInternet
643 Kontext "TabInternet"
644 Call DialogTest (TabInternet)
646 '/// close application ///'
649 qaerrorlog "#i95523# Custom Properties is not controlable by VCL TestTool Application"
653 '/// select tabpage 'User defined' ///'
654 active.SetPage TabBenutzer
655 Kontext "TabBenutzer"
656 Call DialogTest ( TabBenutzer )
657 '/// click button 'info fields' ///'
659 Kontext "InfonamenBearbeiten"
660 Call DialogTest (InfonamenBearbeiten)
661 '/// close dialog 'edit field names' ///'
662 InfoNamenBearbeiten.Cancel
665 testcase tmFilePrinterSetting
666 '/// open application ///'
669 '/// File->Printer Settings ///'
672 if active.exists(2) then
674 qaerrorlog "There is no printer available - please install one on your system!"
676 Kontext "DruckerEinrichten"
677 Call DialogTest (DruckerEinrichten)
679 '/// cancel dialog 'printer setup' ///'
680 DruckerEinrichten.Cancel
682 '/// close application ///'
687 SchreibenInMathdok "a over b"