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 : gregor.hartmann@oracle.com
30 '* short description : Update Test for Letter Wizard
32 '\******************************************************************************
34 testcase tUpdtWizardLetter
36 printlog( "Resource test for the letter-wizard" )
38 ' Build the filename we want to save the template as.
39 dim cTemplateName as string
40 cTemplateName = "FWK-Testtool-Template-letterWizard.ott"
42 dim cTemplatePath as string
43 cTemplatePath = gOfficePath & "user\template\" & cTemplateName
44 cTemplatePath = convertpath( cTemplatePath )
46 hDeleteUserTemplates()
51 kontext "AutopilotLetter"
52 if ( AutopilotLetter.exists( 2 ) ) then
54 if ( not autopilotletter.exists( 3 ) ) then
55 warnlog( "#i87733# Wizard does not start" )
60 printlog( " * Page: Page Design" )
61 call DialogTest( AutopilotLetter, 1 )
63 printlog( " * select a business letter" )
68 if ( active.exists( 1 ) ) then
69 warnlog( " * refusing to change the default template" )
74 kontext "Autopilotletter"
75 BusinessStyle.select( 2 )
79 if ( active.exists( 1 ) ) then
80 warnlog( " * refusing to change the default template" )
85 kontext "AutopilotLetter"
88 hClickButton( NextButton )
90 kontext "AutopilotLetter"
91 call DialogTest( AutopilotLetter, 2 )
93 printlog( " * check to add logo" )
96 printlog( " * change the metrics of the logo" )
97 LogoHeight.settext( "4" )
98 LogoWidth.settext( "4" )
99 LogoXpos.settext( "1" )
100 LogoYpos.settext( "1" )
102 printlog( " * check to add own address" )
103 ReturnAddress.check()
105 printlog( " * change the metrics of the address-field" )
106 AddressHeight.settext( "4" )
107 AddressWidth.settext( "4" )
108 AddressXpos.settext( "1" )
109 AddressYpos.settext( "1" )
111 printlog( " * check to show return-address in envelope window" )
112 ReturnAddressCompany.check()
114 printlog( " * UNcheck to add a footer" )
115 IncludeFooter.unCheck()
117 printlog( " * change the height" )
118 if ( FooterHeight.isEnabled() ) then
119 warnlog( "FooterHeight should not be enabled in this configuration" )
122 hClickButton( NextButton )
124 kontext "AutopilotLetter"
125 call DialogTest( AutopilotLetter, 3 )
127 printlog( " * change letterformat to the second entry" )
128 LetterPageNorm.select( 2 )
130 printlog( " * change salutation to the second entry" )
131 ListSalutation.select( 2 )
133 printlog( " * change Complimentary Close to second entry" )
134 ListGreetings.select( 2 )
135 hClickButton( NextButton )
137 kontext "AutopilotLetter"
138 call DialogTest( AutopilotLetter, 4 )
139 hClickButton( NextButton )
141 kontext "AutopilotLetter"
142 call DialogTest( AutopilotLetter, 5 )
144 printlog( " * enter some text as footer" )
145 TextFooter.settext( "Some non-offending text" )
147 printlog( " * check Include only on second ..." )
148 IncludeFromPage2.check()
149 hClickButton( NextButton )
151 kontext "AutopilotLetter"
152 call DialogTest( AutopilotLetter, 6 )
154 printlog( " * name the template for further usage" )
155 TemplateName.setText( cTemplateName )
156 hSetTemplateSavePath( cTemplatePath )
158 kontext "AutopilotLetter"
159 hClickButton( FinishButton )
162 kontext "UseOfThisTemplate"
163 if ( UseOfThisTemplate.exists( 2 ) ) then
164 printlog( "cancelling UseOfThisTemplate-dialog for OOo" )
165 UseOfThisTemplate.cancel()
167 qaerrorlog( "UseOfThisTemplate-dialog not present" )
171 if ( hHandleSaveError() = 1 ) then
172 kontext "AutopilotLetter"
173 hClickButton( FinishButton )
176 if ( not hDestroyDocument() ) then qaerrorlog( "#i59233# The wizard does not display the new template" )
178 warnlog( "Autopilot Letter not open/exceeded timeout" )
181 hDeleteFile( cTemplatePath )
183 if ( hDeleteUserTemplates() <> 0 ) then
184 printlog( "Unexpectedly deleted user template(s), please check")