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_001_.inc) ----------"
43 gApplication = "WRITER"
46 Call tFileNewBusinessCards
53 Call tFileSaveAsExport
54 Call tFileSaveWithPassword
60 '-----------------------------------------------------------
62 testcase tFileNewLabels
64 QAErrorLog "#i102218# - tFileNewLabels outcommented due to bug."
67 Dim iSheetFormat as integer
68 Dim iBrandIndex as integer
73 ' The brands have fixed names and should not change
74 dim cBrandList( 10 ) as string
75 cBrandList( 1 ) = "Avery A4"
76 cBrandList( 2 ) = "Avery A4/Asia"
77 cBrandList( 3 ) = "Avery Letter Size"
78 cBrandlist( 4 ) = "Avery Zweckform"
79 cBrandList( 5 ) = "Herlitz"
80 cBrandList( 6 ) = "Herma A4"
81 cBrandList( 7 ) = "Herma A5"
82 cBrandList( 8 ) = "Herma endlos"
83 cBrandList( 9 ) = "Leitz"
84 cBrandList( 10 ) = "Sigel"
86 PrintLog "Open Labels-dialog with File / New / Labels"
87 if ( hCreateLabels ) then
89 Call DialogTest( TabEtiketten )
91 PrintLog "Switch to Tabpage 'Labels'"
92 PrintLog "Check number of brands and types (see #i44801# for details)"
94 For iSheetFormat = 1 to 2
96 Select Case( iSheetFormat )
99 printlog "Continous is checked"
102 printlog "Sheet is checked"
105 PrintLog "There should be 10 brands in list"
106 For iBrandIndex = 1 to Marke.GetItemCount
108 Marke.Select( cBrandList( iBrandIndex ) )
109 printlog "- Brand: " & Marke.GetSelText
110 sTypes = Typ.GetItemCount
112 Select Case iBrandIndex
114 PrintLog "Avery/A4 should have 295 types in list if 'Sheet' is checked"
115 PrintLog "Avery/A4 should have 1 type in list if 'Continous' is checked"
116 if ( iSheetFormat = 1 ) then vTypes = 1 else vTypes = 295
118 PrintLog "Avery A4/Asia should have 88 types in list if 'Sheet' is checked"
119 PrintLog "Avery A4/Asia should have 1 type in list if 'Continous' is checked"
120 if ( iSheetFormat = 1 ) then vTypes = 1 else vTypes = 88
122 PrintLog "Avery Lettersize should have 251 types in list if 'Sheet' is checked"
123 PrintLog "Avery Lettersize should have 45 types in list if 'Continous' is checked"
124 if ( iSheetFormat = 1 ) then vTypes = 45 else vTypes = 251
126 PrintLog "Avery Zweckform should have 333 types in list if 'Sheet' is checked"
127 PrintLog "Avery Zweckform should have 67 types in list if 'Continous' is checked"
128 if ( iSheetFormat = 1 ) then vTypes = 67 else vTypes = 333
130 PrintLog "Herlitz should have 26 types in list if 'Sheet' is checked"
131 PrintLog "Herlitz should have 6 types in list if 'Continous' is checked"
132 if ( iSheetFormat = 1 ) then vTypes = 6 else vTypes = 26
134 PrintLog "Herma A4 should have 492 types in list if 'Sheet' is checked"
135 PrintLog "Herma A4 should have 1 type in list if 'Continous' is checked"
136 if ( iSheetFormat = 1 ) then vTypes = 1 else vTypes = 492
138 PrintLog "Herma A5 should have 18 types in list if 'Sheet' is checked"
139 PrintLog "Herma A5 should have 1 type in list if 'Continous' is checked"
140 if ( iSheetFormat = 1 ) then vTypes = 1 else vTypes = 18
142 PrintLog "Herma endlos should have 1 type in list if 'Sheet' is checked"
143 PrintLog "Herma endlos should have 119 types in list if 'Continous' is checked"
144 if ( iSheetFormat = 1 ) then vTypes = 119 else vTypes = 1
146 PrintLog "Leitz should have 13 types in list if 'Sheet' is checked"
147 PrintLog "Leitz should have 1 type in list if 'Continous' is checked"
148 if ( iSheetFormat = 1 ) then vTypes = 1 else vTypes = 13
150 PrintLog "Sigel should have 20 types in list if 'Sheet' is checked"
151 PrintLog "Sigel should have 1 type in list if 'Continous' is checked"
152 if ( iSheetFormat = 1 ) then vTypes = 1 else vTypes = 20
154 Warnlog "- There are more than 10 brands in list"
156 if sTypes <> vTypes then Warnlog "- Not " & sTypes & " types in list but " & vTypes
158 For iType = 1 to Typ.GetItemCount
160 printlog "- Type: " & Typ.GetSelText
165 PrintLog "Switch to Tabpage 'Format'"
167 active.SetPage TabFormatEtiketten
170 Kontext "TabFormatEtiketten"
171 Call DialogTest (TabFormatEtiketten)
173 PrintLog "Click 'Save'"
174 FormatSpeichern.Click
176 Kontext "SaveLabelFormat"
177 if ( SaveLabelFormat.exists( 1 ) ) then
179 Call DialogTest (SaveLabelFormat)
181 PrintLog "Close dialog 'Save Label Format'"
182 SaveLabelFormat.Cancel
184 warnlog( "Dialog <SaveLabelFormat> is not available" )
187 Kontext "TabFormatEtiketten"
189 PrintLog "Switch to Tabpage 'Options'"
191 active.SetPage TabDruckerEtiketten
193 Kontext "TabDruckerEtiketten"
194 if ( TabDruckerEtiketten.exists( 1 ) ) then
195 Call DialogTest (TabDruckerEtiketten)
197 if ( gPlatgroup = "w95" or gPlatgroup = "wnt" ) then
198 PrintLog "Click printer setup for Windows"
201 PrintLog "Close printer-setup dialog"
202 Kontext "DruckerEinrichten"
203 if DruckerEinrichten.Exists( 2 ) then
204 DruckerEinrichten.Cancel
206 Warnlog "No Default Printer defined for the system, set one!"
209 printlog( "No printer setup for UNIX like OS" )
212 PrintLog "Check checkbox 'Synchronize contents'"
213 Kontext "TabDruckerEtiketten"
214 InhaltSynchronisieren.Check()
216 PrintLog "Click 'New document'"
219 printlog( "JSK: Unknown messagebox handled silently before refactoring" )
221 if ( Active.Exists( 1 ) ) then
222 warnlog( "Unexpected Messagebox: " & Active.getText()
224 printlog( "Click <ok>" )
227 Warnlog "Once Document has been opened, office asks to save it! BugID 89702"
232 PrintLog "Check if dialog 'Synchronize Labels' is up"
233 Kontext "EtikettenSynchronisieren"
234 if ( EtikettenSynchronisieren.Exists( 2 ) ) then
235 Call DialogTest ( EtikettenSynchronisieren )
236 Synchronisieren.Click
239 Warnlog " Dialog to synchronize labels not up!"
242 warnlog( "Tabpage <TabDruckerEtiketten> is not available" )
245 warnlog( "hCreateLabels() failed" )
248 PrintLog "Close active document"
252 '-----------------------------------------------------------
254 testcase tFileNewBusinessCards
256 QAErrorLog "#i102218# - tFileNewBusinessCards outcommented due to bug."
259 Dim iFormat as integer
260 Dim iBrand as integer
263 Dim sTypes as integer
264 Dim vTypes as integer
266 ' The brands have fixed names and should not change
267 dim cBrandList( 10 ) as string
268 cBrandList( 1 ) = "Avery A4"
269 cBrandList( 2 ) = "Avery A4/Asia"
270 cBrandList( 3 ) = "Avery Letter Size"
271 cBrandlist( 4 ) = "Avery Zweckform"
272 cBrandList( 5 ) = "Herlitz"
273 cBrandList( 6 ) = "Herma A4"
274 cBrandList( 7 ) = "Herma A5"
275 cBrandList( 8 ) = "Herma endlos"
276 cBrandList( 9 ) = "Leitz"
277 cBrandList( 10 ) = "Sigel"
280 PrintLog "Open Business Cards dialog with File / New / Business Cards"
281 if ( hCreateBusinessCards ) then
282 PrintLog "Switch to Tabpage 'Medium'"
284 Active.Setpage TabEtikettenMedium
286 Kontext "TabEtikettenMedium"
287 if ( TabEtikettenMedium.exists( 1 ) ) then
288 Call DialogTest (TabEtikettenMedium)
290 PrintLog "Check number of brands and types (see #i44801# for details)"
295 printlog "Continous is checked"
298 printlog "Sheet is checked"
301 PrintLog "There should be 10 brands in list"
302 For iBrand = 1 to Marke.GetItemCount
303 Marke.Select( cBrandList( iBrand ) )
304 printlog "- Brand: " & Marke.GetSelText
305 sTypes = Typ.GetItemCount
308 PrintLog "Avery/A4 should have 295 types in list if 'Sheet' is checked"
309 PrintLog "Avery/A4 should have 1 type in list if 'Continous' is checked"
310 if ( iFormat = 1 ) then vTypes = 1 else vTypes = 295
312 PrintLog "Avery A4/Asia should have 88 types in list if 'Sheet' is checked"
313 PrintLog "Avery A4/Asia should have 1 type in list if 'Continous' is checked"
314 if ( iFormat = 1 ) then vTypes = 1 else vTypes = 88
316 PrintLog "Avery Lettersize should have 251 types in list if 'Sheet' is checked"
317 PrintLog "Avery Lettersize should have 45 types in list if 'Continous' is checked"
318 if ( iFormat = 1 ) then vTypes = 45 else vTypes = 251
320 PrintLog "Avery Zweckform should have 333 types in list if 'Sheet' is checked"
321 PrintLog "Avery Zweckform should have 67 types in list if 'Continous' is checked"
322 if ( iFormat = 1 ) then vTypes = 67 else vTypes = 333
324 PrintLog "Herlitz should have 26 types in list if 'Sheet' is checked"
325 PrintLog "Herlitz should have 6 types in list if 'Continous' is checked"
326 if ( iFormat = 1 ) then vTypes = 6 else vTypes = 26
328 PrintLog "Herma A4 should have 492 types in list if 'Sheet' is checked"
329 PrintLog "Herma A4 should have 1 type in list if 'Continous' is checked"
330 if ( iFormat = 1 ) then vTypes = 1 else vTypes = 492
332 PrintLog "Herma A5 should have 18 types in list if 'Sheet' is checked"
333 PrintLog "Herma A5 should have 1 type in list if 'Continous' is checked"
334 if ( iFormat = 1 ) then vTypes = 1 else vTypes = 18
336 PrintLog "Herma endlos should have 1 type in list if 'Sheet' is checked"
337 PrintLog "Herma endlos should have 119 types in list if 'Continous' is checked"
338 if ( iFormat = 1 ) then vTypes = 119 else vTypes = 1
340 PrintLog "Leitz should have 13 types in list if 'Sheet' is checked"
341 PrintLog "Leitz should have 1 type in list if 'Continous' is checked"
342 if ( iFormat = 1 ) then vTypes = 1 else vTypes = 13
344 PrintLog "Sigel should have 20 types in list if 'Sheet' is checked"
345 PrintLog "Sigel should have 1 type in list if 'Continous' is checked"
346 if ( iFormat = 1 ) then vTypes = 1 else vTypes = 20
348 Warnlog "- There are more than 10 brands in list"
351 if sTypes <> vTypes then Warnlog "- Not " & sTypes & " types in list but " & vTypes
352 For iType = 1 to Typ.GetItemCount
354 printlog "- Type: " & Typ.GetSelText
359 PrintLog "Switch to Tabpage 'Business Cards'"
361 Active.Setpage TabVisitenkarten
363 warnlog( "Dialog <TabEtiketteMedium> not available" )
367 if ( Active.GetRT = 304 ) then
368 Warnlog( "UNexpected messagebox: " & Active.GetText() )
372 Kontext "TabVisitenkarten"
374 if Inhalt.IsVisible then
375 Call DialogTest (TabVisitenkarten)
382 PrintLog "Switch to Tabpage 'Private'"
384 Active.Setpage TabPrivat
387 Call DialogTest (TabPrivat)
389 PrintLog "Switch to Tabpage 'Business'"
391 Active.Setpage TabGeschaeft
393 Kontext "TabGeschaeft"
394 Call DialogTest (TabGeschaeft)
397 Active.Setpage TabFormatEtiketten
399 PrintLog "Switch to Tabpage 'Format'"
400 Kontext "TabFormatEtiketten"
401 Call DialogTest (TabFormatEtiketten)
403 PrintLog "Click pushbutton 'Save'"
404 FormatSpeichern.Click
406 PrintLog "Close upcoming dialog 'Save Label Format'"
407 Kontext "SaveLabelFormat"
409 Call DialogTest (SaveLabelFormat)
410 SaveLabelFormat.Cancel
412 Kontext "TabFormatEtiketten"
414 Active.Setpage TabZusaetzeEtiketten
416 Kontext "TabZusaetzeEtiketten"
417 Call DialogTest (TabZusaetzeEtiketten)
420 Kontext "DruckerEinrichten"
421 if ( DruckerEinrichten.Exists( 1 ) ) then
422 DruckerEinrichten.Cancel
424 Warnlog "No Default Printer configured for this system. Set one!"
427 Kontext "TabZusaetzeEtiketten"
428 PrintLog "Switch to Tabpage 'Options'"
429 PrintLog "Check Checkbox 'Syncronize contents"
430 InhaltSynchronisieren.Check
432 PrintLog "Click 'new Document'"
436 if ( Active.Exists( 2 ) ) then
441 Warnlog "Once Document has been opened, office asks to save it! BugID 89702"
445 PrintLog "Check i dialog 'Syncronize Labels' is up"
446 Kontext "EtikettenSynchronisieren"
447 if ( EtikettenSynchronisieren.Exists( 2 ) ) then
448 Call DialogTest ( EtikettenSynchronisieren )
449 Synchronisieren.Click
451 Warnlog "Dialog to synchronize Business Cards not up!"
454 PrintLog "Close active document"
457 warnlog( "Failed to create business cards" )
462 '-----------------------------------------------------------
466 printLog "- File / Open"
471 if ( OeffnenDlg.exists( 2 ) ) then
473 Call DialogTest ( OeffnenDlg )
475 PrintLog "Click 'Up one level'"
476 UebergeordneterOrdner.Click
481 PrintLog "Click button 'Default directory'"
488 PrintLog "Click Button 'New folder'"
489 if ( NeuerOrdner.exists() ) then
490 if ( NeuerOrdner.isVisible() ) then
491 if ( NeuerOrdner.IsEnabled() ) then
494 Kontext "NeuerOrdner"
495 if ( NeuerOrdner.exists( 1 ) ) then
496 PrintLog "Enter a foldername in upcoming dialog"
497 OrdnerName.SetText( "TT_Test" )
499 PrintLog "Close dialog with 'Cancel'"
502 warnlog( "Dialog <NeuerOrdner> not available" )
505 Warnlog( "New Folder button disabled" )
508 Warnlog( "New Folder button not visible" )
511 Warnlog( "New Folder button missing on dialog" )
516 warnlog( "File Open dialog is not available" )
518 PrintLog "Close File-Open-dialog with 'Cancel'"
521 '-----------------------------------------------------------
525 PrintLog "- File/Close"
527 PrintLog "Open new document"
530 PrintLog "Insert a table"
531 Call hTabelleEinfuegen
533 PrintLog "File / Close"
534 hUseAsyncSlot( "FileClose" )
536 PrintLog( "Cancel saving the document" )
538 if ( Active.exists( 1 ) ) then
541 Warnlog( "No warning for modified document" )
544 PrintLog "again File / Close"
545 hUseAsyncSlot( "FileClose" )
547 Printlog( "Confirm to save the document" )
549 if ( Active.exists( 1 ) ) then
552 warnlog( "No warning for modified document" )
555 PrintLog "Click 'Cancel' in File-Save-Dialog"
556 Kontext "SpeichernDlg"
557 if ( SpeichernDlg.Exists( 1 ) ) then
561 if Active.Exists() then
562 Warnlog Active.Gettext()
565 Warnlog( "File Save dialog not displayed, messagebox came up instead" )
569 PrintLog "Choose File / Close again"
570 hUseAsyncSlot( "FileClose" )
572 PrintLog "On upcoming messagebox click 'No'"
574 if ( Active.exists( 1 ) ) then
577 warnlog( "Expected messagebox missing" )
582 '-----------------------------------------------------------
586 PrintLog "- File/Save"
588 PrintLog "Open new document"
591 PrintLog "Insert a table"
592 Call hTabelleEinfuegen
594 PrintLog "Choose 'File / Save'"
597 Kontext "SpeichernDlg"
598 if ( SpeichernDlg.exists( 2 ) ) then
600 Call DialogTest ( SpeichernDlg )
601 PrintLog "In File-Dialog click 'Up one level'"
602 UebergeordneterOrdner.Click
607 PrintLog "Click 'Default directory'"
614 PrintLog "Click 'Create New Folder '"
615 if ( NeuerOrdner.exists() ) then
616 if ( NeuerOrdner.isVisible() ) then
617 if ( NeuerOrdner.IsEnabled() ) then
620 Kontext "NeuerOrdner"
621 if ( NeuerOrdner.exists( 1 ) ) then
623 PrintLog "Enter a foldername in upcoming dialog"
624 OrdnerName.SetText( "TT_Test" )
626 PrintLog "Close dialog with 'Cancel'"
629 warnlog( "Dialog <NeuerOrdner> not available" )
632 Warnlog( "New Folder button disabled" )
635 Warnlog( "New Folder button not visible" )
638 Warnlog( "New Folder button missing on dialog" )
641 Kontext "SpeichernDlg"
642 SpeichernDlg.cancel()
644 warnlog( "File Save dialog is not available" )
647 PrintLog "Close active document"
651 '-----------------------------------------------------------
653 testcase tFileSaveAll
655 PrintLog "- File / Save All"
657 PrintLog "Open new document"
660 PrintLog "Insert a table in document"
661 Call hTabelleEinfuegen
663 PrintLog "Open a second document"
666 PrintLog "Insert a table in second document"
667 Call hTabelleEinfuegen
669 PrintLog "Choose File / Save all"
672 PrintLog "Cancel 1. upcoming Filedialog"
673 Kontext "SpeichernDlg"
674 if ( SpeichernDlg.exists( 2 ) ) then
677 warnlog( "First File Save dialog is not available" )
680 PrintLog "Cancel 2. upcoming Filedialog"
681 Kontext "SpeichernDlg"
682 if ( SpeichernDlg.exists( 2 ) ) then
685 warnlog( "Second File Save dialog is not available" )
688 Kontext "SpeichernDlg"
689 if ( SpeichernDlg.exists( 1 ) ) then
690 warnlog( "Third, unexpected File Save dialog open" )
691 SpeichernDlg.cancel()
694 PrintLog "Close documents"
699 '-----------------------------------------------------------
703 PrintLog "- File / Save As"
705 PrintLog "Open new document"
708 PrintLog "Choose 'File / Save as'"
711 Kontext "SpeichernDlg"
712 if ( SpeichernDlg.exists( 1 ) ) then
714 Call DialogTest ( SpeichernDlg )
716 PrintLog "Click button 'Up one level'"
717 UebergeordneterOrdner.Click()
721 PrintLog "Click button 'Default Directory'"
728 PrintLog "Click button 'Create Folder'"
729 if ( NeuerOrdner.exists() ) then
730 if ( NeuerOrdner.isVisible() ) then
731 if ( NeuerOrdner.IsEnabled() ) then
734 Kontext "NeuerOrdner"
735 if ( NeuerOrdner.exists( 1 ) ) then
737 Printlog( "Name the folder" )
738 OrdnerName.SetText( "TT_Test" )
739 PrintLog "Close dialog with 'Cancel'"
742 warnlog( "Dialog <NeuerOrdner> not available" )
745 Warnlog( "New Folder button disabled" )
748 Warnlog( "New Folder button not visible" )
751 Warnlog( "New Folder button missing on dialog" )
754 Kontext "SpeichernDlg"
757 warnlog( "File Save dialog is not available" )
760 PrintLog "Close active document"
764 '-----------------------------------------------------------
766 testcase tFileSaveAsExport
768 QaErrorLog "#i93340# - Testcase outcommented due to bug with filter."
771 Dim xExport as string
772 Dim xExportFile as string
773 Dim CountDocu as integer
774 PrintLog "- File / Save As / Export with MS-filter"
776 Select Case gApplication
778 xExport = Convertpath( gTesttoolpath + "writer\required\input\st1_1.sxw" )
783 PrintLog "Open new document"
786 PrintLog "Open document '..\writer\required\input\st1_1.sxw"
787 Call hFileOpen(xExport)
789 Call sMakeReadOnlyDocumentEditable
791 PrintLog "Select Save as .. and choose 'Microsoft Word 97/2000/XP' as export-filter"
792 xExportFile = gOfficepath + "user\work\ecksport.doc"
793 Call hFileSaveAsWithFilterKill (xExportFile, "MS Word 2003 XML")
795 if ( hFileCloseAll() > 1 ) then
796 QAErrorlog "More than 1 document had to be closed!"
799 PrintLog "Close document"
804 '-----------------------------------------------------------
806 testcase tFileSaveWithPassword
808 Dim sFileName1 as string
809 dim sFileName2 as string
810 dim sFilePath as string
812 Printlog "- File / Save with Password"
813 Select Case gApplication
815 sFileName1 = "password.odt"
816 sFileName2 = "password2.odt"
817 Case "MASTERDOCUMENT"
818 sFileName1 = "password.odm"
819 sFileName2 = "password2.odm"
821 printlog "Not in Writer/Web!"
825 PrintLog "Open new document"
828 PrintLog "Enter some text into document"
829 Call wTypeKeys("This document will be saved with a password!")
831 sFilePath = ConvertPath ( gOfficePath + "user\work\" + sFileName1 )
832 hDeleteFile( sFilePath )
834 PrintLog "Choose File / Save as."
837 PrintLog "enter destination and check 'Password'"
838 Kontext "SpeichernDlg"
839 if ( SpeichernDlg.exists( 2 ) ) then
840 if ( Passwort.exists() ) then
841 if ( Passwort.isEnabled() ) then
844 warnlog( "FATAL: Password checkbox is not enabled" )
848 warnlog( "FATAL: Password checkbox does not exist" )
852 PrintLog "Save the document"
853 Dateiname.SetText( sFilePath )
856 printlog( "JSK: Unknown messagebox handled silently before refactoring" )
858 if ( Active.Exists (1) ) then
859 warnlog( "Unexpected messagebox: " & Active.getText() )
863 PrintLog "Password dialog has to come up"
864 Kontext "PasswordFileSave"
865 if ( PasswordFileSave.Exists( 1 ) ) then
867 PrintLog "Enter your password"
868 Password.SetText( "12345" )
870 PrintLog "Re-Enter a wrong passwort"
871 PasswordConfirm.Settext( "54321" )
874 Warnlog "- Password-Dialog not up !"
878 PrintLog "A messagebox has to come up, warns of wrong confirmation"
879 if ( Active.Exists( 1 ) )then
882 Warnlog "Able to save document with wrong password"
885 Kontext "PasswordFileSave"
886 if ( PasswordFileSave.Exists() ) then
887 PrintLog "Enter new password, and re-enter the same password"
888 Password.SetText( "12345" )
889 PasswordConfirm.SetText( "12345" )
892 Warnlog "- Password-Dialog not up !"
895 warnlog( "Dialog <SpeichernDlg> not available" )
899 PrintLog "Close the document"
900 hUseAsyncSlot( "FileClose" )
902 PrintLog "Open previous saved document"
903 hFileOpen( sFilePath )
905 Kontext "PasswordFileOpen"
906 PrintLog "Enter a wrong password."
907 if ( PasswordFileOpen.Exists() ) then
908 PasswortName.SetText( "34567" )
909 PasswordFileOpen.OK()
911 Warnlog "- Password-Dialog not up or Document couldn't be loaded!"
914 PrintLog "A messagebox has to come up, warns of wrong password"
916 if ( Active.Exists(1) ) then
917 printlog( "Warning for incorrect password -> good" )
920 Warnlog "Able to load document with wrong password"
923 Kontext "PasswordFileOpen"
924 PrintLog "Cancel Password dialog (not loading the document"
925 if ( PasswordFileOpen.Exists( 1 ) ) then
926 PasswordFileOpen.Cancel()
929 PrintLog "File / Open again your previous saved document"
930 hFileOpen( sFilePath )
932 PrintLog "Enter your password in password dialog"
933 Kontext "PasswordFileOpen"
934 if ( PasswordFileOpen.Exists() ) then
935 PasswortName.SetText( "12345" )
936 PasswordFileOpen.OK()
938 Warnlog "- Password-Dialog not up!"
941 ' Rename document, the old one is now obsolete
942 sFilePath = ConvertPath ( gOfficePath + "user\work\" + sFileName2 )
943 hDeleteFile( sFilePath )
946 PrintLog "File / Save as ..."
947 hUseAsyncSlot( "FileSaveAs" )
949 Kontext "SpeichernDlg"
950 if ( SpeichernDlg.exists( 2 ) ) then
952 printlog( "Verify that password setting is persistent" )
953 if ( Not Passwort.IsChecked ) then
954 if ( gPlatgroup = "unx" ) then
955 QAErrorlog "#i73968#Opening a password protected file looses focus after loading"
957 Warnlog "#i36015#Checkbox 'Save with password' is not checked in file-dialog !"
962 Dateiname.SetText( sFilePath )
965 printlog( "JSK: Unknown messagebox handled silently before refactoring" )
967 if ( Active.Exists( 2 ) ) then
968 printlog( "Messagebox: " & Active.getText() )
972 PrintLog "Click on 'Save' in file open dialog"
973 Kontext "PasswordFileSave"
974 if ( PasswordFileSave.Exists( 1 ) ) then
976 Password.SetText( "54321" )
977 PasswordConfirm.SetText( "54321" )
978 PasswordFileSave.OK()
980 PrintLog( "The password dialog should come up" )
981 hUseAsyncSlot( "FileClose" )
983 PrintLog "File / Close and open your document again"
984 hFileOpen( sFilePath )
986 Kontext "PasswordFileOpen"
987 if ( PasswordFileOpen.exists() ) then
988 PasswortName.SetText "54321"
991 warnlog( "Password dialog did not open" )
994 Warnlog "Passworddialog is not coming up on saving document"
998 warnlog( "Dialog <SpeichernDlg> not available" )
1000 PrintLog "Close active document"
1004 '-------------------------------------------------------------------------------
1006 testcase tFileReload
1011 Dim WriterFilterExtension(10) as string
1012 Dim MasterDocFilterExtension(10) as string
1014 WriterFilterExtension() = hGetFilternameExtension ( "writer8" )
1015 MasterDocFilterExtension() = hGetFilternameExtension ( "writerglobal8" )
1017 PrintLog "- File / Reload"
1018 Select Case gApplication
1020 sFile$ = "reload." & WriterFilterExtension(0)
1021 Case "MASTERDOCUMENT"
1022 sFile$ = "reload." & MasterDocFilterExtension(0)
1024 printlog "Not in Writer/Web!"
1028 PrintLog "Open new document"
1031 PrintLog "Enter some text, save and close document"
1032 Call wTypeKeys("File -> Reload!")
1033 Call hFileSaveAsKill ( gOfficePath + "user\work\" + sFile$ )
1036 if MessageBox.Exists (1) then
1037 WarnLog "Messagebox after saving and closing : " + MessageBox.GetText
1042 PrintLog "Open previous saved document"
1043 Call hFileOpen ( gOfficePath + "user\work\" + sFile$ )
1044 PrintLog "Insert a table in document"
1045 Call hTabelleEinfuegen
1046 PrintLog "File / Reload"
1049 PrintLog "Quit messagebox with 'No'"
1054 PrintLog "File / Reload again and quit messagebox with yes"
1061 PrintLog "Close active document"
1065 '-----------------------------------------------------------
1067 testcase tFileVersions
1069 Dim WriterFilterExtension(10) as string
1070 Dim MasterDocFilterExtension(10) as string
1072 WriterFilterExtension() = hGetFilternameExtension ( "writer8" )
1073 MasterDocFilterExtension() = hGetFilternameExtension ( "writerglobal8" )
1075 PrintLog "- File / Versions"
1076 Select Case gApplication
1078 sFile$ = "kann_weg." & WriterFilterExtension(0)
1079 Case "MASTERDOCUMENT"
1080 sFile$ = "kann_weg." & MasterDocFilterExtension(0)
1082 printlog "Not in Writer/Web!"
1086 PrintLog "Open new document"
1088 Call wTypeKeys ("File version")
1089 PrintLog "enter some text in documet and save it"
1090 Call hFileSaveAsKill(gOfficePath + "user\work\" + sFile$)
1094 PrintLog "Choose File / Versions"
1097 Warnlog "- File / Versions not accessible!"
1101 PrintLog "In Version-dialog click 'Save New Version'"
1103 Call DialogTest ( Versionen )
1105 PrintLog "Cancel dialog 'Insert version comment'"
1106 Kontext "VersionskommentarEingeben"
1107 Call DialogTest ( VersionskommentarEingeben )
1108 VersionskommentarEingeben.Cancel
1110 PrintLog "Close dialog"
1114 PrintLog "Close documents"
1115 Do Until GetDocumentCount = 0
1120 '-----------------------------------------------------------