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_alternative_text.inc,v $
13 '* last change: $Author: hde $ $Date: 2008-08-18 12:30:39 $
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 : Test Alternative Text for objects in writer
38 '\************************************************************************
40 sub w_alternative_text
42 Call tPictureAlternativeText
43 Call tFrameAlternativeText
44 Call tOLEAlternativeText
49 '-------------------------------------------------------------------------
51 testcase tPictureAlternativeText
53 printlog "- New writer document"
56 printlog "- Insert a picture"
57 InsertGraphicsFromFile
58 Kontext "GrafikEinfuegenDlg"
59 Dateiname.Settext ConvertPath(gTesttoolpath + "writer\optional\input\alternative_text\jolink.jpg")
64 printlog "- Context menu on the picture, choose 'Description'"
66 ContextDescriptionObject
68 Warnlog "Seems picture is not selected => Description Object could not be opened"
71 printlog "- Type 'TitleText' in the Title field"
72 Kontext "DescriptionObject"
73 DescriptionTitle.Settext "TitleText"
75 printlog "- Type 'This Is A Description'"
76 DescriptionText.Settext "This Is A Description"
78 printlog "- Close the dialog"
81 printlog "- Context menu on the picture, choose 'Description'"
83 ContextDescriptionObject
85 Warnlog "Seems picture is not selected => Description Object could not be opened"
88 printlog "Check that the Title and Description fields have been saved correctly"
89 Kontext "DescriptionObject"
90 if DescriptionTitle.Gettext <> "TitleText" then
91 Warnlog "Object title gets lost. Not 'TitleText' but " & DescriptionTitle.Gettext
93 if DescriptionText.Gettext <> "This Is A Description" then
94 warnlog "Object description gets lost. Not 'This Is A Description' but " & DescriptionText.Gettext
96 DescriptionObject.Cancel
98 printlog "- Format - Picture"
101 printlog "The 'Alternative' field must be filled with the content of the Title field (='TitleText')"
103 Active.Setpage TabZusaetze
104 Kontext "TabZusaetze"
105 if Alternativtext.Gettext <> "TitleText" then
106 Warnlog "Alternatice text in pictures options is not set"
110 printlog "- Save the document"
111 Call hFileSaveAsKill ( gOfficePath + "user\work\tPictureAlternativeText.odt" )
115 Call hFileOpen ( gOfficePath + "user\work\tPictureAlternativeText.odt" )
117 Call wTypeKeys ("<SHIFT F4>")
119 printlog "Check that the Title and Description fields have been saved correctly"
121 ContextDescriptionObject
123 Warnlog "Seems picture is not selected => Description Object could not be opened"
126 Kontext "DescriptionObject"
127 if DescriptionTitle.Gettext <> "TitleText" then
128 Warnlog "Object title gets lost. Not 'TitleText' but " & DescriptionTitle.Gettext
130 if DescriptionText.Gettext <> "This Is A Description" then
131 warnlog "Object description gets lost. Not 'This Is A Description' but " & DescriptionText.Gettext
133 DescriptionObject.Cancel
135 printlog "- Format - Picture"
138 Active.Setpage TabZusaetze
139 Kontext "TabZusaetze"
140 if Alternativtext.Gettext <> "TitleText" then
141 Warnlog "Alternatice text in pictures options is not set after save and reload"
145 printlog "- close document"
150 '-------------------------------------------------------------------------
152 testcase tFrameAlternativeText
154 printlog "- New writer document"
157 printlog "- Insert a frame"
160 printlog "- Context menu on the frame, choose 'Description'"
162 ContextDescriptionObject
164 Warnlog "Seems Frame is not selected => Description Object could not be opened"
167 printlog "- Type 'TitleText' in the Title field"
168 Kontext "DescriptionObject"
169 DescriptionTitle.Settext "TitleText"
171 printlog "- Type 'This Is A Description'"
172 DescriptionText.Settext "This Is A Description"
174 printlog "- Close the dialog"
177 printlog "- Context menu on the frame, choose 'Description'"
179 ContextDescriptionObject
181 Warnlog "Seems frame is not selected => Description Object could not be opened"
184 printlog "Check that the Title and Description fields have been saved correctly"
185 Kontext "DescriptionObject"
186 if DescriptionTitle.Gettext <> "TitleText" then
187 Warnlog "Object title gets lost. Not 'TitleText' but " & DescriptionTitle.Gettext
189 if DescriptionText.Gettext <> "This Is A Description" then
190 warnlog "Object description gets lost. Not 'This Is A Description' but " & DescriptionText.Gettext
192 DescriptionObject.Cancel
194 printlog "- Save the document"
195 Call hFileSaveAsKill ( gOfficePath + "user\work\tFrameAlternativeText.odt" )
199 Call hFileOpen ( gOfficePath + "user\work\tFrameAlternativeText.odt" )
201 Call wTypeKeys ("<SHIFT F4>")
203 printlog "Check that the Title and Description fields have been saved correctly"
205 ContextDescriptionObject
207 Warnlog "Seems frame is not selected => Description Object could not be opened"
210 Kontext "DescriptionObject"
211 if DescriptionTitle.Gettext <> "TitleText" then
212 Warnlog "Object title gets lost. Not 'TitleText' but " & DescriptionTitle.Gettext
214 if DescriptionText.Gettext <> "This Is A Description" then
215 warnlog "Object description gets lost. Not 'This Is A Description' but " & DescriptionText.Gettext
217 DescriptionObject.Cancel
219 printlog "- close document"
225 '-------------------------------------------------------------------------
227 testcase tOLEAlternativeText
229 printlog "- New writer document"
232 printlog "- Insert a OLE"
233 InsertObjectOLEObject
234 Kontext "OLEObjektEinfuegen"
236 OLEObjektEinfuegen.Ok
238 Call gMouseClick (10,10)
239 Call wTypeKeys "<SHIFT F4>"
241 printlog "- Context menu on the OLE, choose 'Description'"
243 ContextDescriptionObject
245 Warnlog "Seems OLE is not selected => Description Object could not be opened"
248 printlog "- Type 'TitleText' in the Title field"
249 Kontext "DescriptionObject"
250 DescriptionTitle.Settext "TitleText"
252 printlog "- Type 'This Is A Description'"
253 DescriptionText.Settext "This Is A Description"
255 printlog "- Close the dialog"
258 printlog "- Context menu on the OLE, choose 'Description'"
260 ContextDescriptionObject
262 Warnlog "Seems OLE is not selected => Description Object could not be opened"
265 printlog "Check that the Title and Description fields have been saved correctly"
266 Kontext "DescriptionObject"
267 if DescriptionTitle.Gettext <> "TitleText" then
268 Warnlog "Object title gets lost. Not 'TitleText' but " & DescriptionTitle.Gettext
270 if DescriptionText.Gettext <> "This Is A Description" then
271 warnlog "Object description gets lost. Not 'This Is A Description' but " & DescriptionText.Gettext
273 DescriptionObject.Cancel
275 printlog "- Save the document"
276 Call hFileSaveAsKill ( gOfficePath + "user\work\tOLEAlternativeText.odt" )
280 Call hFileOpen ( gOfficePath + "user\work\tOLEAlternativeText.odt" )
282 Call wTypeKeys ("<SHIFT F4>")
284 printlog "Check that the Title and Description fields have been saved correctly"
286 ContextDescriptionObject
288 Warnlog "Seems OLE is not selected => Description Object could not be opened"
291 Kontext "DescriptionObject"
292 if DescriptionTitle.Gettext <> "TitleText" then
293 Warnlog "Object title gets lost. Not 'TitleText' but " & DescriptionTitle.Gettext
295 if DescriptionText.Gettext <> "This Is A Description" then
296 warnlog "Object description gets lost. Not 'This Is A Description' but " & DescriptionText.Gettext
298 DescriptionObject.Cancel
300 printlog "- close document"