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: c_upd_filemenu.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-07-31 19:05:11 $
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 : oliver.craemer@sun.com
36 '* short description : Resource Test - File Menu
38 '************************************************************************
40 ' #1 tFileNewSpreadsheet
41 ' #1 tFileNewSpreadsheetFromTemplate
45 ' #1 tFileRecentDocuments
53 '\***********************************************************************
57 Printlog Chr(13) + "--------- FILE Menu (c_upd_filemenu.inc) ---------"
59 Call tFileNewSpreadsheet
60 Call tFileNewSpreadsheetFromTemplate
64 Call tFileRecentDocuments
74 '-----------------------------------------------------------
76 testcase tFileNewSpreadsheet
78 '/// Opening new spreadsheet document for getting defined starting environment
79 Printlog " Opening new spreadsheet document for getting defined starting environment"
81 '/// Open new document via Menu FILE-NEW-SPREADSHEET
82 Printlog " Open new document via Menu FILE-NEW-SPREADSHEET"
83 Kontext "DocumentCalc"
84 DocumentCalc.UseMenu 'Selecting Menubar
85 hMenuSelectNr(1) 'Using first entry on Menubar (FILE)
86 hMenuSelectNr(1) 'Using first entry on menu (NEW)
87 hMenuSelectNr(2) 'Using second entry on menu (SPREADSHEET)
88 Kontext "DocumentCalc"
89 Call DialogTest (DocumentCalc)
91 Printlog " Close document"
93 '/// Close starting document
94 Printlog " Close starting document"
99 '-----------------------------------------------------------
101 testcase tFileNewSpreadsheetFromTemplate
103 '/// Opening new spreadsheet document for getting defined starting environment
104 Printlog " Opening new spreadsheet document for getting defined starting environment"
106 '/// Open new document via Menu FILE-NEW-TEMPLATES AND DOCUMENTS
107 Printlog " Open new document via Menu FILE-NEW-FROM TEMPLATES AND DOCUMENTS"
108 Kontext "DocumentCalc"
109 DocumentCalc.UseMenu 'Selecting Menubar
110 hMenuSelectNr(1) 'Using first entry on Menubar (FILE)
111 hMenuSelectNr(1) 'Using first entry on menu (NEW)
112 hMenuSelectNr(12) 'Using second entry on menu (TEMPLATES AND DOCUMENTS)
113 Kontext "TemplateAndDocuments"
114 Call DialogTest (TemplateAndDocuments)
116 Printlog " Cancel dialog"
117 TemplateAndDocuments.Cancel
118 '/// Opening TemplateAndDocuments-Dialog via slot FileNewFromTemplate
119 Printlog " Opening TemplateAndDocuments-Dialog via slot FileNewFromTemplate"
120 Kontext "DocumentCalc"
122 Kontext "TemplateAndDocuments"
123 Call DialogTest (TemplateAndDocuments)
125 Printlog " Cancel dialog"
126 TemplateAndDocuments.Cancel
127 '/// Close starting document
128 Printlog " Close starting document"
133 '-----------------------------------------------------------
137 '/// Opening new spreadsheet document for getting defined starting environment
138 Printlog " Opening new spreadsheet document for getting defined starting environment"
140 '/// Open File-Open-dialog
141 Printlog " Open File-Open-dialog"
144 Call DialogTest ( OeffnenDlg )
145 '/// Click "Up one level"
146 Printlog " Click Up one level"
147 UebergeordneterOrdner.Click
148 '/// Click "Default directory"
149 Printlog " Click Default directory"
151 '/// Click "New Folder"
152 Printlog " Click New Folder"
154 Kontext "NeuerOrdner"
155 Call DialogTest ( NeuerOrdner )
156 '/// Cancel New Folder
157 Printlog " Cancel New Folder"
160 '/// Check "Read only"
161 Printlog " Check Read only"
163 '/// Close File-Open-dialog with Cancel
164 Printlog " Close File-Open-dialog with Cancel"
166 '/// Close starting document
167 Printlog " Close starting document"
172 '-----------------------------------------------------------
174 testcase tFileOpenCSV
176 dim sTestFile as string
178 sTestFile = convertpath(gTesttoolPath & "spreadsheet/required/input/tFileOpen_CSV.csv"
179 '/// Opening new spreadsheet document for getting defined starting environment
180 Printlog " Opening new spreadsheet document for getting defined starting environment"
182 '/// Open File-Open-dialog
183 Printlog " Open File-Open-dialog"
186 '/// Enter filename spreadsheet/required/input/tFileOpen_CSV.csv
187 Printlog " Enter filename spreadsheet/required/input/tFileOpen_CSV.csv"
188 Dateiname.settext (sTestFile)
190 Printlog " Click on Open"
192 '/// Check existence of CSV import dialog
193 Printlog " Check existence of CSV import dialog"
195 if Not TextImport.exists(2) then
196 'Verify if the file will be loaded in Writer instead
197 Kontext "ASCIIFilterOptionen"
198 if ASCIIFilterOptionen.exists(2) then
199 warnlog "Filterdetection for CSV is broken. Textfilter is used instead"
200 ASCIIFilterOptionen.Cancel
204 Kontext "DocumentWriter"
205 if DocumentWriter.exists(2) then
206 warnlog "CSV import has failed, file is loaded in Writer"
207 'Close Writer document
209 'Close starting document
214 if Active.exists then
222 Call Dialogtest (TextImport)
224 Printlog " - CSV import dialog is in function"
225 Kontext "DocumentCalc"
227 printlog " Close document"
232 '-----------------------------------------------------------
234 testcase tFileOpenDBF
236 dim sTestFile as string
238 sTestFile = convertpath(gTesttoolPath & "spreadsheet/required/input/tFileOpen_DBF.dbf"
239 '/// Opening new spreadsheet document for getting defined starting environment
240 Printlog " Opening new spreadsheet document for getting defined starting environment"
242 '/// Open File-Open-dialog
243 Printlog " Open File-Open-dialog"
246 '/// Enter filename spreadsheet/required/input/tFileOpen_DBF.dbf
247 Printlog " Enter filename spreadsheet/required/input/tFileOpen_DBF.dbf"
248 Dateiname.settext (sTestFile)
250 Printlog " Click on Open"
252 '/// Check if there is no Text document opened
253 Printlog " Check if there is no Text document opened"
254 Kontext "DocumentWriter"
255 if DocumentWriter.exists(2) then
256 warnlog "Filter detection is broken. Text file opened in writer although DBF filter was selected."
258 '/// Close starting document
259 Printlog " Close starting document"
263 '/// Check existence of import dialog
264 Printlog " Check existence of import dialog"
266 Call Dialogtest (ExportCalc)
267 if ExportCalc.exists(2) then
269 Printlog " - Import dialog is in function"
270 Kontext "DocumentCalc"
273 warnlog "DBF Import failed"
274 '/// Close starting document
275 Printlog " Close starting document"
281 '-----------------------------------------------------------
283 testcase tFileRecentDocuments
285 dim sTestFile as string
287 '/// Open new Spreadsheet document
288 Printlog " Open new Spreadsheet document"
291 Printlog " Enter some text"
292 Kontext "DocumentCalc"
293 DocumentCalc.Typekeys "The first doc!<RETURN>"
294 Printlog " Copy Test File spreadsheet/required/input/recentdocument.ods locally"
295 app.FileCopy convertpath(gTesttoolpath & "spreadsheet\required\input\recentdocument.ods"),gOfficePath + ConvertPath("user/work/recentdocument.ods")
296 Printlog " Load local copied testfile recentdocument.ods"
297 sTestFile = convertpath(gOfficePath & "user/work/recentdocument.ods")
298 Call hFileOpen(sTestFile)
299 '/// Close the document.
300 Printlog " Close the document."
301 '/// Now an item in <i>File / Recent Documents</i> should exist
303 '/// Reopen Document using the menu <i>File / Recent Documents</i>
304 Printlog " Reopen Document using the menu File / Recent Documents"
305 Kontext "DocumentCalc"
310 '/// Check that cell A1 has value "Recent document"
311 Printlog " Check that cell A1 has value Recent document"
312 Kontext "DocumentCalc"
313 if fCalcGetCellValue ("A1") = "Recent document" then
314 Printlog " - Loading most recent Document seems to work"
316 'Sometimes the recent doc is loaded in background (#i80533#)
317 if fCalcGetCellValue ("A1") = "The first doc!" then
318 QAErrorLog "Recent document is loaded in background (#i80533#)"
319 Kontext "DocumentCalc"
321 hMenuSelectNr(8) 'Open Window menu
322 hMenuSelectNr(hMenuItemGetCount) 'Select last loaded document
323 'Check that cell A1 has value "Recent document"
324 Call fCalcCompareCellValue ("A1","Recent document")
326 warnlog "Loading most recent Document seems to fail"
329 '/// Close recent document
330 Printlog " Close recent document"
332 '/// Close starting document
333 Printlog " Close starting document"
337 '-----------------------------------------------------------
341 '/// Open new Spreadsheet document
342 Printlog " Open new Spreadsheet document"
345 Printlog " Enter some text"
346 Kontext "DocumentCalc"
347 DocumentCalc.Typekeys "Test <RETURN>"
348 '/// Close document via File / Close
349 Printlog " Close document via File / Close"
351 '/// Close Messagebox via Cancel
352 Printlog " Close Messagebox via Cancel"
355 Kontext "DocumentCalc"
357 '/// Close Messagebox via Save
358 Printlog " Close Messagebox via Save"
361 '///+ Check if Save Dialog exists
362 Printlog " Check if Save Dialog exists"
363 Kontext "SpeichernDlg"
364 if SpeichernDlg.Exists then
368 if Active.Exists then
369 Warnlog Active.Gettext
372 Warnlog "Dialog to Save document isn't up!"
375 Kontext "DocumentCalc"
377 '/// Close Messagebox via Discard
378 Printlog " Close Messagebox via Discard"
384 '-----------------------------------------------------------
388 '/// Opening new spreadsheet document
389 Printlog " Opening new spreadsheet document"
392 Printlog " Enter some text"
393 Kontext "DocumentCalc"
394 DocumentCalc.Typekeys "Test <RETURN>"
395 '///Open SAVE dialog via File-Save
396 Printlog "Open SAVE dialog via File-Save"
398 Kontext "SpeichernDlg"
399 Call DialogTest (SpeichernDlg)
400 '/// Click "Up one level"
401 Printlog " Click Up one level"
402 UebergeordneterOrdner.Click
403 '/// Click "Default directory"
404 Printlog " Click Default directory"
406 '/// Click "New Folder"
407 Printlog " Click New Folder"
409 Kontext "NeuerOrdner"
410 Call DialogTest ( NeuerOrdner )
411 '/// Cancel New Folder
412 Printlog " Cancel New Folder"
414 Kontext "SpeichernDlg"
415 '/// Enable save with passwort
416 Printlog " Enable save with passwort"
418 '/// Enter filename tFileSave
419 Printlog " Enter filename tFileSave"
420 Dateiname.settext "tFileSave"
421 '/// Click on SAVE button
422 Printlog " Click on SAVE button"
424 Kontext "PasswordFileSave"
425 Call DialogTest (PasswordFileSave)
427 Password.SetText "OpenSource"
428 '/// Now enter wrong confirmation
429 PasswordConfirm.SetText "CloseSource"
430 '/// Try to leave dialog with OK
432 '/// MsgBox warning for wrong password confirmation should be visible
434 if Active.exists(4) then
435 if Active.GetRT = 304 then
437 Printlog " - Wrong passwort has been detected successfully."
441 warnlog "There is no messagebox because of a wrong password. Aborting!"
445 Kontext "PasswordFileSave"
446 '/// Leave dialog with Cancel
447 PasswordFileSave.Cancel
448 Kontext "DocumentCalc"
449 '/// Open SAVE dialog via File-Save again
450 Printlog " Open SAVE dialog via File-Save again"
452 Kontext "SpeichernDlg"
453 '/// Close dialog with Cancel
456 Printlog " Close document"
461 '-----------------------------------------------------------
463 testcase tFileSaveAsDBF
465 Dim UIFilter as string
466 Dim bStatus as boolean
468 Printlog " Open new Spreadsheet document"
470 Printlog " Fill two cells (10, Test)"
471 Kontext "DocumentCalc"
472 DocumentCalc.Typekeys "10 <TAB> Test <RETURN>"
473 Printlog " Open 'SaveAs' dialog"
475 Kontext "SpeichernDlg"
476 Printlog " Enter filename 'dbf-Test_update'"
477 DateiName.SetText "dbf-Test_update"
478 Printlog " Choose file typ dBase"
479 UIFilter = hGetUIFiltername ( "dBase" )
480 bStatus = hSelectUIFilter ( UIFilter )
481 if ( not bStatus ) then
482 warnlog "Filter not found"
487 Printlog " Click on Save button"
489 Printlog " Commit overwrite warning if file already exists"
491 if Active.exists(2) then
494 Printlog " Check alien file format warning"
495 Kontext "AlienWarning"
496 if AlienWarning.exists(2) then
497 Printlog " Commit if exists"
500 warnlog "Alien file format warning is missing -> Check this out!"
502 Printlog " Check existence of export encoding dialog"
504 Call DialogTest (ExportCalc)
505 Printlog " Accept dialog by OK"
508 if Active.exists(2) then
510 warnlog "The following warning exists. This could be #i87325:"
511 Printlog Active.GetText
515 Printlog " Close document"
520 '-----------------------------------------------------------
522 testcase tFileVersions
524 '/// Open new Spreadsheet document
525 Printlog " Open new Spreadsheet document"
528 Printlog " Enter some text"
529 Kontext "DocumentCalc"
530 DocumentCalc.Typekeys "Test <RETURN>"
531 '/// Save document as "user/work/version.ods"
532 Printlog " Save document as 'user/work/version.ods'"
533 Call hFileSaveAsKill convertpath(gOfficePath & "user/work/version.ods")
534 '/// Open File-Versions
535 Printlog " Open File-Versions"
538 Call DialogTest (Versionen)
539 '/// Click 'Save New Versions' button
540 Printlog " Click 'Save New Versions' button"
542 Kontext "VersionskommentarEingeben"
543 '/// Check existence of comments dialog
544 Call DialogTest(VersionskommentarEingeben)
545 '/// Cancel comments dialog
546 Printlog " Cancel comments dialog"
547 VersionskommentarEingeben.Cancel
549 '/// Close versions dialog
550 Printlog " Close versions dialog"
553 Printlog " Close document"
558 '-----------------------------------------------------------
560 testcase tFilePagePreview
562 '/// Open new Spreadsheet document
563 Printlog " Open new Spreadsheet document"
566 Printlog " Enter some text"
567 Kontext "DocumentCalc"
568 DocumentCalc.Typekeys "Test <RETURN>"
569 '/// Open File-PagePreview
570 Printlog " Open File-PagePreview"
573 Call DialogTest (Previewbar)
574 ' Printlog " Switch to fullscreen mode"
575 ' GanzerBildschirm.Click
576 ' Kontext "FullScreenbar"
577 ' printlog " Disable fullscreen mode"
579 ' Kontext "Previewbar"
580 printlog " Enable Margins"
584 warnlog "Pagemargins does not exists."
586 printlog " Check availability of the scaling slider"
587 if Not ScalingFactor.IsEnabled then
588 warnlog "Scalingslider is not available"
590 '/// Close page preview with button in toolbar
591 Printlog " Close page preview with button in toolbar"
594 Printlog " Close document"
599 '-----------------------------------------------------------
603 '/// Open new Spreadsheet document
604 Printlog " Open new Spreadsheet document"
607 Printlog " Enter some text"
608 Kontext "DocumentCalc"
609 DocumentCalc.Typekeys "Test <RETURN>"
611 Printlog " Open File-Print"
613 '/// Look for warning regarding missing printer
614 '/// -> If configuration is missing only this MsgBox is tested
616 if Active.Exists(2) then
617 if Active.GetRT = 304 then
618 Printlog Active.GetText
619 QAErrorLog "No printer is configured for this system"
621 Printlog Active.GetText
622 warnlog "There is an unexpected warning!"
624 '/// Close messagebox with OK
625 Printlog " Close messagebox with OK"
627 '/// Cancel Print dialog
628 Printlog " Cancel Print dialog"
632 Printlog " Close document"
637 '/// Check existence of print dilaog
638 Call DialogTest ( DruckenDLG )
639 '/// Invoke the print options dialog
640 Printlog " Invoke the print options dialog"
643 Kontext "TabPrintCalcOptions"
644 '/// Check existence of print options dilaog
645 Call DialogTest ( TabPrintCalcOptions )
646 '/// Cancel print options dialog
647 Printlog " Cancel print options dialog"
648 TabPrintCalcOptions.Cancel
649 '/// Check option 'Print to file'
650 Printlog " Check option 'Print to file'"
652 AusdruckInDatei.check
653 '/// Commit print dialog
654 Printlog " Commit print dialog"
656 '/// (Save file dialog should be visible now)
657 Kontext "SpeichernDLG"
658 '/// Check existence of save dilaog
659 Call DialogTest ( SpeichernDLG )
660 '/// Cancel save dialog
661 Printlog " Cancel save dialog"
664 Printlog " Close document"