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 2000, 2010 Oracle and/or its affiliates.
7 ' OpenOffice.org - a multi-platform office productivity suite
9 ' This file is part of OpenOffice.org.
11 ' OpenOffice.org is free software: you can redistribute it and/or modify
12 ' it under the terms of the GNU Lesser General Public License version 3
13 ' only, as published by the Free Software Foundation.
15 ' OpenOffice.org is distributed in the hope that it will be useful,
16 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ' GNU Lesser General Public License version 3 for more details
19 ' (a copy is included in the LICENSE file that accompanied this code).
21 ' You should have received a copy of the GNU Lesser General Public License
22 ' version 3 along with OpenOffice.org. If not, see
23 ' <http://www.openoffice.org/license.html>
24 ' for a copy of the LGPLv3 License.
26 '/************************************************************************
28 '* owner : helge.delfs@oracle.com
30 '* short description : Required-Testcases for the File-menu.
32 '\***********************************************************************
36 printLog Chr(13) + "--------- File Menu (w_001b_.inc) ----------"
37 gApplication = "WRITER"
39 Call tToolsXMLFilterSettings
41 Call tExportAsPDFButton
42 Call tFileSendCreateMasterDocument
43 Call tFileSendCreateHTMLDocument
44 Call tFileSendOutlineToPresentation
45 Call tFileSendOutlineToClipboard
46 Call tFileSendCreateAutoabstract
47 Call tFileSendAutoabstractToPresentation
49 'Writer Master Document
50 gApplication = "MASTERDOCUMENT"
51 Call tMasterDocFileSaveWithPassword
52 Call tMasterDocFileReload
53 Call tMasterDocFileVersions
54 Call tMasterDocFileSendCreateHTMLDocument
55 Call tMasterDocFileSendOutlineToPresentation
56 Call tMasterDocFileSendOutlineToClipboard
57 Call tMasterDocFileSendCreateAutoabstract
58 Call tMasterDocFileSendAutoabstractToPresentation
59 gApplication = "WRITER"
63 '-------------------------------------------------------------------------------
65 testcase tFileSendCreateMasterDocument
66 PrintLog "- File / Send / Create Masterdocument"
67 if gApplication <> "WRITER" then
68 printlog "Not in : " + gApplication
72 PrintLog "Open new document"
74 Call wTypeKeys("File -> Send -> Create Master Document")
75 PrintLog "Choose File / Send /Create Master Document"
76 FileSendCreateMasterdocument
77 Kontext "SendMasterDocument"
79 PrintLog "Cancel File-Save-dialog"
80 SendMasterdocument.Cancel
82 if Active.Exists then Active.OK
83 PrintLog "Close active document"
87 '-----------------------------------------------------------
89 testcase tFileSendCreateHTMLDocument
90 PrintLog "- File / Send / Create HTML-Dokument"
91 PrintLog "Open new document"
92 Select Case gApplication
93 Case "WRITER", "MASTERDOCUMENT" : hNewDocument()
95 printlog "Not in WriterWeb!"
98 PrintLog "Choose File / Send / Create HTML-Document"
99 FileSendCreateHTMLDocument
101 PrintLog "Cancel Filedialog"
102 Kontext "SendHTMLDocument"
103 SendHTMLDocument.Cancel
105 if Active.Exists then Active.OK
107 PrintLog "Close documents"
108 Do Until GetDocumentCount = 0
113 '-----------------------------------------------------------
115 testcase tFileSendOutlineToPresentation
117 PrintLog "- File / Send / Outline to Presentation"
118 Select Case gApplication
120 sFile$ = "htmltest.sxw"
121 Case "MASTERDOCUMENT"
122 sFile$ = "htmltest.sxg"
124 printlog "Not in Writer/Web!"
127 PrintLog "Open file ( gTesttoolPath + writer\required\input\ + htmltest.sxw )"
128 hFileOpenLocally( gTesttoolPath + "writer\required\input\" + sFile$ )
130 if Navigator.Exists then Navigator.Close
132 Kontext "DocumentWriter"
133 PrintLog "File / Send / Outline to presentation"
135 FileSendOutlineToPresentation
137 Warnlog "#i38723#Unable to execute 'File -> Send -> Outline to Presentation'"
143 Kontext "DocumentImpressOutlineView"
144 if DocumentImpressOutlineView.Exists then
145 DocumentImpressOutlineView.TypeKeys "<Mod1 Home>"
146 DocumentImpressOutlineView.TypeKeys "<Shift End>"
150 if GetClipboardText <> "Seite 1." then QAErrorlog "Wrong Outline in Impress Outlinemode"
152 QAErrorlog "Send outline to presentation doesn't work correct."
155 WarnLog "Outlinemode comes not up!"
159 hCloseDialog( Navigator, "Close,optional" )
163 '-----------------------------------------------------------
165 testcase tFileSendOutlineToClipboard
167 PrintLog "- File / Send / Outline to Clipboard"
168 Select Case gApplication
170 sFile$ = "htmltest.sxw"
171 Case "MASTERDOCUMENT"
172 sFile$ = "htmltest.sxg"
174 printlog "Not in Writer/Web!"
178 PrintLog "Open file ( gTesttoolPath + writer\required\input\ + htmltest.sxw )"
179 hFileOpenLocally( gTesttoolPath + "writer\required\input\" + sFile$ )
181 PrintLog "File / Send / Outline to Clipboard"
183 FileSendOutlineToClipboard
185 Warnlog "#i38723#Unable to execute 'File -> Send -> Outline to Clipboard'"
191 PrintLog "Close active document"
195 PrintLog "Open new document"
199 PrintLog "Paste outline in new document"
200 hUseAsyncSlot( "EditPaste" )
202 Call wTypeKeys("<Up>", 6)
203 Call wTypeKeys("<Home><Shift End>")
204 hUseAsyncSlot( "EditCopy" )
205 if GetClipboardText <> "Seite 1." then QAErrorlog "Wrong Outline in Impress Outlinemode"
207 PrintLog "Close active document"
211 '-----------------------------------------------------------
213 testcase tFileSendCreateAutoabstract
215 PrintLog "- File / Send / Create Autoabstract"
216 Select Case gApplication
218 sFile$ = "htmltest.sxw"
219 Case "MASTERDOCUMENT"
220 sFile$ = "htmltest.sxg"
222 printlog "Not in Writer/Web!"
226 PrintLog "Open file ( gTesttoolPath + writer\required\input\ + htmltest.sxw )"
227 hFileOpenLocally( gTesttoolPath + "writer\required\input\" + sFile$ )
229 if Navigator.Exists then Navigator.Close
231 Kontext "DocumentWriter"
232 PrintLog "File / Send / Create Autoabstract"
234 FileSendCreateAutoabstract
236 Warnlog "#i38723#Unable to execute 'File -> Send -> Create Autoabstract'"
242 PrintLog "Close upcoming dialog with 'Ok"
243 Kontext "AutoAbstractErzeugen"
244 AutoAbstractErzeugen.OK
246 Call wTypeKeys("<Home><Up>", 10)
247 Call wTypeKeys("<Shift End>")
251 if GetClipboardText <> "Seite 1." then QAErrorlog "Wrong Outline in Impress Outlinemode"
253 QAErrorlog "Empty autoabstract created"
257 hCloseDialog( Navigator, "Close,optional" )
262 '-----------------------------------------------------------
264 testcase tFileSendAutoabstractToPresentation
266 PrintLog "- File / Send / Autoabstract to Presentation"
267 Select Case gApplication
269 sFile$ = "htmltest.sxw"
270 Case "MASTERDOCUMENT"
271 sFile$ = "htmltest.sxg"
273 printlog "Not in Writer/Web!"
277 PrintLog "Open file ( gTesttoolPath + writer\required\input\ + htmltest.sxw )"
278 hFileOpenLocally( gTesttoolPath + "writer\required\input\" + sFile$ )
280 if Navigator.Exists then Navigator.Close
282 Kontext "DocumentWriter"
283 PrintLog "File / Send / Create Autoabstract To Presentation"
285 FileSendAutoabstractToPresentation
287 Warnlog "#i38723#Unable to execute 'File -> Send -> Autoabstract to Presentation'"
293 Kontext "AutoAbstractErzeugen"
294 PrintLog "Close upcoming dialog with 'Ok'"
295 AutoAbstractErzeugen.OK
298 Kontext "DocumentImpressOutlineView"
299 if DocumentImpressOutlineView.Exists then
300 PrintLog "Point cursor to beginning of document"
301 DocumentImpressOutlineView.TypeKeys "<Mod1 Home>"
303 DocumentImpressOutlineView.TypeKeys "<Shift End>"
307 if GetClipboardText <> "Seite 1." then QAErrorlog "Wrong Outline in Impress Outlinemode"
309 QAErrorlog "Edit / copy disabled. Maybe data could not be pasted correctly!"
312 Warnlog "- Outline in Impress not created!"
315 hCloseDialog( Navigator, "Close,optional" )
317 PrintLog "Close active document"
319 hSetDocumentContext()
322 '--------------------------------------------------------------------------------------------------------------------------------------------
324 testcase tMasterDocFileSaveWithPassword
330 Printlog "- File / Save with Password"
331 sFile$ = "password.odm"
332 sFile2$ = "password2.odm"
334 gApplication = "MASTERDOCUMENT"
335 PrintLog "Open new document"
337 PrintLog "Enter some text into document"
338 Call wTypeKeys("This document will be saved with a password!")
340 if gUseSysDlg = True then goto endsub
341 Datei$ = ConvertPath ( gOfficePath + "user\work\" + sFile$ )
342 if Dir (Datei$) <> "" then kill Datei$
344 PrintLog "Choose File / Save as."
346 PrintLog "enter destination and check 'Password'"
347 Kontext "SpeichernDlg"
348 if Passwort.IsEnabled then
351 Warnlog "- Not able to save with Password -> Checkbox is disabled! Maybe default-filter wrong!?"
353 PrintLog "if Checkbox is disabled the test stops here!"
358 Dateiname.SetText Datei$
359 PrintLog "Save your document"
363 if Active.Exists (1) then Active.Yes
366 PrintLog "Password dialog has to come up"
367 Kontext "PasswordFileSave"
368 if PasswordFileSave.Exists then
369 PrintLog "Enter your password"
370 Password.SetText "12345"
371 PrintLog "Re-Enter a wrong passwort"
372 PasswordConfirm.Settext "54321"
376 Warnlog "- Password-Dialog not up !"
381 PrintLog "A messagebox has to come up, warns of wrong confirmation"
382 if Active.Exists(1) then
385 Warnlog "Able to save document with wrong password"
388 Kontext "PasswordFileSave"
389 if PasswordFileSave.Exists then
390 PrintLog "Enter new password, and re-enter the same password"
391 Password.SetText "12345"
392 PasswordConfirm.SetText "12345"
395 Warnlog "- Password-Dialog not up !"
399 PrintLog "Close the document"
402 PrintLog "Open previous saved document"
403 Call hFileOpen( Datei$)
405 Kontext "PasswordFileOpen"
406 PrintLog "Enter a wrong password."
407 if PasswordFileOpen.Exists then
408 PasswortName.SetText "34567"
411 Warnlog "- Password-Dialog not up or Document couldn't be loaded!"
414 PrintLog "A messagebox has to come up, warns of wrong password"
417 if Not Active.Exists(1) then
418 Warnlog "Able to load document with wrong password"
423 Kontext "PasswordFileOpen"
424 PrintLog "Close password dialog"
425 if PasswordFileOpen.Exists then
426 PasswordFileOpen.Cancel
430 PrintLog "File / Open again your previous saved document"
431 Call hFileOpen( Datei$)
432 PrintLog "Enter your password in password dialog"
433 Kontext "PasswordFileOpen"
434 if PasswordFileOpen.Exists then
435 PasswortName.SetText "12345"
438 Warnlog "- Password-Dialog not up!"
442 Datei$ = ConvertPath ( gOfficePath + "user\work\" + sFile2$ )
443 if Dir (Datei$) <> "" then kill Datei$
444 PrintLog "File / Save as ..."
446 Kontext "SpeichernDlg"
447 if Not Passwort.IsChecked = True then
448 if gPlatgroup = "unx" then
449 QAErrorlog "#i73968#Opening a password protected file looses focus after loading"
451 Warnlog "#i36015#Checkbox 'Save with password' is not checked in file-dialog !"
456 Dateiname.SetText Datei$
459 if Active.Exists(2) then Active.Yes
460 PrintLog "Click on 'Save' in file open dialog"
461 Kontext "PasswordFileSave"
462 if Not PasswordFileSave.Exists(1) then
463 Warnlog "Passworddialog is not coming up on saving document"
465 Password.SetText "54321"
466 PasswordConfirm.SetText "54321"
468 PrintLog "The password dialog should come up"
471 PrintLog "File / Close and open your document again"
474 Kontext "PasswordFileOpen"
475 PrintLog "Now the passwort dialog should come up"
476 if Not PasswordFileOpen.Exists(2) then
477 Warnlog "Passworddialog is not coming up on reload"
479 PasswortName.SetText "54321"
484 PrintLog "Close active document"
488 '-----------------------------------------------------------
490 testcase tMasterDocFileReload
492 Dim sDocumentPath as string
494 Dim WriterFilterExtension(10) as string
495 Dim MasterDocFilterExtension(10) as string
497 WriterFilterExtension() = hGetFilternameExtension ( "writer8" )
498 MasterDocFilterExtension() = hGetFilternameExtension ( "writerglobal8" )
500 PrintLog "- File / Reload"
501 sFile = "reload." & MasterDocFilterExtension(0)
502 sDocumentPath = gOfficePath + "user\work\" + sFile
504 gApplication = "MASTERDOCUMENT"
506 PrintLog "Open new document"
509 PrintLog "Enter some text, save and close document"
510 Call wTypeKeys("File -> Reload!")
511 Call hFileSaveAsKill ( sDocumentPath )
512 hUseAsyncSlot( "FileClose" )
515 if ( MessageBox.Exists( 1 ) ) then
516 WarnLog "Messagebox after saving and closing : " + MessageBox.GetText
520 PrintLog "Open previous saved document"
521 Call hFileOpen( sDocumentPath )
523 PrintLog "Insert a table in document"
524 Call hTabelleEinfuegen
526 PrintLog "File / Reload"
527 hUseAsyncSlot( "FileReload" )
529 PrintLog "Quit messagebox with 'No'"
531 if ( Active.exists( 1 ) ) then
534 warnlog( "Messagebox missing" )
537 PrintLog "File / Reload again and quit messagebox with yes"
538 hUseAsyncSlot( "FileReload" )
541 if ( Active.exists( 2 ) ) then
544 warnlog( "Messagebox missing" )
547 PrintLog "Close active document"
549 hDeleteFile( sDocumentPath )
553 '-----------------------------------------------------------
555 testcase tMasterDocFileVersions
558 Dim WriterFilterExtension(10) as string
559 Dim MasterDocFilterExtension(10) as string
561 WriterFilterExtension() = hGetFilternameExtension ( "writer8" )
562 MasterDocFilterExtension() = hGetFilternameExtension ( "writerglobal8" )
564 gApplication = "MASTERDOCUMENT"
566 PrintLog "- File / Versions"
567 sFile = "kann_weg." & MasterDocFilterExtension(0)
569 PrintLog "Open new document"
571 Call wTypeKeys ("File version")
573 PrintLog "enter some text in documet and save it"
574 Call hFileSaveAsKill(gOfficePath + "user\work\" + sFile )
577 PrintLog "Choose File / Versions"
580 Warnlog "- File / Versions not accessible!"
585 if ( Versionen.exists( 2 ) ) then
587 Call DialogTest ( Versionen )
590 PrintLog "In Version-dialog click 'Save New Version'"
591 Kontext "VersionskommentarEingeben"
592 if ( VersionskommentarEingeben.exists( 1 ) ) then
593 Call DialogTest ( VersionskommentarEingeben )
595 PrintLog "Cancel dialog 'Insert version comment'"
596 VersionskommentarEingeben.Cancel
598 warnlog( "Dialog <VersionskommentarEingeben> is not available" )
602 PrintLog "Close dialog"
605 warnlog( "Dialog <Versionen> is not available" )
608 PrintLog "Close active document"
613 '-----------------------------------------------------------
615 testcase tMasterDocFileSendCreateHTMLDocument
617 PrintLog "- File / Send / Create HTML-Dokument"
619 gApplication = "MASTERDOCUMENT"
621 PrintLog "Open new document"
624 PrintLog "Choose File / Send / Create HTML-Document"
625 FileSendCreateHTMLDocument
627 PrintLog "Cancel Filedialog"
628 Kontext "SendHTMLDocument"
629 if ( SendHTMLDocument.exists( 2 ) ) then
630 SendHTMLDocument.Cancel
633 if Active.Exists( 1 ) then
634 warnlog( "Unexpected messgebox" & Active.getText() )
638 warnlog( "Dialog <SendHTMLDocument> is not available" )
641 PrintLog "Close active document"
646 '-----------------------------------------------------------
648 testcase tMasterDocFileSendOutlineToPresentation
650 PrintLog "- File / Send / Outline to Presentation"
652 Dim sFile as string : sFile = "htmltest.sxg"
654 gApplication = "MASTERDOCUMENT"
656 hFileOpenLocally( gTesttoolPath + "writer\required\input\" + sFile )
659 if ( Navigator.Exists ) then
664 Kontext "DocumentWriter"
665 PrintLog "File / Send / Outline to presentation"
667 FileSendOutlineToPresentation
669 Warnlog "#i38723#Unable to execute 'File -> Send -> Outline to Presentation'"
674 Kontext "DocumentImpressOutlineView"
675 if ( DocumentImpressOutlineView.Exists( 2 ) ) then
676 DocumentImpressOutlineView.TypeKeys "<Mod1 Home>"
677 DocumentImpressOutlineView.TypeKeys "<Shift End>"
678 hUseAsyncSlot( "EditCopy" )
679 if ( GetClipboardText <> "Seite 1." ) then
680 QAErrorlog "Wrong Outline in Impress Outlinemode"
683 WarnLog "Outlinemode comes not up!"
687 hCloseDialog( Navigator, "Close,optional" )
689 PrintLog "Close documents"
694 '-----------------------------------------------------------
696 testcase tMasterDocFileSendOutlineToClipboard
698 gApplication = "MASTERDOCUMENT"
699 Dim sFile as string : sFile = "htmltest.sxg"
701 PrintLog "- File / Send / Outline to Clipboard"
702 hFileOpenLocally( gTesttoolPath + "writer\required\input\" + sFile )
704 PrintLog "File / Send / Outline to Clipboard"
706 FileSendOutlineToClipboard
708 Warnlog "#i38723#Unable to execute 'File -> Send -> Outline to Clipboard'"
713 PrintLog "Close active document"
716 PrintLog "Open new document"
719 PrintLog "Paste outline in new document"
720 hUseAsyncSlot( "EditPaste" )
721 Call wTypeKeys("<Up>", 6)
722 Call wTypeKeys("<Home><Shift End>")
723 hUseAsyncSlot( "EditCopy" )
724 if ( GetClipboardText <> "Seite 1." ) then
725 QAErrorlog "Wrong Outline in Impress Outlinemode"
728 PrintLog "Close active document"
730 gApplication = "WRITER"
734 '-----------------------------------------------------------
736 testcase tMasterDocFileSendCreateAutoabstract
738 gApplication = "MASTERDOCUMENT"
739 Dim sFile as string : sFile = "htmltest.sxg"
741 PrintLog "- File / Send / Create Autoabstract"
742 hFileOpenLocally( gTesttoolPath + "writer\required\input\" + sFile )
745 hCloseDialog( Navigator, "Close,optional" )
747 Kontext "DocumentWriter"
748 PrintLog "File / Send / Create Autoabstract"
750 FileSendCreateAutoabstract
752 Warnlog "#i38723#Unable to execute 'File -> Send -> Create Autoabstract'"
757 PrintLog "Close upcoming dialog with 'Ok"
758 Kontext "AutoAbstractErzeugen"
759 if ( AutoAbstractErzeugen.exists( 2 ) ) then
761 AutoAbstractErzeugen.OK()
763 Call wTypeKeys("<Home><Up>", 10)
764 Call wTypeKeys("<Shift End>")
766 hUseAsyncSlot( "EditCopy" )
767 if GetClipboardText <> "Seite 1." then
768 QAErrorlog "Wrong Outline in Impress Outlinemode"
771 warnlog( "Dialog <AutoAbstractErzeugen> is not available" )
775 hCloseDialog( Navigator, "Close,optional" )
777 PrintLog "Close documents"
779 gApplication = "WRITER"
783 '-----------------------------------------------------------
785 testcase tMasterDocFileSendAutoabstractToPresentation
787 gApplication = "MASTERDOCUMENT"
788 Dim sFile as string : sFile = "htmltest.sxg"
790 PrintLog "- File / Send / Autoabstract to Presentation"
791 PrintLog "Open file ( gTesttoolPath + writer\required\input\ + htmltest.sxw )"
792 hFileOpenLocally( gTesttoolPath + "writer\required\input\" + sFile )
795 hCloseDialog( Navigator, "Close,optional" )
797 Kontext "DocumentWriter"
798 PrintLog "File / Send / Create Autoabstract To Presentation"
800 FileSendAutoabstractToPresentation
802 Warnlog "#i38723#Unable to execute 'File -> Send -> Autoabstract to Presentation'"
807 Kontext "AutoAbstractErzeugen"
808 if ( AutoAbstractErzeugen.exists( 1 ) ) then
809 PrintLog "Close upcoming dialog with 'Ok'"
810 AutoAbstractErzeugen.OK
812 warnlog( "Dialog <AutoAbstractErzeugen> is not available" )
815 Kontext "DocumentImpressOutlineView"
816 if ( DocumentImpressOutlineView.Exists( 2 ) ) then
818 PrintLog "Point cursor to beginning of document"
819 DocumentImpressOutlineView.TypeKeys "<Mod1 Home>"
822 DocumentImpressOutlineView.TypeKeys "<Shift End>"
826 if GetClipboardText <> "Seite 1." then QAErrorlog "Wrong Outline in Impress Outlinemode"
828 QAErrorlog "Edit / copy disabled. Maybe data could not be pasted correctly!"
831 Warnlog "- Outline in Impress not created!"
835 hCloseDialog( Navigator, "Close,optional" )
838 PrintLog "Close active document"
840 hSetDocumentContext()
842 gApplication = "WRITER"
845 '-------------------------------------------------------------------------------