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_001_.inc) ----------"
37 gApplication = "WRITER"
40 Call tFileNewBusinessCards
47 Call tFileSaveAsExport
48 Call tFileSaveWithPassword
54 '-----------------------------------------------------------
56 testcase tFileNewLabels
58 Dim iSheetFormat as integer
59 Dim iBrandIndex as integer
64 ' The brands have fixed names and should not change
65 dim cBrandList( 10 ) as string
66 cBrandList( 1 ) = "Avery A4"
67 cBrandList( 2 ) = "Avery A4/Asia"
68 cBrandList( 3 ) = "Avery Letter Size"
69 cBrandlist( 4 ) = "Avery Zweckform"
70 cBrandList( 5 ) = "Herlitz"
71 cBrandList( 6 ) = "Herma A4"
72 cBrandList( 7 ) = "Herma A5"
73 cBrandList( 8 ) = "Herma endlos"
74 cBrandList( 9 ) = "Leitz"
75 cBrandList( 10 ) = "Sigel"
77 PrintLog "Open Labels-dialog with File / New / Labels"
78 if ( hCreateLabels() ) then
80 Call DialogTest( TabEtiketten )
82 PrintLog "Switch to Tabpage 'Labels'"
83 PrintLog "Check number of brands and types (see #i44801# for details)"
85 For iSheetFormat = 1 to 2
87 kontext "TabEtiketten"
88 Select Case( iSheetFormat )
91 printlog "Continous is checked"
94 printlog "Sheet is checked"
97 PrintLog "There should be 10 brands in list"
98 For iBrandIndex = 1 to Marke.GetItemCount
100 Marke.Select( cBrandList( iBrandIndex ) )
101 printlog "- Brand: " & Marke.GetSelText
102 sTypes = Typ.GetItemCount
104 Select Case iBrandIndex
106 PrintLog "Avery/A4 should have 295 types in list if 'Sheet' is checked"
107 PrintLog "Avery/A4 should have 1 type in list if 'Continous' is checked"
108 if ( iSheetFormat = 1 ) then vTypes = 1 else vTypes = 295
110 PrintLog "Avery A4/Asia should have 88 types in list if 'Sheet' is checked"
111 PrintLog "Avery A4/Asia should have 1 type in list if 'Continous' is checked"
112 if ( iSheetFormat = 1 ) then vTypes = 1 else vTypes = 88
114 PrintLog "Avery Lettersize should have 251 types in list if 'Sheet' is checked"
115 PrintLog "Avery Lettersize should have 45 types in list if 'Continous' is checked"
116 if ( iSheetFormat = 1 ) then vTypes = 45 else vTypes = 251
118 PrintLog "Avery Zweckform should have 333 types in list if 'Sheet' is checked"
119 PrintLog "Avery Zweckform should have 67 types in list if 'Continous' is checked"
120 if ( iSheetFormat = 1 ) then vTypes = 67 else vTypes = 333
122 PrintLog "Herlitz should have 26 types in list if 'Sheet' is checked"
123 PrintLog "Herlitz should have 6 types in list if 'Continous' is checked"
124 if ( iSheetFormat = 1 ) then vTypes = 6 else vTypes = 26
126 PrintLog "Herma A4 should have 492 types in list if 'Sheet' is checked"
127 PrintLog "Herma A4 should have 1 type in list if 'Continous' is checked"
128 if ( iSheetFormat = 1 ) then vTypes = 1 else vTypes = 492
130 PrintLog "Herma A5 should have 18 types in list if 'Sheet' is checked"
131 PrintLog "Herma A5 should have 1 type in list if 'Continous' is checked"
132 if ( iSheetFormat = 1 ) then vTypes = 1 else vTypes = 18
134 PrintLog "Herma endlos should have 1 type in list if 'Sheet' is checked"
135 PrintLog "Herma endlos should have 119 types in list if 'Continous' is checked"
136 if ( iSheetFormat = 1 ) then vTypes = 119 else vTypes = 1
138 PrintLog "Leitz should have 13 types in list if 'Sheet' is checked"
139 PrintLog "Leitz should have 1 type in list if 'Continous' is checked"
140 if ( iSheetFormat = 1 ) then vTypes = 1 else vTypes = 13
142 PrintLog "Sigel should have 20 types in list if 'Sheet' is checked"
143 PrintLog "Sigel should have 1 type in list if 'Continous' is checked"
144 if ( iSheetFormat = 1 ) then vTypes = 1 else vTypes = 20
146 Warnlog "- There are more than 10 brands in list"
148 if sTypes <> vTypes then Warnlog "- Not " & sTypes & " types in list but " & vTypes
150 For iType = 1 to Typ.GetItemCount
152 printlog "- Type: " & Typ.GetSelText
157 PrintLog "Switch to Tabpage 'Format'"
159 active.SetPage TabFormatEtiketten
162 Kontext "TabFormatEtiketten"
163 Call DialogTest (TabFormatEtiketten)
165 PrintLog "Click 'Save'"
166 FormatSpeichern.Click
168 Kontext "SaveLabelFormat"
169 if ( SaveLabelFormat.exists( 1 ) ) then
171 Call DialogTest (SaveLabelFormat)
173 PrintLog "Close dialog 'Save Label Format'"
174 SaveLabelFormat.Cancel
176 warnlog( "Dialog <SaveLabelFormat> is not available" )
179 Kontext "TabFormatEtiketten"
181 PrintLog "Switch to Tabpage 'Options'"
183 active.SetPage TabDruckerEtiketten
185 Kontext "TabDruckerEtiketten"
186 if ( TabDruckerEtiketten.exists( 1 ) ) then
187 Call DialogTest (TabDruckerEtiketten)
189 if ( gPlatgroup = "w95" or gPlatgroup = "wnt" ) then
190 PrintLog "Click printer setup for Windows"
193 PrintLog "Close printer-setup dialog"
194 Kontext "DruckerEinrichten"
195 if DruckerEinrichten.Exists( 2 ) then
196 DruckerEinrichten.Cancel
198 Warnlog "No Default Printer defined for the system, set one!"
201 printlog( "No printer setup for UNIX like OS" )
204 PrintLog "Check checkbox 'Synchronize contents'"
205 Kontext "TabDruckerEtiketten"
206 InhaltSynchronisieren.Check()
208 PrintLog "Click 'New document'"
211 printlog( "JSK: Unknown messagebox handled silently before refactoring" )
213 if ( Active.Exists( 1 ) ) then
214 warnlog( "Unexpected Messagebox: " & Active.getText()
216 printlog( "Click <ok>" )
219 Warnlog "Once Document has been opened, office asks to save it! BugID 89702"
224 PrintLog "Check if dialog 'Synchronize Labels' is up"
225 Kontext "EtikettenSynchronisieren"
226 if ( EtikettenSynchronisieren.Exists( 2 ) ) then
227 Call DialogTest ( EtikettenSynchronisieren )
228 Synchronisieren.Click
231 Warnlog " Dialog to synchronize labels not up!"
234 warnlog( "Tabpage <TabDruckerEtiketten> is not available" )
237 warnlog( "hCreateLabels() failed" )
240 PrintLog "Close active document"
244 '-----------------------------------------------------------
246 testcase tFileNewBusinessCards
248 Dim iFormat as integer
249 Dim iBrand as integer
252 Dim sTypes as integer
253 Dim vTypes as integer
255 ' The brands have fixed names and should not change
256 dim cBrandList( 10 ) as string
257 cBrandList( 1 ) = "Avery A4"
258 cBrandList( 2 ) = "Avery A4/Asia"
259 cBrandList( 3 ) = "Avery Letter Size"
260 cBrandlist( 4 ) = "Avery Zweckform"
261 cBrandList( 5 ) = "Herlitz"
262 cBrandList( 6 ) = "Herma A4"
263 cBrandList( 7 ) = "Herma A5"
264 cBrandList( 8 ) = "Herma endlos"
265 cBrandList( 9 ) = "Leitz"
266 cBrandList( 10 ) = "Sigel"
269 PrintLog "Open Business Cards dialog with File / New / Business Cards"
270 if ( hCreateBusinessCards ) then
271 PrintLog "Switch to Tabpage 'Medium'"
273 Active.Setpage TabEtikettenMedium
275 Kontext "TabEtikettenMedium"
276 if ( TabEtikettenMedium.exists( 1 ) ) then
277 Call DialogTest (TabEtikettenMedium)
279 PrintLog "Check number of brands and types (see #i44801# for details)"
284 printlog "Continous is checked"
287 printlog "Sheet is checked"
290 PrintLog "There should be 10 brands in list"
291 For iBrand = 1 to Marke.GetItemCount
292 Marke.Select( cBrandList( iBrand ) )
293 printlog "- Brand: " & Marke.GetSelText
294 sTypes = Typ.GetItemCount
297 PrintLog "Avery/A4 should have 295 types in list if 'Sheet' is checked"
298 PrintLog "Avery/A4 should have 1 type in list if 'Continous' is checked"
299 if ( iFormat = 1 ) then vTypes = 1 else vTypes = 295
301 PrintLog "Avery A4/Asia should have 88 types in list if 'Sheet' is checked"
302 PrintLog "Avery A4/Asia should have 1 type in list if 'Continous' is checked"
303 if ( iFormat = 1 ) then vTypes = 1 else vTypes = 88
305 PrintLog "Avery Lettersize should have 251 types in list if 'Sheet' is checked"
306 PrintLog "Avery Lettersize should have 45 types in list if 'Continous' is checked"
307 if ( iFormat = 1 ) then vTypes = 45 else vTypes = 251
309 PrintLog "Avery Zweckform should have 333 types in list if 'Sheet' is checked"
310 PrintLog "Avery Zweckform should have 67 types in list if 'Continous' is checked"
311 if ( iFormat = 1 ) then vTypes = 67 else vTypes = 333
313 PrintLog "Herlitz should have 26 types in list if 'Sheet' is checked"
314 PrintLog "Herlitz should have 6 types in list if 'Continous' is checked"
315 if ( iFormat = 1 ) then vTypes = 6 else vTypes = 26
317 PrintLog "Herma A4 should have 492 types in list if 'Sheet' is checked"
318 PrintLog "Herma A4 should have 1 type in list if 'Continous' is checked"
319 if ( iFormat = 1 ) then vTypes = 1 else vTypes = 492
321 PrintLog "Herma A5 should have 18 types in list if 'Sheet' is checked"
322 PrintLog "Herma A5 should have 1 type in list if 'Continous' is checked"
323 if ( iFormat = 1 ) then vTypes = 1 else vTypes = 18
325 PrintLog "Herma endlos should have 1 type in list if 'Sheet' is checked"
326 PrintLog "Herma endlos should have 119 types in list if 'Continous' is checked"
327 if ( iFormat = 1 ) then vTypes = 119 else vTypes = 1
329 PrintLog "Leitz should have 13 types in list if 'Sheet' is checked"
330 PrintLog "Leitz should have 1 type in list if 'Continous' is checked"
331 if ( iFormat = 1 ) then vTypes = 1 else vTypes = 13
333 PrintLog "Sigel should have 20 types in list if 'Sheet' is checked"
334 PrintLog "Sigel should have 1 type in list if 'Continous' is checked"
335 if ( iFormat = 1 ) then vTypes = 1 else vTypes = 20
337 Warnlog "- There are more than 10 brands in list"
340 if sTypes <> vTypes then Warnlog "- Not " & sTypes & " types in list but " & vTypes
341 For iType = 1 to Typ.GetItemCount
343 printlog "- Type: " & Typ.GetSelText
348 PrintLog "Switch to Tabpage 'Business Cards'"
350 Active.Setpage TabVisitenkarten
352 warnlog( "Dialog <TabEtiketteMedium> not available" )
356 if ( Active.GetRT = 304 ) then
357 Warnlog( "Unexpected messagebox: " & Active.GetText() )
361 Kontext "TabVisitenkarten"
363 if Inhalt.IsVisible then
364 Call DialogTest (TabVisitenkarten)
371 PrintLog "Switch to Tabpage 'Private'"
373 Active.Setpage TabPrivat
376 Call DialogTest (TabPrivat)
378 PrintLog "Switch to Tabpage 'Business'"
380 Active.Setpage TabGeschaeft
382 Kontext "TabGeschaeft"
383 Call DialogTest (TabGeschaeft)
386 Active.Setpage TabFormatEtiketten
388 PrintLog "Switch to Tabpage 'Format'"
389 Kontext "TabFormatEtiketten"
390 Call DialogTest (TabFormatEtiketten)
392 PrintLog "Click pushbutton 'Save'"
393 FormatSpeichern.Click
395 PrintLog "Close upcoming dialog 'Save Label Format'"
396 Kontext "SaveLabelFormat"
398 Call DialogTest (SaveLabelFormat)
399 SaveLabelFormat.Cancel
401 Kontext "TabFormatEtiketten"
403 Active.Setpage TabZusaetzeEtiketten
405 Kontext "TabZusaetzeEtiketten"
406 Call DialogTest (TabZusaetzeEtiketten)
409 Kontext "DruckerEinrichten"
410 if ( DruckerEinrichten.Exists( 1 ) ) then
411 DruckerEinrichten.Cancel
413 Warnlog "No Default Printer configured for this system. Set one!"
416 Kontext "TabZusaetzeEtiketten"
417 PrintLog "Switch to Tabpage 'Options'"
418 PrintLog "Check Checkbox 'Syncronize contents"
419 InhaltSynchronisieren.Check
421 PrintLog "Click 'new Document'"
425 if ( Active.Exists( 2 ) ) then
430 Warnlog "Once Document has been opened, office asks to save it! BugID 89702"
434 PrintLog "Check i dialog 'Syncronize Labels' is up"
435 Kontext "EtikettenSynchronisieren"
436 if ( EtikettenSynchronisieren.Exists( 2 ) ) then
437 Call DialogTest ( EtikettenSynchronisieren )
438 Synchronisieren.Click
440 Warnlog "Dialog to synchronize Business Cards not up!"
443 PrintLog "Close active document"
446 warnlog( "Failed to create business cards" )
451 '-----------------------------------------------------------
455 printLog "- File / Open"
460 if ( OeffnenDlg.exists( 2 ) ) then
462 Call DialogTest ( OeffnenDlg )
464 PrintLog "Click 'Up one level'"
465 UebergeordneterOrdner.Click
470 PrintLog "Click button 'Default directory'"
477 PrintLog "Click Button 'New folder'"
478 if ( NeuerOrdner.exists() ) then
479 if ( NeuerOrdner.isVisible() ) then
480 if ( NeuerOrdner.IsEnabled() ) then
483 Kontext "NeuerOrdner"
484 if ( NeuerOrdner.exists( 1 ) ) then
485 PrintLog "Enter a foldername in upcoming dialog"
486 OrdnerName.SetText( "TT_Test" )
488 PrintLog "Close dialog with 'Cancel'"
491 warnlog( "Dialog <NeuerOrdner> not available" )
494 Warnlog( "New Folder button disabled" )
497 Warnlog( "New Folder button not visible" )
500 Warnlog( "New Folder button missing on dialog" )
505 warnlog( "File Open dialog is not available" )
507 PrintLog "Close File-Open-dialog with 'Cancel'"
510 '-----------------------------------------------------------
514 PrintLog "- File/Close"
516 PrintLog "Open new document"
519 PrintLog "Insert a table"
520 Call hTabelleEinfuegen
522 PrintLog "File / Close"
523 hUseAsyncSlot( "FileClose" )
525 PrintLog( "Cancel saving the document" )
527 if ( Active.exists( 1 ) ) then
530 Warnlog( "No warning for modified document" )
533 PrintLog "again File / Close"
534 hUseAsyncSlot( "FileClose" )
536 Printlog( "Confirm to save the document" )
538 if ( Active.exists( 1 ) ) then
541 warnlog( "No warning for modified document" )
544 PrintLog "Click 'Cancel' in File-Save-Dialog"
545 Kontext "SpeichernDlg"
546 if ( SpeichernDlg.Exists( 1 ) ) then
550 if Active.Exists() then
551 Warnlog Active.Gettext()
554 Warnlog( "File Save dialog not displayed, messagebox came up instead" )
558 PrintLog "Choose File / Close again"
559 hUseAsyncSlot( "FileClose" )
561 PrintLog "On upcoming messagebox click 'No'"
563 if ( Active.exists( 1 ) ) then
566 warnlog( "Expected messagebox missing" )
571 '-----------------------------------------------------------
575 PrintLog "- File/Save"
577 PrintLog "Open new document"
580 PrintLog "Insert a table"
581 Call hTabelleEinfuegen
583 PrintLog "Choose 'File / Save'"
586 Kontext "SpeichernDlg"
587 if ( SpeichernDlg.exists( 2 ) ) then
589 Call DialogTest ( SpeichernDlg )
590 PrintLog "In File-Dialog click 'Up one level'"
591 UebergeordneterOrdner.Click
596 PrintLog "Click 'Default directory'"
603 PrintLog "Click 'Create New Folder '"
604 if ( NeuerOrdner.exists() ) then
605 if ( NeuerOrdner.isVisible() ) then
606 if ( NeuerOrdner.IsEnabled() ) then
609 Kontext "NeuerOrdner"
610 if ( NeuerOrdner.exists( 1 ) ) then
612 PrintLog "Enter a foldername in upcoming dialog"
613 OrdnerName.SetText( "TT_Test" )
615 PrintLog "Close dialog with 'Cancel'"
618 warnlog( "Dialog <NeuerOrdner> not available" )
621 Warnlog( "New Folder button disabled" )
624 Warnlog( "New Folder button not visible" )
627 Warnlog( "New Folder button missing on dialog" )
630 Kontext "SpeichernDlg"
631 SpeichernDlg.cancel()
633 warnlog( "File Save dialog is not available" )
636 PrintLog "Close active document"
640 '-----------------------------------------------------------
642 testcase tFileSaveAll
644 PrintLog "- File / Save All"
646 PrintLog "Open new document"
649 PrintLog "Insert a table in document"
650 Call hTabelleEinfuegen
652 PrintLog "Open a second document"
655 PrintLog "Insert a table in second document"
656 Call hTabelleEinfuegen
658 PrintLog "Choose File / Save all"
661 PrintLog "Cancel 1. upcoming Filedialog"
662 Kontext "SpeichernDlg"
663 if ( SpeichernDlg.exists( 2 ) ) then
666 warnlog( "First File Save dialog is not available" )
669 PrintLog "Cancel 2. upcoming Filedialog"
670 Kontext "SpeichernDlg"
671 if ( SpeichernDlg.exists( 2 ) ) then
674 warnlog( "Second File Save dialog is not available" )
677 Kontext "SpeichernDlg"
678 if ( SpeichernDlg.exists( 1 ) ) then
679 warnlog( "Third, unexpected File Save dialog open" )
680 SpeichernDlg.cancel()
683 PrintLog "Close documents"
688 '-----------------------------------------------------------
692 PrintLog "- File / Save As"
694 PrintLog "Open new document"
697 PrintLog "Choose 'File / Save as'"
700 Kontext "SpeichernDlg"
701 if ( SpeichernDlg.exists( 1 ) ) then
703 Call DialogTest ( SpeichernDlg )
705 PrintLog "Click button 'Up one level'"
706 UebergeordneterOrdner.Click()
710 PrintLog "Click button 'Default Directory'"
717 PrintLog "Click button 'Create Folder'"
718 if ( NeuerOrdner.exists() ) then
719 if ( NeuerOrdner.isVisible() ) then
720 if ( NeuerOrdner.IsEnabled() ) then
723 Kontext "NeuerOrdner"
724 if ( NeuerOrdner.exists( 1 ) ) then
726 Printlog( "Name the folder" )
727 OrdnerName.SetText( "TT_Test" )
728 PrintLog "Close dialog with 'Cancel'"
731 warnlog( "Dialog <NeuerOrdner> not available" )
734 Warnlog( "New Folder button disabled" )
737 Warnlog( "New Folder button not visible" )
740 Warnlog( "New Folder button missing on dialog" )
743 Kontext "SpeichernDlg"
746 warnlog( "File Save dialog is not available" )
749 PrintLog "Close active document"
753 '-----------------------------------------------------------
755 testcase tFileSaveAsExport
757 QaErrorLog "#i93340# - Testcase outcommented due to bug with filter."
760 Dim xExport as string
761 Dim xExportFile as string
762 Dim CountDocu as integer
763 PrintLog "- File / Save As / Export with MS-filter"
765 Select Case gApplication
767 xExport = Convertpath( gTesttoolpath + "writer\required\input\st1_1.sxw" )
772 PrintLog "Open new document"
775 PrintLog "Open document '..\writer\required\input\st1_1.sxw"
776 Call hFileOpenLocally(xExport)
778 PrintLog "Select Save as .. and choose 'Microsoft Word 97/2000/XP' as export-filter"
779 xExportFile = gOfficepath + "user\work\ecksport.doc"
780 Call hFileSaveAsWithFilterKill (xExportFile, "MS Word 2003 XML")
782 if ( hFileCloseAll() > 1 ) then
783 QAErrorlog "More than 1 document had to be closed!"
786 PrintLog "Close document"
791 '-----------------------------------------------------------
793 testcase tFileSaveWithPassword
795 Dim sFileName1 as string
796 dim sFileName2 as string
797 dim sFilePath as string
799 Printlog "- File / Save with Password"
800 Select Case gApplication
802 sFileName1 = "password.odt"
803 sFileName2 = "password2.odt"
804 Case "MASTERDOCUMENT"
805 sFileName1 = "password.odm"
806 sFileName2 = "password2.odm"
808 printlog "Not in Writer/Web!"
812 PrintLog "Open new document"
815 PrintLog "Enter some text into document"
816 Call wTypeKeys("This document will be saved with a password!")
818 sFilePath = ConvertPath ( gOfficePath + "user\work\" + sFileName1 )
819 hDeleteFile( sFilePath )
821 PrintLog "Choose File / Save as."
824 PrintLog "enter destination and check 'Password'"
825 Kontext "SpeichernDlg"
826 if ( SpeichernDlg.exists( 2 ) ) then
827 if ( Passwort.exists() ) then
828 if ( Passwort.isEnabled() ) then
831 warnlog( "FATAL: Password checkbox is not enabled" )
835 warnlog( "FATAL: Password checkbox does not exist" )
839 PrintLog "Save the document"
840 Dateiname.SetText( sFilePath )
843 printlog( "JSK: Unknown messagebox handled silently before refactoring" )
845 if ( Active.Exists (1) ) then
846 warnlog( "Unexpected messagebox: " & Active.getText() )
850 PrintLog "Password dialog has to come up"
851 Kontext "PasswordFileSave"
852 if ( PasswordFileSave.Exists( 1 ) ) then
854 PrintLog "Enter your password"
855 Password.SetText( "12345" )
857 PrintLog "Re-Enter a wrong passwort"
858 PasswordConfirm.Settext( "54321" )
861 Warnlog "- Password-Dialog not up !"
865 PrintLog "A messagebox has to come up, warns of wrong confirmation"
866 if ( Active.Exists( 1 ) )then
869 Warnlog "Able to save document with wrong password"
872 Kontext "PasswordFileSave"
873 if ( PasswordFileSave.Exists() ) then
874 PrintLog "Enter new password, and re-enter the same password"
875 Password.SetText( "12345" )
876 PasswordConfirm.SetText( "12345" )
879 Warnlog "- Password-Dialog not up !"
882 warnlog( "Dialog <SpeichernDlg> not available" )
886 PrintLog "Close the document"
887 hUseAsyncSlot( "FileClose" )
889 PrintLog "Open previous saved document"
890 hFileOpen( sFilePath )
892 Kontext "PasswordFileOpen"
893 PrintLog "Enter a wrong password."
894 if ( PasswordFileOpen.Exists() ) then
895 PasswortName.SetText( "34567" )
896 PasswordFileOpen.OK()
898 Warnlog "- Password-Dialog not up or Document couldn't be loaded!"
901 PrintLog "A messagebox has to come up, warns of wrong password"
903 if ( Active.Exists(1) ) then
904 printlog( "Warning for incorrect password -> good" )
907 Warnlog "Able to load document with wrong password"
910 Kontext "PasswordFileOpen"
911 PrintLog "Cancel Password dialog (not loading the document"
912 if ( PasswordFileOpen.Exists( 1 ) ) then
913 PasswordFileOpen.Cancel()
916 PrintLog "File / Open again your previous saved document"
917 hFileOpen( sFilePath )
919 PrintLog "Enter your password in password dialog"
920 Kontext "PasswordFileOpen"
921 if ( PasswordFileOpen.Exists() ) then
922 PasswortName.SetText( "12345" )
923 PasswordFileOpen.OK()
925 Warnlog "- Password-Dialog not up!"
928 ' Rename document, the old one is now obsolete
929 sFilePath = ConvertPath ( gOfficePath + "user\work\" + sFileName2 )
930 hDeleteFile( sFilePath )
933 PrintLog "File / Save as ..."
934 hUseAsyncSlot( "FileSaveAs" )
936 Kontext "SpeichernDlg"
937 if ( SpeichernDlg.exists( 2 ) ) then
939 printlog( "Verify that password setting is persistent" )
940 if ( Not Passwort.IsChecked ) then
941 if ( gPlatgroup = "unx" ) then
942 QAErrorlog "#i73968#Opening a password protected file looses focus after loading"
944 Warnlog "#i36015#Checkbox 'Save with password' is not checked in file-dialog !"
949 Dateiname.SetText( sFilePath )
952 printlog( "JSK: Unknown messagebox handled silently before refactoring" )
954 if ( Active.Exists( 2 ) ) then
955 printlog( "Messagebox: " & Active.getText() )
959 PrintLog "Click on 'Save' in file open dialog"
960 Kontext "PasswordFileSave"
961 if ( PasswordFileSave.Exists( 1 ) ) then
963 Password.SetText( "54321" )
964 PasswordConfirm.SetText( "54321" )
965 PasswordFileSave.OK()
967 PrintLog( "The password dialog should come up" )
968 hUseAsyncSlot( "FileClose" )
970 PrintLog "File / Close and open your document again"
971 hFileOpen( sFilePath )
973 Kontext "PasswordFileOpen"
974 if ( PasswordFileOpen.exists() ) then
975 PasswortName.SetText "54321"
978 warnlog( "Password dialog did not open" )
981 Warnlog "Passworddialog is not coming up on saving document"
985 warnlog( "Dialog <SpeichernDlg> not available" )
987 PrintLog "Close active document"
991 '-------------------------------------------------------------------------------
998 Dim WriterFilterExtension(10) as string
999 Dim MasterDocFilterExtension(10) as string
1001 WriterFilterExtension() = hGetFilternameExtension ( "writer8" )
1002 MasterDocFilterExtension() = hGetFilternameExtension ( "writerglobal8" )
1004 PrintLog "- File / Reload"
1005 Select Case gApplication
1007 sFile$ = "reload." & WriterFilterExtension(0)
1008 Case "MASTERDOCUMENT"
1009 sFile$ = "reload." & MasterDocFilterExtension(0)
1011 printlog "Not in Writer/Web!"
1015 PrintLog "Open new document"
1018 PrintLog "Enter some text, save and close document"
1019 Call wTypeKeys("File -> Reload!")
1020 Call hFileSaveAsKill ( gOfficePath + "user\work\" + sFile$ )
1023 if MessageBox.Exists (1) then
1024 WarnLog "Messagebox after saving and closing : " + MessageBox.GetText
1029 PrintLog "Open previous saved document"
1030 hFileOpen( gOfficePath + "user\work\" + sFile$ )
1031 PrintLog "Insert a table in document"
1032 Call hTabelleEinfuegen
1033 PrintLog "File / Reload"
1036 PrintLog "Quit messagebox with 'No'"
1041 PrintLog "File / Reload again and quit messagebox with yes"
1048 PrintLog "Close active document"
1052 '-----------------------------------------------------------
1054 testcase tFileVersions
1056 Dim WriterFilterExtension(10) as string
1057 Dim MasterDocFilterExtension(10) as string
1059 WriterFilterExtension() = hGetFilternameExtension ( "writer8" )
1060 MasterDocFilterExtension() = hGetFilternameExtension ( "writerglobal8" )
1062 PrintLog "- File / Versions"
1063 Select Case gApplication
1065 sFile$ = "kann_weg." & WriterFilterExtension(0)
1066 Case "MASTERDOCUMENT"
1067 sFile$ = "kann_weg." & MasterDocFilterExtension(0)
1069 printlog "Not in Writer/Web!"
1073 PrintLog "Open new document"
1075 Call wTypeKeys ("File version")
1076 PrintLog "enter some text in documet and save it"
1077 Call hFileSaveAsKill(gOfficePath + "user\work\" + sFile$)
1081 PrintLog "Choose File / Versions"
1084 Warnlog "- File / Versions not accessible!"
1088 PrintLog "In Version-dialog click 'Save New Version'"
1090 Call DialogTest ( Versionen )
1092 PrintLog "Cancel dialog 'Insert version comment'"
1093 Kontext "VersionskommentarEingeben"
1094 Call DialogTest ( VersionskommentarEingeben )
1095 VersionskommentarEingeben.Cancel
1097 PrintLog "Close dialog"
1101 PrintLog "Close documents"
1102 Do Until GetDocumentCount = 0
1107 '-----------------------------------------------------------