1 '**************************************************************************
2 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 '* Copyright 2008 by Sun Microsystems, Inc.
6 '* OpenOffice.org - a multi-platform office productivity suite
8 '* $RCSfile: w_216_.inc,v $
12 '* last change: $Author: rt $ $Date: 2008-09-04 09:18:55 $
14 '* This file is part of OpenOffice.org.
16 '* OpenOffice.org is free software: you can redistribute it and/or modify
17 '* it under the terms of the GNU Lesser General Public License version 3
18 '* only, as published by the Free Software Foundation.
20 '* OpenOffice.org is distributed in the hope that it will be useful,
21 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
22 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 '* GNU Lesser General Public License version 3 for more details
24 '* (a copy is included in the LICENSE file that accompanied this code).
26 '* You should have received a copy of the GNU Lesser General Public License
27 '* version 3 along with OpenOffice.org. If not, see
28 '* <http://www.openoffice.org/license.html>
29 '* for a copy of the LGPLv3 License.
31 '/************************************************************************
33 '* owner : helge.delfs@sun.com
35 '* short description : CROSS-APPLICATIONS CLIPBOARD TEST (Writer)
37 '\***********************************************************************
42 Call HTMLToWRITERField
43 Call HTMLToWRITERTable
44 Call HTMLToWRITERGraphicLinked
45 Call HTMLToWRITERControl
46 Call HTMLToWRITERFloatingFrame
50 ' ---------------------------------------------------------------------------------
52 testcase HTMLToWRITERText
55 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
56 printlog " Jump to beginning of document "
57 printlog " Select first paragraph "
58 printlog " Copy selected text "
59 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html",false)
60 Call sMakeReadOnlyDocumentEditable
62 printlog " Jump to beginning of document "
63 Call wTypeKeys "<Mod1 Home>"
64 Call wTypeKeys "<Shift Down><Shift End>"
67 Call wTypeKeys "<Home>"
68 gApplication = "WRITER"
70 printlog " Open new document "
72 printlog " Edit / Paste Special "
75 EditPasteSpecialWriter
77 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
83 printlog " Paste 'Text' in all available clipboard formats "
84 Kontext "InhaltEinfuegen"
85 if InhaltEinfuegen.Exists then
86 printlog " Write Clipboard format under pasted content "
87 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"text")
88 printlog " Save document as ..\user\work\html_to_writer_text.odt"
89 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_writer_text.odt", "writer8")
91 printlog " Close saved document "
94 printlog " Reopen saved document "
95 if hFileOpen (gOfficepath + "user\work\html_to_writer_text.odt",true) = false then
101 Warnlog "Unable to remove checkbox: " + Active.Gettext
107 printlog " Close saved document "
110 Warnlog "Dialog 'Paste Special' is not up!"
114 printlog " Close saved document "
118 ' ----------------------------------------------------------------------------------------------
120 testcase HTMLToWRITERField
121 gApplication = "HTML"
122 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
123 printlog " Jump to beginning of document "
124 printlog " Select paragraph with 'Date Field' "
125 printlog " Copy selected text "
126 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html")
127 Call sMakeReadOnlyDocumentEditable
128 printlog " Jump to beginning of document "
129 Call wTypeKeys "<Mod1 Home>"
130 Call wTypeKeys "<Down>",2
131 Call wTypeKeys "<Home><Shift End>"
134 gApplication = "WRITER"
135 printlog " Open new document "
137 printlog " Edit / Paste Special "
140 EditPasteSpecialWriter
142 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
148 printlog " Paste 'Field' in all available clipboard formats "
149 Kontext "InhaltEinfuegen"
150 if InhaltEinfuegen.Exists then
151 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"field")
152 printlog " Write Clipboard format under pasted content "
153 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_writer_field.odt", "writer8")
154 printlog " Save document as ..\user\work\html_to_writer_field.odt"
156 printlog " Close saved document "
159 printlog " Reopen saved document "
160 if hFileOpen (gOfficepath + "user\work\html_to_writer_field.odt",true) = false then
162 if Active.Exists then
166 Warnlog "Unable to remove checkbox: " + Active.Gettext
172 printlog " Close saved document "
175 Warnlog "Dialog 'Paste Special' is not up!"
179 printlog " Close saved document "
183 ' ----------------------------------------------------------------------------------------------
185 testcase HTMLToWRITERTable
186 gApplication = "HTML"
187 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
188 printlog " Jump to beginning of document "
189 printlog " Select 'Table' "
190 printlog " Copy selected table "
191 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html",false)
192 Call sMakeReadOnlyDocumentEditable
193 printlog " Jump to beginning of document "
194 Call wTypeKeys "<Mod1 Home>"
195 Call wTypeKeys "<Down>",5
196 Call wTypeKeys "<Mod1 A>",2
199 gApplication = "WRITER"
200 printlog " Open new document "
202 printlog " Edit / Paste Special "
205 EditPasteSpecialWriter
207 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
213 printlog " Paste 'Table' in all available clipboard formats "
214 Kontext "InhaltEinfuegen"
215 if InhaltEinfuegen.Exists then
216 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"table")
217 printlog " Write Clipboard format under pasted content "
218 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_writer_table.odt", "writer8")
219 printlog " Save document as ..\user\work\html_to_writer_table.odt"
222 printlog " Close saved document "
224 if hFileOpen (gOfficepath + "user\work\html_to_writer_table.odt",true) = false then
226 if Active.Exists then
230 Warnlog "Unable to remove checkbox: " + Active.Gettext
235 printlog " Reopen saved document "
237 printlog " Close saved document "
240 Warnlog "Dialog 'Paste Special' is not up!"
244 printlog " Close saved document "
248 ' ----------------------------------------------------------------------------------------------
250 testcase HTMLToWRITERGraphicLinked
251 gApplication = "HTML"
252 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
253 printlog " Jump to beginning of document "
254 printlog " Select 'Linked Graphic' "
255 printlog " Copy selected Linked Graphic "
256 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html",false)
257 Call sMakeReadOnlyDocumentEditable
258 printlog " Jump to beginning of document "
259 Call wTypeKeys "<Mod1 Home>"
260 Call wTypeKeys ( "<Shift F4>" )
263 gApplication = "WRITER"
264 printlog " Open new document "
266 printlog " Edit / Paste Special "
269 EditPasteSpecialWriter
271 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
277 printlog " Paste 'Linked Graphic' in all available clipboard formats "
278 Kontext "InhaltEinfuegen"
279 if InhaltEinfuegen.Exists then
280 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"graphicL")
281 printlog " Write Clipboard format under pasted content "
282 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_writer_graphic1.odt", "writer8")
283 printlog " Save document as ..\user\work\html_to_writer_graphic1.odt"
286 printlog " Close saved document "
288 Call hFileOpen (gOfficepath + "user\work\html_to_writer_graphic1.odt",false)
289 printlog " Reopen saved document "
291 printlog " Close saved document "
294 Warnlog "Dialog 'Paste Special' is not up!"
298 printlog " Close saved document "
302 ' ----------------------------------------------------------------------------------------------
304 testcase HTMLToWRITERControl
305 gApplication = "HTML"
306 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
307 printlog " Jump to beginning of document "
308 printlog " Select 'Control' "
309 printlog " Copy selected Control "
310 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html",false)
311 Call sMakeReadOnlyDocumentEditable
312 printlog " Jump to beginning of document "
313 Call wTypeKeys "<Mod1 Home>"
314 Call wTypeKeys ( "<Shift F4>" )
315 Call wTypeKeys "<Tab>"
318 gApplication = "WRITER"
319 printlog " Open new document "
321 printlog " Edit / Paste Special "
324 EditPasteSpecialWriter
326 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
332 printlog " Paste 'Control' in all available clipboard formats "
333 Kontext "InhaltEinfuegen"
334 if InhaltEinfuegen.Exists then
335 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"control")
336 printlog " Write Clipboard format under pasted content "
337 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_writer_control.odt", "writer8")
338 printlog " Save document as ..\user\work\html_to_writer_control.odt"
341 printlog " Close saved document "
343 Call hFileOpen (gOfficepath + "user\work\html_to_writer_control.odt",false)
344 printlog " Reopen saved document "
346 printlog " Close saved document "
349 Warnlog "Dialog 'Paste Special' is not up!"
353 printlog " Close saved document "
357 ' ----------------------------------------------------------------------------------------------
359 testcase HTMLToWRITERFloatingFrame
360 gApplication = "HTML"
361 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
362 printlog " Jump to beginning of document "
363 printlog " Select 'Floating Frame' "
364 printlog " Copy selected Floating Frame "
365 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html",false)
366 Call sMakeReadOnlyDocumentEditable
367 printlog " Jump to beginning of document "
368 Call wTypeKeys "<Mod1 Home>"
369 Call wTypeKeys ( "<Shift F4>" )
370 Call wTypeKeys "<Tab>",2
374 Warnlog "Edit / Copy is disabled ! Maybe object not selected !"
379 gApplication = "WRITER"
380 printlog " Open new document "
382 printlog " Edit / Paste Special "
385 EditPasteSpecialWriter
387 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
393 printlog " Paste 'Floating Frame' in all available clipboard formats "
394 Kontext "InhaltEinfuegen"
395 if InhaltEinfuegen.Exists then
396 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"control")
397 printlog " Write Clipboard format under pasted content "
398 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_writer_float.odt", "writer8")
399 printlog " Save document as ..\user\work\html_to_writer_float.odt"
402 printlog " Close saved document "
404 Call hFileOpen (gOfficepath + "user\work\html_to_writer_float.odt",false)
405 printlog " Reopen saved document "
408 printlog " Close saved document "
410 Warnlog "Dialog 'Paste Special' is not up!"
414 printlog " Close saved document "