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: wizard_mailmerge.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-09-04 09:17:13 $
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 : joerg.skottke@sun.com
36 '* short description : Update test for the mailmerge wizard
38 '\******************************************************************************
40 private CSV_DATABASE as string
42 testcase tUpdtWizardMailMerge
47 qaerrorlog( "#i54524# - MM-Wizard modifies datasource -> CVS merge conflict" )
49 CSV_DATABASE = hGetWorkPath() & "myDatabase"
50 hDeleteFile( CSV_DATABASE )
51 hRemoveDatabaseConnections()
53 '///<H1>Update test for Mailmerge Wizard</H1>
56 '///+<li>Make sure exactly one single writer document is open</li>
59 '///<li>Open the Mailmerge-Wizard</li>
60 printlog( "Open the Mailmerge-Wizard" )
65 Kontext "MailMergeWizard"
68 warnlog( "MailMergeWizard is not visible, aborting test" )
73 Kontext "MailMergeWizard"
74 brc = hClickNextButton()
78 Kontext "MailMergeWizard"
79 brc = hClickNextButton()
83 Kontext "MailMergeWizard"
84 brc = hClickNextButton()
88 Kontext "MailMergeWizard"
89 brc = hClickNextButton()
93 Kontext "MailMergeWizard"
94 brc = hClickNextButton()
98 Kontext "MailMergeWizard"
99 brc = hClickNextButton()
103 Kontext "MailMergeWizard"
104 brc = hClickNextButton()
108 '///<li>close the wizard</li>
109 printlog( "close the wizard" )
110 Kontext "MailMergeWizard"
111 MailMergeWizard.cancel()
113 hRemoveDatabaseConnections()
121 '**********************************************************************
123 function hUpdtMMWpage1() as boolean
125 '///<h3>Update test for Mailmerge Wizard - page 1</h3>
128 '///+<li>Nothing</li>
132 '///+<li>Errorstatus (boolean)</li>
134 '///+<li>Do not use</li>
137 '///<u>Description</u>:
141 const CFN = "hUpdtMMWpage1::"
143 '///+<li>Verify that the tabpage is open</li>
144 Kontext "TabMailMergeSourceDocument"
145 if ( not TabMailMergeSourceDocument.exists() ) then
146 warnlog( CFN & "Page 1 could not be accessed" )
147 hUpdtMMWPage1() = false
151 '///+<li>Click on Browse Document to open FileOpen</li>
152 Kontext "TabMailMergeSourceDocument"
153 if ( BrowseDocument.exists( 1 ) ) then
154 if ( BrowseDocument.isEnabled ) then
155 BrowseDocument.click()
157 '///+<li>Cancel FileOpen dialog</li>
159 if ( OeffnenDlg.exists( 1 ) ) then
160 printlog( CFN & "BrowseDocument::File Open Dialog" )
161 call dialogtest( OeffnenDlg )
164 warnlog( CFN & "BrowseDocument::FileOpen not open" )
167 warnlog( CFN & "BrowseDocument::Button is disabled" )
170 warnlog( CFN & "BrowseDocument::Button does not exist" )
173 '///+<li>Click on Browse Template to open the New...-dialog</li>
174 Kontext "TabMailMergeSourceDocument"
175 if ( BrowseTemplate.exists( 2 ) ) then
176 if ( BrowseTemplate.isEnabled ) then
177 BrowseTemplate.click()
179 '///+<li>Cancel the New...-dialog</li>
181 if ( Neu.exists( 1 ) ) then
182 printlog( CFN & "BrowseTemplate::New Dialog" )
183 call dialogtest( Neu )
186 warnlog( CFN & "BrowseTemplate::FileOpen not open" )
189 warnlog( CFN & "BrowseTemplate::Button is disabled" )
192 warnlog( CFN & "BrowseTemplate::Button does not exist" )
195 '///+<li>Check to create a new document</li>
196 kontext "TabMailMergeSourceDocument"
197 if ( CreateANewDocument.exists( 2 ) ) then
198 if ( CreateANewDocument.isEnabled ) then
199 printlog( CFN & "Check Create new Document" )
200 CreateANewDocument.check()
202 warnlog( CFN & "CheckBbox is disabled" )
205 warnlog( CFN & "CheckBox does not exist" )
208 hUpdtMMWPage1() = true
213 '**********************************************************************
215 function hUpdtMMWpage2()
217 '///<h3>Update test for Mailmerge Wizard - page 2</h3>
220 '///+<li>Nothing</li>
224 '///+<li>Nothing</li>
226 '///<u>Description</u>:
229 const CFN = "hUpdtMMWpage2::"
231 '///+<li>Verify that the tabpage is open</li>
232 Kontext "TabMailMergeDocumentType"
233 if ( not TabMailMergeDocumentType.exists( 2 ) ) then
234 warnlog( CFN & "Page 2 could not be accessed" )
238 call dialogtest( TabMailMergeDocumentType )
240 '///+<li>Check the Letter-checkbox</li>
241 printlog( CFN & "Select to create a letter" )
242 if ( Letter.exists() ) then
243 if ( Letter.isEnabled() ) then
246 warnlog( CFN & "Cannot check Letter-Checkbox" )
249 warnlog( CFN & "Letter Checkbox does not exist" )
255 '*******************************************************************************
257 function hUpdtMMWpage3()
259 '///<h3>Update test for Mailmerge Wizard - page 3</h3>
262 '///+<li>Nothing</li>
266 '///+<li>Nothing</li>
268 '///<u>Description</u>:
271 const CFN = "hUpdtMMWpage3::"
273 dim cDatabase as string
274 cDatabase = gTesttoolpath & "framework\required\input\mailmerge_data.odb"
275 cDatabase = convertpath( cDatabase )
277 '///+<li>Verify that the tabpage is open</li>
278 Kontext "TabMailMergeAddressBlock"
279 if ( not TabMailMergeAddressBlock.exists( 2 ) ) then
280 warnlog( CFN & "Page 3 could not be accessed" )
284 call Dialogtest( TabMailMergeAddressBlock )
286 '///+<li>Click "different addresslist" button and open all subsequent dialogs</li>
287 Kontext "TabMailMergeAddressBlock"
288 hSelectDifferentAddressList( cDatabase )
290 '///+<li>Click more button</li>
291 Kontext "TabMailMergeAddressBlock"
292 if ( AddressBlock.exists( 2 ) ) then
295 if( not AddressBlock.isChecked() ) then
296 warnlog( CFN & "AddressBlock Checkbox not checked" )
300 hSelectAddressBlock()
302 '///+<li>Click match fields button</li>
303 '///+<li>Assign any value to all of the listboxes</li>
304 hUpdtMailmergeMatchFields()
306 warnlog( CFN & "AddressBlock-Checkbox missing, skipping dialogs" )
313 '*******************************************************************************
315 function hUpdtMMWpage4()
317 '///<h3>Update test for Mailmerge Wizard - page 4</h3>
320 '///+<li>Nothing</li>
324 '///+<li>Nothing</li>
326 '///<u>Description</u>:
329 const CFN = "hUpdtMMWpage4::"
334 '///+<li>Verify that the tabpage is open</li>
335 Kontext "TabMailMergeGreetingsPage"
336 if ( not TabMailMergeGreetingsPage.exists( 2 ) ) then
337 warnlog( CFN & "Page 4 could not be accessed" )
341 call dialogtest( TabMailMergeGreetingsPage )
343 ' the salutation checkbox must be checked, otherwise the buttons are not
345 '///+<li>Verify that the Checkbox for Salutation is chaecked</li>
346 if ( not GreetingPersonalized.isEnabled() ) then
347 warnlog( CFN & "CheckBox Salutation not in HID.LST, it should be checked" )
351 '///+<li>Edit Addressblock for female salutation (GreetingsbuttonFemale)</li>
352 Kontext "TabMailMergeGreetingsPage"
353 printlog( CFN & "GreetingButtonFemale" )
354 if ( GreetingButtonFemale.isEnabled() ) then
355 hNewEditAddressBlock( 3 )
357 warnlog( CFN & "GreetingButtonFemale is not enabled" )
360 '///+<li>Edit Addressblock for female salutation (GreetingsbuttonMale)</li>
361 Kontext "TabMailMergeGreetingsPage"
362 printlog( CFN & "GreetingButtonMale" )
363 if ( GreetingButtonMale.isEnabled() ) then
364 hNewEditAddressBlock( 4 )
366 warnlog( CFN & "GreetingButtonMale is not enabled" )
369 '///+<li>Click the "Match Fields"-button</li>
370 Kontext "TabMailMergeGreetingsPage"
376 '**************************************************************************
378 function hUpdtMMWpage5()
380 '///<h3>Update test for Mailmerge Wizard - page 5</h3>
383 '///+<li>Nothing</li>
387 '///+<li>Nothing</li>
389 '///<u>Description</u>:
392 const CFN = "hUpdtMMWpage5::"
394 '///+<li>Verify that the tabpage is open</li>
395 kontext "TabMailMergeLayoutPage"
396 if ( not TabMailMergeLayoutPage.exists( 2 ) ) then
397 warnlog( CFN & "Page 5 could not be accessed" )
401 '///+<li>Change nothing, go to next page directly</li>
402 call DialogTest( TabMailMergeLayoutPage )
409 '**************************************************************************
411 function hUpdtMMWpage6()
413 '///<h3>Update test for Mailmerge Wizard - page 6</h3>
416 '///+<li>Nothing</li>
420 '///+<li>Nothing</li>
422 '///<u>Description</u>:
425 const CFN = "hUpdtMMWpage6::"
429 '///+<li>Verify that the tabpage is open</li>
430 kontext "TabMailMergePrepare"
431 if ( not TabMailMergePrepare.exists( 2 ) ) then
432 warnlog( CFN & "Page 6 could not be accessed" )
436 call DialogTest( TabMailMergePrepare )
438 '///+<li>Click the "Edit"-button</li>
439 qaerrorlog( "Skipping preview button" )
444 '**************************************************************************
446 function hUpdtMMWpage7()
448 '///<h3>Update test for Mailmerge Wizard - page 7</h3>
451 '///+<li>Nothing</li>
455 '///+<li>Nothing</li>
457 '///<u>Description</u>:
460 const CFN = "hUpdtMMWpage7::"
464 '///+<li>Verify that the tabpage is open</li>
465 kontext "TabMailMergePersonalize"
466 hWaitForObject( EditIndividualButton, 8000 )
467 'if ( not TabMailMergePersonalize.exists( 2 ) ) then
468 ' warnlog( CFN & "Page 7 could not be accessed" )
472 call DialogTest( TabMailMergePersonalize )
474 '///+<li>Click on "EditIndividual"-button</li>
475 qaerrorlog( "Skipping Preview-Button" )
480 '**************************************************************************
482 function hUpdtMMWpage8()
484 '///<h3>Update test for Mailmerge Wizard - page 8</h3>
487 '///+<li>Nothing</li>
491 '///+<li>Nothing</li>
493 '///<u>Description</u>:
496 const CFN = "hUpdtMMWpage8::"
498 '///+<li>Verify that the tabpage is open</li>
499 kontext "TabMailMergeOutputPage"
500 if ( not TabMailMergeOutputPage.exists( 2 ) ) then
501 warnlog( CFN & "Page 8 could not be accessed" )
507 call DialogTest( TabMailMergeOutputPage )
509 '///+<li>Check Save Document, go throught subsequent dialogs (if any)</li>
510 kontext "TabMailMergeOutputPage"
511 hSaveStartingDocument()
513 '///+<li>Check Save Mailmerge Document, go throught subsequent dialogs (if any)</li>
514 kontext "TabMailMergeOutputPage"
515 hSaveMailMergeDocument()
517 '///+<li>Check Print, go throught subsequent dialogs (if any)</li>
518 kontext "TabMailMergeOutputPage"
519 hPrintMailMergeDocument()
521 '///+<li>Check Send, go throught subsequent dialogs (if any)</li>
522 kontext "TabMailMergeOutputPage"
523 hSendMailMergeDocument()
528 '*******************************************************************************
530 function hSelectDifferentAddressList( cDatabase as string ) as boolean
532 '///<h3>Update test for "Select Address List" dialog</h3>
533 '///<i>Starting point: Page three of the Mail Merge Wizard</i><br>
536 '///+<li>Path/Name of the database (string)</li>
538 '///+<li>Valid, readable database</li>
543 '///+<li>Errorcondition (boolean)</li>
545 '///+<li>TRUE if all is ok</li>
546 '///+<li>FALSE on any other condition</li>
549 '///<u>Description</u>:
552 const CFN = "hSelectDifferentAddressList::"
556 dim iAddressList as integer
557 dim cAddressList as string
559 '///+<li>Click the "Select Address List..." button</li>
560 Kontext "TabMailMergeAddressBlock"
561 SelectAddressListButton.click()
563 '///+<li>Verify that the dialog is open</li>
564 Kontext "SelectAddressList"
565 if ( SelectAddressList.exists( 2 ) ) then
566 printlog( CFN & "Select Address List Dialog" )
567 call dialogtest( SelectAddressList )
569 warnlog( CFN & "SelectAddressList dialog is not open" )
570 hSelectDifferentAddressList() = false
574 '///+<li>Add the named database</li>
575 Kontext "SelectAddressList"
576 brc = hAddDatabase( cDatabase )
579 '///+<li>Make sure we have at least two databases to choose from</li>
580 Kontext "SelectAddressList"
581 if ( SelectAddressList.exists( 2 ) ) then
582 if ( AddressList.getItemCount() < 2 ) then
583 brc = hAddDatabase( cDatabase )
586 '///+<li>Create another address list, return</li>
587 Kontext "SelectAddressList"
588 brc = hEditCreateAddressList( 1 )
590 '///+<li>Open the filter dialog, work with it and return</li>
591 Kontext "SelectAddressList"
592 brc = hFilterDialog()
594 '///+<li>Edit the address list, return</li>
595 Kontext "SelectAddressList"
596 brc = hEditCreateAddressList( 2 )
598 '///+<li>Verify that the ok button is enabled for all address lists</li>
599 Kontext "SelectAddressList"
600 for iAddressList = 1 to AddressList.getItemCount()
602 AddressList.select( iAddressList )
603 cAddressList = AddressList.getText()
604 printlog( CFN & "Current address list: " & cAddressList )
607 SelectAddressList.ok()
611 qaerrorlog( CFN & "Ok-Button disabled for <" & cAddressList & ">" )
618 warnlog( "#i84250# OK button not enabled for any address list." )
621 warnlog( CFN & "Select Address List dialog is not open" )
627 Kontext "TabMailMergeAddressBlock"
628 hSelectDifferentAddressList() = brc
633 '*******************************************************************************
635 function hWaitForBackToWizardFloat() as boolean
637 '///<h3>Update test: Try to close the BackToWizard float</h3>
638 '///<i>Starting point: Edit individual document from Mail Merge Wizard
639 '///+ Back to wizard float must be visible</i><br>
642 '///+<li>Nothing</li>
646 '///+<li>Errorcondition (boolean)</li>
648 '///+<li>TRUE if all is ok</li>
649 '///+<li>FALSE on any other condition</li>
652 '///<u>Description</u>:
655 const CFN = "hWaitForBackToWizardFloat::"
658 printlog( CFN & "Enter" )
660 '///+<li>Try to grab the float (it is currently an "active"</li>
661 Kontext "MailMergeFloat"
662 if ( MailMergeFloat.exists( 20 ) ) then
663 printlog( CFN & "Back to document float is open" )
664 ReturnToMailMergeWizard.click()
666 '///+<li>Verify that we are back to the wizard (might take some time)</li>
667 Kontext "MailMergeWizard"
668 if ( MailMergeWizard.exists( 5 ) ) then
669 printlog( CFN & "Successfully returned to Mail Merge Wizard" )
672 warnlog( CFN & "Could not return to Mail Merge Wizard" )
676 warnlog( CFN & "Unable to access Mail Merge Float" )
680 printlog( CFN & "Exit with result = " & brc )
681 hWaitForBackToWizardFloat() = brc
686 '*******************************************************************************
688 function hAddDatabase( cDatabase as string ) as boolean
690 '///<h3>Update test for "Add Database" dialog</h3>
691 '///<i>Starting point: Select Address List dialog</i><br>
694 '///+<li>Path to database to be added (string)</li>
696 '///+<li>Database must be valid</li>
701 '///+<li>Errorcondition (boolean)</li>
703 '///+<li>TRUE if all is ok</li>
704 '///+<li>FALSE on any other condition</li>
707 '///<u>Description</u>:
710 const CFN = "hAddDatabase::"
717 '///+<li>Click "Add..."</li>
720 '///+<li>File Open dialog opens, enter filename</li>
722 if ( OeffnenDlg.exists( 2 ) ) then
723 printlog( CFN & "File Open Dialog" )
724 DateiName.setText( cDatabase )
728 warnlog( CFN & "FileOpen is missing" )
731 ' When a new addressdatabase is imported it might take some time before we
732 ' get back to the SelectAddressList dialog
733 '///+<li>Wait for the dialog to populate (might take an instant)</li>
734 hWaitForSelectAddressListDialog()
741 '******************************************************************************
743 function hEditCreateAddressList( iMode as integer ) as boolean
745 const CFN = "hEditCreateAddressList::"
752 Kontext "SelectAddressList"
754 case 1 : create.click()
755 case 2 : edit.click()
758 Kontext "NewAddressList"
759 if ( NewAddressList.exists( 2 ) ) then
760 printlog( CFN & "New/Edit Address List Dialog is open" )
761 call dialogtest( NewAddressList )
764 warnlog( CFN & "New/EditAddressList does not exist" )
768 hEditCreateAddressList() = brc
773 ' Try to use the Find-dialog, do not evaluate the returncode,
774 ' the test should continue even if the dialog does not come up.
777 ' Try to use the Customize-dialog, don't evaluate the rc either
778 brc = hCustomizeAddressList()
780 ' Return to "NewAddressList"
781 Kontext "NewAddressList"
784 ' only save when a new list has been created, editing saves automatically
785 if ( iMode = 1 ) then
786 hSaveNewAddressList()
789 hWaitForSelectAddressListDialog()
791 Kontext "SelectAddressList"
792 hEditCreateAddressList() = brc
796 '*******************************************************************************
798 function hFindDialog() as boolean
800 '///<h3>Update test for Mail Merge Wizard Find dialog</h3>
801 '///<i>Starting point: Select Address List dialog</i><br>
804 '///+<li>Nothing</li>
808 '///+<li>Errorcondition (boolean)</li>
810 '///+<li>TRUE if all is ok</li>
811 '///+<li>FALSE on any other condition</li>
814 '///<u>Description</u>:
817 const CFN = "hFindDialog::"
824 Kontext "NewAddressList"
828 if ( FindEntry.exists( 2 ) ) then
829 call dialogtest( FindEntry )
830 printlog( CFN & "Find Entry Dialog is open" )
834 warnlog( CFN & "Dialog is not open" )
837 Kontext "NewAddressList"
843 '******************************************************************************
845 function hCustomizeAddressList() as boolean
847 '///<h3>Update test for Mail Merge Wizard Customize Address List dialog</h3>
848 '///<i>Starting point: New Address List dialog</i><br>
851 '///+<li>Nothing</li>
853 '///+<li>Errorcondition (boolean)</li>
855 '///+<li>TRUE on success</li>
856 '///+<li>FALSE on failure</li>
859 '///<u>Description</u>:
863 const CFN = "hCustomizeAddressList::"
870 Kontext "NewAddressList"
871 if ( Customize.exists( 2 ) ) then
872 if ( Customize.isEnabled() ) then
875 kontext "CustomizeAddressList"
876 if ( CustomizeAddressList.exists( 2 ) ) then
877 printlog( CFN & "Customize Address List Dialog" )
878 call dialogtest( CustomizeAddressList )
880 kontext "CustomizeAddressList"
881 hAddRenameElement( "NewElement" , 1 )
883 kontext "CustomizeAddressList"
884 hAddRenameElement( "Renamed" , 2 )
886 kontext "CustomizeAddressList"
887 printlog( CFN & "Delete" )
890 kontext "CustomizeAddressList"
891 CustomizeAddressList.cancel()
894 warnlog( CFN & "Dialog is not open" )
897 warnlog( CFN & "Button is not enabled" )
900 warnlog( CFN & "Button does not exist" )
903 Kontext "NewAddressList"
904 hCustomizeAddressList() = brc
909 '************************************************************************************
911 function hAddRenameElement( cElementName as string , iMode as integer ) as boolean
913 const CFN = "hAddRenameElement::"
919 case 2 : Rename.click()
922 Kontext "RenameElement"
923 if ( RenameElement.exists( 2 ) ) then
924 printlog( CFN & "Add/Rename Element Dialog" )
925 call Dialogtest( RenameElement )
927 FieldTitle.setText( cElementName )
931 warnlog( CFN & "Dialog is not open" )
934 hAddRenameElement() = brc
938 '*******************************************************************************
940 function hFilterDialog() as integer
942 '///<h3>Update test for Mail Merge Wizard Filter dialog</h3>
943 '///<i>Starting point: Select Address List dialog</i><br>
946 '///+<li>Nothing</li>
948 '///+<li>Errorcondition (boolean)</li>
950 '///+<li>TRUE on success</li>
951 '///+<li>FALSE on failure</li>
954 '///<u>Description</u>:
957 const CFN = "hFilterDialog::"
962 Kontext "SelectAddressList"
963 if ( Filter.exists( 2 ) ) then
964 if ( Filter.isEnabled() ) then
967 kontext "FilterDialog"
968 if ( FilterDialog.exists( 2 ) ) then
969 printlog( CFN & "Filter Dialog" )
970 call Dialogtest( FilterDialog )
972 FilterDialog.cancel()
975 warnlog( "#i54150 " & CFN & "Filter dialog is not open" )
978 warnlog( CFN & "Filter Button is not enabled" )
981 warnlog( CFN & "Filter Button is missing" )
984 hWaitForSelectAddressListDialog()
985 hFilterDialog() = brc
990 '****************************************************************************
992 function hSelectAddressBlock() as boolean
994 const CFN = "hSelectAddressBlock::"
999 printlog( CFN & "More..." )
1001 Kontext "TabMailMergeAddressBlock"
1002 if ( more.exists( 2 ) ) then
1004 ' A dynamic delay (function borrowed from toolbar_tools.inc)
1005 hWaitForObject( more , 3000 )
1007 if ( more.isEnabled() ) then
1010 Kontext "SelectAddressBlock"
1011 if ( SelectAddressBlock.exists( 2 ) ) then
1012 printlog( CFN & "SelectAddressBlock dialog is open" )
1013 call DialogTest( SelectAddressBlock )
1015 Kontext "SelectAddressBlock"
1016 hNewEditAddressBlock( 1 )
1018 Kontext "SelectAddressBlock"
1019 hNewEditAddressBlock( 2 )
1021 Kontext "SelectAddressBlock"
1022 SelectAddressBlock.ok()
1025 warnlog( CFN & "Dialog is not open" )
1028 warnlog( CFN & "Button is disabled" )
1031 warnlog( CFN & "Button does not exist" )
1034 hSelectAddressBlock() = brc
1038 '*******************************************************************************
1040 function hNewEditAddressBlock( iMode as integer ) as boolean
1042 const CFN = "hNewEditAddressBlock::"
1045 case 1 : NewBtn.click()
1046 case 2 : Customize.click()
1047 case 3 : GreetingButtonFemale.click()
1048 case 4 : GreetingButtonMale.click()
1051 Kontext "NewAddressBlock"
1052 if ( NewAddressBlock.exists( 2 ) ) then
1053 printlog( cfn & "Dialog is open" )
1054 NewAddressBlock.cancel()
1055 hNewEditAddressBlock() = true
1057 warnlog( cfn & "Dialog is not open" )
1058 hNewEditAddressBlock() = false
1063 '*******************************************************************************
1065 function hSaveStartingDocument() as boolean
1067 const CFN = "hSaveStartingDocument::"
1072 if ( RBSaveStartDoc.exists( 2 ) ) then
1073 if ( RBSaveStartDoc.isEnabled ) then
1074 RBSaveStartDoc.check()
1077 warnlog( CFN & "Cannot set radiobutton" )
1080 warnlog( CFN & "Radiobutton is missing" )
1084 if ( PBSaveStartDoc.exists( 2 ) ) then
1085 if ( PBSaveStartDoc.isEnabled ) then
1086 PBSaveStartDoc.click()
1088 Kontext "SpeichernDlg"
1089 if ( SpeichernDlg.exists( 2 ) ) then
1090 printlog( CFN & "Save As Dialog is open" )
1091 SpeichernDlg.cancel()
1094 warnlog( CFN & "FileSave dialog is missing" )
1097 warnlog( CFN & "SaveStartDoc is disabled" )
1100 warnlog( CFN & "SaveStartDoc is missing" )
1103 hSaveStartingDocument() = brc
1107 '*******************************************************************************
1109 function hSaveMailMergeDocument() as boolean
1111 const CFN = "hSaveMailMergeDocument::"
1116 if ( RBSaveMergedDoc.exists( 2 ) ) then
1117 if ( RBSaveMergedDoc.isEnabled() ) then
1118 RBSaveMergedDoc.check()
1121 warnlog( CFN & "Cannot set radiobutton" )
1124 warnlog( CFN & "Radiobutton is missing" )
1128 if ( PBSaveNow.exists( 2 ) ) then
1129 if ( PBSaveNow.isEnabled() ) then
1132 Kontext "SpeichernDlg"
1133 if ( SpeichernDlg.exists( 2 ) ) then
1134 printlog( CFN & "Save As Dialog is open" )
1135 SpeichernDlg.cancel()
1138 warnlog( CFN & "FileSave dialog is missing" )
1141 warnlog( CFN & "Save Now is disabled" )
1144 warnlog( CFN & "Save Now is missing" )
1147 hSaveMailMergeDocument() = brc
1151 '*******************************************************************************
1153 function hPrintMailMergeDocument() as boolean
1155 const CFN = "hPrintMailMergeDocument::"
1160 if ( RBPrintMerged.exists( 2 ) ) then
1161 if ( RBPrintMerged.isEnabled() ) then
1162 RBPrintMerged.check()
1165 warnlog( CFN & "Cannot set radiobutton" )
1168 warnlog( CFN & "Radiobutton is missing" )
1171 if ( instr( gtSYSName , "win" ) > 0 ) then
1172 printlog( CFN & "Skipping printer dialog on windows" )
1173 hPrintMailMergeDocument() = true
1177 if ( lcase( gPlatform ) = "osx" ) then
1178 qaerrorlog( "#i81545# No printer settings on MacOS X" )
1179 hPrintMailMergeDocument() = true
1184 if ( PBPrinterSettings.exists( 2 ) ) then
1185 if ( PBPrinterSettings.isEnabled() ) then
1186 PBPrinterSettings.click()
1188 Kontext "TabSPAPaper"
1189 if ( TabSPAPaper.exists() ) then
1190 printlog( CFN & "Printer Settings Dialog" )
1194 warnlog( "#i89114# Printer Settings dialog is missing" )
1197 warnlog( CFN & "Printer Settings is disabled" )
1200 warnlog( CFN & "Printer Settings is missing" )
1203 hPrintMailMergeDocument() = brc
1207 '*******************************************************************************
1209 function hSendMailMergeDocument() as boolean
1211 const CFN = "hSendMailMergeDocument::"
1216 if ( RBSendAsMail.exists( 2 ) ) then
1217 if ( RBSendAsMail.isEnabled() ) then
1218 RBSendAsMail.check()
1220 warnlog( CFN & "Cannot set radiobutton" )
1223 warnlog( CFN & "Radiobutton is missing" )
1227 if ( PBCopyTo.exists( 2 ) ) then
1228 if ( PBCopyTo.isEnabled() ) then
1231 Kontext "CopyToDialog"
1232 if ( CopyToDialog.exists( 2 ) ) then
1233 printlog( CFN & "CopyToDialog is open" )
1234 call DialogTest( CopyToDialog )
1237 warnlog( CFN & "CopyToDialog dialog is missing" )
1240 warnlog( CFN & "PBCopyTo is disabled" )
1243 warnlog( CFN & "PBCopyTo is missing" )
1246 kontext "TabMailMergeOutputPage"
1247 if ( PBSendDocuments.exists( 2 ) ) then
1248 if ( PBSendDocuments.isEnabled() ) then
1249 PBSendDocuments.click()
1251 if ( active.exists( 2 ) ) then
1252 printlog( CFN & "Dialog asking for EMail-account is open" )
1253 call Dialogtest( active )
1256 kontext "TabMailMergeEmail"
1257 hMailMergeEmailDialog()
1259 warnlog( CFN & "Dialog asking for EMail-account is missing" )
1262 warnlog( CFN & "Send documents Button is disabled" )
1265 warnlog( CFN & "Send Documents Button is missing" )
1268 hSendMailMergeDocument() = brc
1272 '*******************************************************************************
1274 function hMailMergeEmailDialog() as boolean
1276 const CFN = "hMailMergeEmailDialog::"
1280 if ( TabMailMergeEmail.exists( 2 ) ) then
1281 printlog( CFN & "EMail Account Dialog is open" )
1284 warnlog( CFN & "EMail Account Dialog is not open" )
1288 ' server authentication
1289 if ( ServerAuthentication.exists( 2 ) ) then
1290 if ( ServerAuthentication.isEnabled() ) then
1291 ServerAuthentication.click()
1293 Kontext "ServerAuthentication"
1294 if ( ServerAuthentication.exists( 2 ) ) then
1295 printlog( CFN & "Server Authentication dialog is open" )
1296 call DialogTest( ServerAuthentication )
1297 ServerAuthentication.cancel()
1299 warnlog( CFN & "ServerAuthentication is not open" )
1302 warnlog( CFN & "ServerAuthentication-Button is not enabled" )
1305 warnlog( CFN & "ServerAuthentication-Button does not exist" )
1310 kontext "TabMailMergeEmail"
1311 if ( TestSettings.exists( 2 ) ) then
1312 if ( TestSettings.isEnabled() ) then
1313 TestSettings.click()
1315 kontext "TestAccountSettings"
1316 if ( TestAccountSettings.exists( 2 ) ) then
1317 printlog( CFN & "Test Account Settings Dialog is open" )
1318 call DialogTest( TestAccountSettings )
1319 TestAccountSettings.cancel()
1321 warnlog( CFN & "Test Account Settings Dialog is not open" )
1324 warnlog( CFN & "Test Settings-button is disabled" )
1327 warnlog( CFN & "Test Settings-button is missing" )
1330 kontext "TabMailMergeEmail"
1331 TabMailMergeEmail.cancel()
1333 hMailMergeEmailDialog() = brc
1337 '*******************************************************************************
1339 function hWaitForSelectAddressListDialog() as boolean
1341 Kontext "SelectAddressList"
1342 if ( SelectAddressList.exists( 5 ) ) then
1343 hWaitForSelectAddressListDialog() = true
1345 hWaitForSelectAddressListDialog() = false
1351 '*******************************************************************************
1353 function hSaveNewAddressList()
1355 const CFN = "hSaveNewAddressList::"
1357 Kontext "SpeichernDlg"
1358 if ( SpeichernDlg.exists( 2 ) ) then
1360 DateiName.setText( CSV_DATABASE )
1364 if ( active.exists( 2 ) ) then
1365 warnlog( active.getText() )
1369 printlog( CFN & "File saved" )
1371 warnlog( CFN & "FileSave did not come up" )
1376 '*******************************************************************************
1378 function hRemoveDatabaseConnections() as integer
1380 const CFN = "hRemoveDatabaseConnections()::"
1381 const DEFAULT_DATABASE = "Bibliography"
1383 dim iConnectionCount as integer
1384 dim iCurrentConnection as integer
1385 dim cConnectionName as string
1386 dim bOptionsOpen as boolean : bOptionsOpen = true
1388 kontext "OptionenDlg"
1389 if ( not OptionenDlg.exists() ) then
1390 bOptionsOpen = false
1394 hToolsOptions( "DataSources", "Databases" )
1396 kontext "TabRegisteredDatabase"
1397 iConnectionCount = RegisteredDatabases.getItemCount()
1399 for iCurrentConnection = iConnectionCount to 1 step -1
1401 kontext "TabRegisteredDatabase"
1402 if ( TabRegisteredDatabase.exists( 2 ) ) then
1404 RegisteredDatabases.select( iCurrentConnection )
1405 cConnectionName = RegisteredDatabases.getSelText()
1406 printlog( CFN & "Current database: " & cConnectionName )
1408 if ( cConnectionName <> DEFAULT_DATABASE ) then
1411 if ( active.exists( 2 ) ) then
1414 warnlog( CFN & "Confirmation dialog for delete is missing" )
1417 printlog( CFN & "Not deleting default database connection" )
1420 warnlog( CFN & "Failed to set context to Registered Databases Tab" )
1423 next iCurrentConnection
1425 if ( not bOptionsOpen ) then
1426 kontext "OptionenDlg"
1430 hRemoveDatabaseConnections() = iConnectionCount - 1
1434 '*******************************************************************************
1436 function hUpdtMailmergeMatchFields() as boolean
1438 '///<h3>Assign random fields on the Match Fields dialog of the Mailmerge Wizard</h3>
1439 '///<i>Starting point: Match fields dialog</i><br>
1442 '///+<li>Nothing</li>
1446 '///+<li>Errorcondition (boolean)</li>
1448 '///+<li>TRUE on no error</li>
1449 '///+<li>FALSE otherwise</li>
1452 '///<u>Description</u>:
1455 const CFN = "hUpdtMailmergeMatchFields::"
1458 printlog( CFN & "Accessing Match Fields Dialog" )
1459 Kontext "TabMailMergeAddressBlock"
1460 MatchFieldsButton.click()
1462 '///+<li>Verify that the match fields dialog is open</li>
1463 kontext "MatchFields"
1464 if ( not MatchFields.exists( 2 ) ) then
1465 warnlog( CFN & "Unable to access Match Fields dialog" )
1469 '///+<li>Assign randomly one of the 8 values to each of the 14 listboxes</li>
1471 FirstName.select( 3 )
1472 LastName.select( 4 )
1474 Address1.select( 6 )
1475 Address2.select( 7 )
1480 PhonePrivate.select( 1 )
1481 PhoneBusiness.select( 2 )
1485 '///+<li>Return to the Mail Merge Wizard</li>
1487 printlog( CFN & "Leaving Match Fields Dialog" )
1492 hUpdtMailmergeMatchFields() = brc