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_letter.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-08-01 09:48:44 $
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 Letter Wizard
38 '\******************************************************************************
40 testcase tUpdtWizardLetter
46 ' Build the filename we want to save the template as.
47 dim cTemplateName as string
48 cTemplateName = "FWK-Testtool-Template-letterWizard.ott"
50 dim cTemplatePath as string
51 cTemplatePath = gOfficePath & "user\template\" & cTemplateName
52 cTemplatePath = convertpath( cTemplatePath )
54 hDeleteUserTemplates()
59 kontext "AutopilotLetter"
60 if ( AutopilotLetter.exists( 2 ) ) then
62 if ( not autopilotletter.exists( 3 ) ) then
63 warnlog( "#i87733# Wizard does not start" )
68 printlog( " * Page: Page Design" )
69 call DialogTest( AutopilotLetter, 1 )
71 printlog( " * select a business letter" )
76 if ( active.exists( 1 ) ) then
77 warnlog( " * refusing to change the default template" )
82 kontext "Autopilotletter"
83 BusinessStyle.select( 2 )
87 if ( active.exists( 1 ) ) then
88 warnlog( " * refusing to change the default template" )
93 kontext "AutopilotLetter"
98 kontext "AutopilotLetter"
99 call DialogTest( AutopilotLetter, 2 )
101 printlog( " * check to add logo" )
104 printlog( " * change the metrics of the logo" )
105 LogoHeight.settext( "4" )
106 LogoWidth.settext( "4" )
107 LogoXpos.settext( "1" )
108 LogoYpos.settext( "1" )
110 printlog( " * check to add own address" )
111 ReturnAddress.check()
113 printlog( " * change the metrics of the address-field" )
114 AddressHeight.settext( "4" )
115 AddressWidth.settext( "4" )
116 AddressXpos.settext( "1" )
117 AddressYpos.settext( "1" )
119 printlog( " * check to show return-address in envelope window" )
120 ReturnAddressCompany.check()
122 printlog( " * UNcheck to add a footer" )
123 IncludeFooter.unCheck()
125 printlog( " * change the height" )
126 if ( FooterHeight.isEnabled() ) then
127 warnlog( "FooterHeight should not be enabled in this configuration" )
132 kontext "AutopilotLetter"
133 call DialogTest( AutopilotLetter, 3 )
135 printlog( " * change letterformat to the second entry" )
136 LetterPageNorm.select( 2 )
138 printlog( " * change salutation to the second entry" )
139 ListSalutation.select( 2 )
141 printlog( " * change Complimentary Close to second entry" )
142 ListGreetings.select( 2 )
145 kontext "AutopilotLetter"
146 call DialogTest( AutopilotLetter, 4 )
149 kontext "AutopilotLetter"
150 call DialogTest( AutopilotLetter, 5 )
152 printlog( " * enter some text as footer" )
153 TextFooter.settext( "Some non-offending text" )
155 printlog( " * check Include only on second ..." )
156 IncludeFromPage2.check()
159 kontext "AutopilotLetter"
160 call DialogTest( AutopilotLetter, 6 )
162 printlog( " * name the template for further usage" )
163 TemplateName.setText( cTemplateName )
164 hSetTemplateSavePath( cTemplatePath )
169 kontext "UseOfThisTemplate"
170 if ( UseOfThisTemplate.exists( 2 ) ) then
171 printlog( "cancelling UseOfThisTemplate-dialog for OOo" )
172 UseOfThisTemplate.cancel()
174 qaerrorlog( "UseOfThisTemplate-dialog not present" )
178 iErr = hHandleSaveError()
180 kontext "AutopilotLetter"
184 brc = hDestroyDocument()
186 qaerrorlog( "#i59233# The wizard does not display the new template" )
189 warnlog( "Autopilot Letter not open/exceeded timeout" )
192 hDeleteFile( cTemplatePath )
194 irc = hDeleteUserTemplates()
196 printlog( "Unexpectedly deleted user template(s), please check")
199 do while( getDocumentCount() > 0 )
200 call hCloseDocument()