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: w_001_.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-09-04 09:26:17 $
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 : helge.delfs@sun.com
36 '* short description : Required-Testcases for the File-menu.
38 '\***********************************************************************
42 printLog Chr(13) + "--------- File Menu (w_001b_.inc) ----------"
43 gApplication = "WRITER"
45 Call tToolsXMLFilterSettings
47 Call tExportAsPDFButton
48 Call tFileSendCreateMasterDocument
49 Call tFileSendCreateHTMLDocument
50 Call tFileSendOutlineToPresentation
51 Call tFileSendOutlineToClipboard
52 Call tFileSendCreateAutoabstract
53 Call tFileSendAutoabstractToPresentation
55 'Writer Master Document
56 gApplication = "MASTERDOCUMENT"
57 Call tMasterDocFileSaveWithPassword
58 Call tMasterDocFileReload
59 Call tMasterDocFileVersions
60 Call tMasterDocFileSendCreateHTMLDocument
61 Call tMasterDocFileSendOutlineToPresentation
62 Call tMasterDocFileSendOutlineToClipboard
63 Call tMasterDocFileSendCreateAutoabstract
64 Call tMasterDocFileSendAutoabstractToPresentation
65 gApplication = "WRITER"
69 '-------------------------------------------------------------------------------
71 testcase tFileSendCreateMasterDocument
72 PrintLog "- File / Send / Create Masterdocument"
73 if gApplication <> "WRITER" then
74 printlog "Not in : " + gApplication
78 PrintLog "Open new document"
80 Call wTypeKeys("File -> Send -> Create Master Document")
81 PrintLog "Choose File / Send /Create Master Document"
82 FileSendCreateMasterdocument
83 Kontext "SendMasterDocument"
85 PrintLog "Cancel File-Save-dialog"
86 SendMasterdocument.Cancel
88 if Active.Exists then Active.OK
89 PrintLog "Close active document"
93 '-----------------------------------------------------------
95 testcase tFileSendCreateHTMLDocument
96 PrintLog "- File / Send / Create HTML-Dokument"
97 PrintLog "Open new document"
98 Select Case gApplication
101 Case "MASTERDOCUMENT"
104 printlog "Not in WriterWeb!"
107 PrintLog "Choose File / Send / Create HTML-Document"
108 FileSendCreateHTMLDocument
110 PrintLog "Cancel Filedialog"
111 Kontext "SendHTMLDocument"
112 SendHTMLDocument.Cancel
114 if Active.Exists then Active.OK
116 PrintLog "Close documents"
117 Do Until GetDocumentCount = 0
122 '-----------------------------------------------------------
124 testcase tFileSendOutlineToPresentation
126 PrintLog "- File / Send / Outline to Presentation"
127 Select Case gApplication
129 sFile$ = "htmltest.sxw"
130 Case "MASTERDOCUMENT"
131 sFile$ = "htmltest.sxg"
133 printlog "Not in Writer/Web!"
136 PrintLog "Open file ( gTesttoolPath + writer\required\input\ + htmltest.sxw )"
137 Call hFileOpen ( gTesttoolPath + "writer\required\input\" + sFile$ )
139 if Navigator.Exists then Navigator.Close
141 Kontext "DocumentWriter"
142 PrintLog "File / Send / Outline to presentation"
144 FileSendOutlineToPresentation
146 Warnlog "#i38723#Unable to execute 'File -> Send -> Outline to Presentation'"
152 Kontext "DocumentImpressOutlineView"
153 if DocumentImpressOutlineView.Exists then
154 DocumentImpressOutlineView.TypeKeys "<Mod1 Home>"
155 DocumentImpressOutlineView.TypeKeys "<Shift End>"
159 if GetClipboardText <> "Seite 1." then QAErrorlog "Wrong Outline in Impress Outlinemode"
161 QAErrorlog "Send outline to presentation doesn't work correct."
164 WarnLog "Outlinemode comes not up!"
168 if Navigator.Exists then Navigator.Close
169 PrintLog "Close documents"
170 Do Until GetDocumentCount = 0
175 '-----------------------------------------------------------
177 testcase tFileSendOutlineToClipboard
179 PrintLog "- File / Send / Outline to Clipboard"
180 Select Case gApplication
182 sFile$ = "htmltest.sxw"
183 Case "MASTERDOCUMENT"
184 sFile$ = "htmltest.sxg"
186 printlog "Not in Writer/Web!"
190 PrintLog "Open file ( gTesttoolPath + writer\required\input\ + htmltest.sxw )"
191 Call hFileOpen ( gTesttoolPath + "writer\required\input\" + sFile$ )
193 PrintLog "File / Send / Outline to Clipboard"
195 FileSendOutlineToClipboard
197 Warnlog "#i38723#Unable to execute 'File -> Send -> Outline to Clipboard'"
203 PrintLog "Close active document"
207 PrintLog "Open new document"
211 PrintLog "Paste outline in new document"
212 hUseAsyncSlot( "EditPaste" )
213 Call wTypeKeys("<Up>", 6)
214 Call wTypeKeys("<Home><Shift End>")
215 hUseAsyncSlot( "EditCopy" )
216 if GetClipboardText <> "Seite 1." then QAErrorlog "Wrong Outline in Impress Outlinemode"
218 PrintLog "Close active document"
222 '-----------------------------------------------------------
224 testcase tFileSendCreateAutoabstract
226 PrintLog "- File / Send / Create Autoabstract"
227 Select Case gApplication
229 sFile$ = "htmltest.sxw"
230 Case "MASTERDOCUMENT"
231 sFile$ = "htmltest.sxg"
233 printlog "Not in Writer/Web!"
237 PrintLog "Open file ( gTesttoolPath + writer\required\input\ + htmltest.sxw )"
238 Call hFileOpen ( gTesttoolPath + "writer\required\input\" + sFile$ )
240 if Navigator.Exists then Navigator.Close
242 Kontext "DocumentWriter"
243 PrintLog "File / Send / Create Autoabstract"
245 FileSendCreateAutoabstract
247 Warnlog "#i38723#Unable to execute 'File -> Send -> Create Autoabstract'"
253 PrintLog "Close upcoming dialog with 'Ok"
254 Kontext "AutoAbstractErzeugen"
255 AutoAbstractErzeugen.OK
257 Call wTypeKeys("<Home><Up>", 10)
258 Call wTypeKeys("<Shift End>")
262 if GetClipboardText <> "Seite 1." then QAErrorlog "Wrong Outline in Impress Outlinemode"
264 QAErrorlog "Empty autoabstract created"
268 if Navigator.Exists then Navigator.Close
271 PrintLog "Close active documents"
272 Do Until GetDocumentCount = 0
277 '-----------------------------------------------------------
279 testcase tFileSendAutoabstractToPresentation
281 PrintLog "- File / Send / Autoabstract to Presentation"
282 Select Case gApplication
284 sFile$ = "htmltest.sxw"
285 Case "MASTERDOCUMENT"
286 sFile$ = "htmltest.sxg"
288 printlog "Not in Writer/Web!"
292 PrintLog "Open file ( gTesttoolPath + writer\required\input\ + htmltest.sxw )"
293 Call hFileOpen ( gTesttoolPath + "writer\required\input\" + sFile$ )
295 if Navigator.Exists then Navigator.Close
297 Kontext "DocumentWriter"
298 PrintLog "File / Send / Create Autoabstract To Presentation"
300 FileSendAutoabstractToPresentation
302 Warnlog "#i38723#Unable to execute 'File -> Send -> Autoabstract to Presentation'"
308 Kontext "AutoAbstractErzeugen"
309 PrintLog "Close upcoming dialog with 'Ok'"
310 AutoAbstractErzeugen.OK
313 Kontext "DocumentImpressOutlineView"
314 if DocumentImpressOutlineView.Exists then
315 PrintLog "Point cursor to beginning of document"
316 DocumentImpressOutlineView.TypeKeys "<Mod1 Home>"
318 DocumentImpressOutlineView.TypeKeys "<Shift End>"
322 if GetClipboardText <> "Seite 1." then QAErrorlog "Wrong Outline in Impress Outlinemode"
324 QAErrorlog "Edit / copy disabled. Maybe data could not be pasted correctly!"
327 Warnlog "- Outline in Impress not created!"
330 if Navigator.Exists then Navigator.Close
333 PrintLog "Close active document"
338 '--------------------------------------------------------------------------------------------------------------------------------------------
340 testcase tMasterDocFileSaveWithPassword
346 Printlog "- File / Save with Password"
347 sFile$ = "password.odm"
348 sFile2$ = "password2.odm"
350 gApplication = "MASTERDOCUMENT"
351 PrintLog "Open new document"
353 PrintLog "Enter some text into document"
354 Call wTypeKeys("This document will be saved with a password!")
356 if gUseSysDlg = True then goto endsub
357 Datei$ = ConvertPath ( gOfficePath + "user\work\" + sFile$ )
358 if Dir (Datei$) <> "" then kill Datei$
360 PrintLog "Choose File / Save as."
362 PrintLog "enter destination and check 'Password'"
363 Kontext "SpeichernDlg"
364 if Passwort.IsEnabled then
367 Warnlog "- Not able to save with Password -> Checkbox is disabled! Maybe default-filter wrong!?"
369 PrintLog "if Checkbox is disabled the test stops here!"
374 Dateiname.SetText Datei$
375 PrintLog "Save your document"
379 if Active.Exists (1) then Active.Yes
382 PrintLog "Password dialog has to come up"
383 Kontext "PasswordFileSave"
384 if PasswordFileSave.Exists then
385 PrintLog "Enter your password"
386 Password.SetText "12345"
387 PrintLog "Re-Enter a wrong passwort"
388 PasswordConfirm.Settext "54321"
392 Warnlog "- Password-Dialog not up !"
397 PrintLog "A messagebox has to come up, warns of wrong confirmation"
398 if Active.Exists(1) then
401 Warnlog "Able to save document with wrong password"
404 Kontext "PasswordFileSave"
405 if PasswordFileSave.Exists then
406 PrintLog "Enter new password, and re-enter the same password"
407 Password.SetText "12345"
408 PasswordConfirm.SetText "12345"
411 Warnlog "- Password-Dialog not up !"
415 PrintLog "Close the document"
418 PrintLog "Open previous saved document"
419 Call hFileOpen(Datei$)
421 Kontext "PasswordFileOpen"
422 PrintLog "Enter a wrong password."
423 if PasswordFileOpen.Exists then
424 PasswortName.SetText "34567"
427 Warnlog "- Password-Dialog not up or Document couldn't be loaded!"
430 PrintLog "A messagebox has to come up, warns of wrong password"
433 if Not Active.Exists(1) then
434 Warnlog "Able to load document with wrong password"
439 Kontext "PasswordFileOpen"
440 PrintLog "Close password dialog"
441 if PasswordFileOpen.Exists then
442 PasswordFileOpen.Cancel
446 PrintLog "File / Open again your previous saved document"
447 Call hFileOpen(Datei$)
448 PrintLog "Enter your password in password dialog"
449 Kontext "PasswordFileOpen"
450 if PasswordFileOpen.Exists then
451 PasswortName.SetText "12345"
454 Warnlog "- Password-Dialog not up!"
458 Datei$ = ConvertPath ( gOfficePath + "user\work\" + sFile2$ )
459 if Dir (Datei$) <> "" then kill Datei$
460 PrintLog "File / Save as ..."
462 Kontext "SpeichernDlg"
463 if Not Passwort.IsChecked = True then
464 if gPlatgroup = "unx" then
465 QAErrorlog "#i73968#Opening a password protected file looses focus after loading"
467 Warnlog "#i36015#Checkbox 'Save with password' is not checked in file-dialog !"
472 Dateiname.SetText Datei$
475 if Active.Exists(2) then Active.Yes
476 PrintLog "Click on 'Save' in file open dialog"
477 Kontext "PasswordFileSave"
478 if Not PasswordFileSave.Exists(1) then
479 Warnlog "Passworddialog is not coming up on saving document"
481 Password.SetText "54321"
482 PasswordConfirm.SetText "54321"
484 PrintLog "The password dialog should come up"
487 PrintLog "File / Close and open your document again"
488 Call hFileOpen(Datei$)
490 Kontext "PasswordFileOpen"
491 PrintLog "Now the passwort dialog should come up"
492 if Not PasswordFileOpen.Exists(2) then
493 Warnlog "Passworddialog is not coming up on reload"
495 PasswortName.SetText "54321"
500 PrintLog "Close active document"
504 '-----------------------------------------------------------
506 testcase tMasterDocFileReload
508 Dim sDocumentPath as string
510 Dim WriterFilterExtension(10) as string
511 Dim MasterDocFilterExtension(10) as string
513 WriterFilterExtension() = hGetFilternameExtension ( "writer8" )
514 MasterDocFilterExtension() = hGetFilternameExtension ( "writerglobal8" )
516 PrintLog "- File / Reload"
517 sFile = "reload." & MasterDocFilterExtension(0)
518 sDocumentPath = gOfficePath + "user\work\" + sFile
520 gApplication = "MASTERDOCUMENT"
522 PrintLog "Open new document"
525 PrintLog "Enter some text, save and close document"
526 Call wTypeKeys("File -> Reload!")
527 Call hFileSaveAsKill ( sDocumentPath )
528 hUseAsyncSlot( "FileClose" )
531 if ( MessageBox.Exists( 1 ) ) then
532 WarnLog "Messagebox after saving and closing : " + MessageBox.GetText
536 PrintLog "Open previous saved document"
537 Call hFileOpen ( sDocumentPath )
539 PrintLog "Insert a table in document"
540 Call hTabelleEinfuegen
542 PrintLog "File / Reload"
543 hUseAsyncSlot( "FileReload" )
545 PrintLog "Quit messagebox with 'No'"
547 if ( Active.exists( 1 ) ) then
550 warnlog( "Messagebox missing" )
553 PrintLog "File / Reload again and quit messagebox with yes"
554 hUseAsyncSlot( "FileReload" )
557 if ( Active.exists( 2 ) ) then
560 warnlog( "Messagebox missing" )
563 PrintLog "Close active document"
565 hDeleteFile( sDocumentPath )
569 '-----------------------------------------------------------
571 testcase tMasterDocFileVersions
574 Dim WriterFilterExtension(10) as string
575 Dim MasterDocFilterExtension(10) as string
577 WriterFilterExtension() = hGetFilternameExtension ( "writer8" )
578 MasterDocFilterExtension() = hGetFilternameExtension ( "writerglobal8" )
580 gApplication = "MASTERDOCUMENT"
582 PrintLog "- File / Versions"
583 sFile = "kann_weg." & MasterDocFilterExtension(0)
585 PrintLog "Open new document"
587 Call wTypeKeys ("File version")
589 PrintLog "enter some text in documet and save it"
590 Call hFileSaveAsKill(gOfficePath + "user\work\" + sFile )
593 PrintLog "Choose File / Versions"
596 Warnlog "- File / Versions not accessible!"
601 if ( Versionen.exists( 2 ) ) then
603 Call DialogTest ( Versionen )
606 PrintLog "In Version-dialog click 'Save New Version'"
607 Kontext "VersionskommentarEingeben"
608 if ( VersionskommentarEingeben.exists( 1 ) ) then
609 Call DialogTest ( VersionskommentarEingeben )
611 PrintLog "Cancel dialog 'Insert version comment'"
612 VersionskommentarEingeben.Cancel
614 warnlog( "Dialog <VersionskommentarEingeben> is not available" )
618 PrintLog "Close dialog"
621 warnlog( "Dialog <Versionen> is not available" )
624 PrintLog "Close active document"
629 '-----------------------------------------------------------
631 testcase tMasterDocFileSendCreateHTMLDocument
633 PrintLog "- File / Send / Create HTML-Dokument"
635 gApplication = "MASTERDOCUMENT"
637 PrintLog "Open new document"
640 PrintLog "Choose File / Send / Create HTML-Document"
641 FileSendCreateHTMLDocument
643 PrintLog "Cancel Filedialog"
644 Kontext "SendHTMLDocument"
645 if ( SendHTMLDocument.exists( 2 ) ) then
646 SendHTMLDocument.Cancel
649 if Active.Exists( 1 ) then
650 warnlog( "Unexpected messgebox" & Active.getText() )
654 warnlog( "Dialog <SendHTMLDocument> is not available" )
657 PrintLog "Close active document"
662 '-----------------------------------------------------------
664 testcase tMasterDocFileSendOutlineToPresentation
666 PrintLog "- File / Send / Outline to Presentation"
668 Dim sFile as string : sFile = "htmltest.sxg"
670 gApplication = "MASTERDOCUMENT"
672 Call hFileOpen ( gTesttoolPath + "writer\required\input\" + sFile )
675 if ( Navigator.Exists ) then
680 Kontext "DocumentWriter"
681 PrintLog "File / Send / Outline to presentation"
683 FileSendOutlineToPresentation
685 Warnlog "#i38723#Unable to execute 'File -> Send -> Outline to Presentation'"
690 Kontext "DocumentImpressOutlineView"
691 if ( DocumentImpressOutlineView.Exists( 2 ) ) then
692 DocumentImpressOutlineView.TypeKeys "<Mod1 Home>"
693 DocumentImpressOutlineView.TypeKeys "<Shift End>"
694 hUseAsyncSlot( "EditCopy" )
695 if ( GetClipboardText <> "Seite 1." ) then
696 QAErrorlog "Wrong Outline in Impress Outlinemode"
699 WarnLog "Outlinemode comes not up!"
703 if Navigator.Exists then
708 PrintLog "Close documents"
713 '-----------------------------------------------------------
715 testcase tMasterDocFileSendOutlineToClipboard
717 gApplication = "MASTERDOCUMENT"
718 Dim sFile as string : sFile = "htmltest.sxg"
720 PrintLog "- File / Send / Outline to Clipboard"
721 Call hFileOpen ( gTesttoolPath + "writer\required\input\" + sFile )
723 PrintLog "File / Send / Outline to Clipboard"
725 FileSendOutlineToClipboard
727 Warnlog "#i38723#Unable to execute 'File -> Send -> Outline to Clipboard'"
732 PrintLog "Close active document"
735 PrintLog "Open new document"
738 PrintLog "Paste outline in new document"
739 hUseAsyncSlot( "EditPaste" )
740 Call wTypeKeys("<Up>", 6)
741 Call wTypeKeys("<Home><Shift End>")
742 hUseAsyncSlot( "EditCopy" )
743 if ( GetClipboardText <> "Seite 1." ) then
744 QAErrorlog "Wrong Outline in Impress Outlinemode"
747 PrintLog "Close active document"
749 gApplication = "WRITER"
753 '-----------------------------------------------------------
755 testcase tMasterDocFileSendCreateAutoabstract
757 gApplication = "MASTERDOCUMENT"
758 Dim sFile as string : sFile = "htmltest.sxg"
760 PrintLog "- File / Send / Create Autoabstract"
761 Call hFileOpen ( gTesttoolPath + "writer\required\input\" + sFile )
764 if ( Navigator.Exists ) then
769 Kontext "DocumentWriter"
770 PrintLog "File / Send / Create Autoabstract"
772 FileSendCreateAutoabstract
774 Warnlog "#i38723#Unable to execute 'File -> Send -> Create Autoabstract'"
779 PrintLog "Close upcoming dialog with 'Ok"
780 Kontext "AutoAbstractErzeugen"
781 if ( AutoAbstractErzeugen.exists( 2 ) ) then
783 AutoAbstractErzeugen.OK()
785 Call wTypeKeys("<Home><Up>", 10)
786 Call wTypeKeys("<Shift End>")
788 hUseAsyncSlot( "EditCopy" )
789 if GetClipboardText <> "Seite 1." then
790 QAErrorlog "Wrong Outline in Impress Outlinemode"
793 warnlog( "Dialog <AutoAbstractErzeugen> is not available" )
797 if ( Navigator.Exists ) then
802 PrintLog "Close documents"
804 gApplication = "WRITER"
808 '-----------------------------------------------------------
810 testcase tMasterDocFileSendAutoabstractToPresentation
812 gApplication = "MASTERDOCUMENT"
813 Dim sFile as string : sFile = "htmltest.sxg"
815 PrintLog "- File / Send / Autoabstract to Presentation"
816 PrintLog "Open file ( gTesttoolPath + writer\required\input\ + htmltest.sxw )"
817 Call hFileOpen ( gTesttoolPath + "writer\required\input\" + sFile )
820 if Navigator.Exists then
825 Kontext "DocumentWriter"
826 PrintLog "File / Send / Create Autoabstract To Presentation"
828 FileSendAutoabstractToPresentation
830 Warnlog "#i38723#Unable to execute 'File -> Send -> Autoabstract to Presentation'"
835 Kontext "AutoAbstractErzeugen"
836 if ( AutoAbstractErzeugen.exists( 1 ) ) then
837 PrintLog "Close upcoming dialog with 'Ok'"
838 AutoAbstractErzeugen.OK
840 warnlog( "Dialog <AutoAbstractErzeugen> is not available" )
843 Kontext "DocumentImpressOutlineView"
844 if ( DocumentImpressOutlineView.Exists( 2 ) ) then
846 PrintLog "Point cursor to beginning of document"
847 DocumentImpressOutlineView.TypeKeys "<Mod1 Home>"
850 DocumentImpressOutlineView.TypeKeys "<Shift End>"
854 if GetClipboardText <> "Seite 1." then QAErrorlog "Wrong Outline in Impress Outlinemode"
856 QAErrorlog "Edit / copy disabled. Maybe data could not be pasted correctly!"
859 Warnlog "- Outline in Impress not created!"
863 if Navigator.Exists then
869 PrintLog "Close active document"
873 gApplication = "WRITER"
876 '-------------------------------------------------------------------------------