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_218_.inc,v $
12 '* last change: $Author: vg $ $Date: 2008-08-18 12:25:03 $
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 '\***********************************************************************
44 Call HTMLToDRAWGraphicLinked
45 Call HTMLToDRAWControl
46 Call HTMLToDRAWFloatingFrame
50 ' ---------------------------------------------------------------------------------
52 testcase HTMLToDRAWText
54 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
55 printlog " + Jump to beginning of document "
56 printlog " + Select first paragraph "
57 printlog " + Copy selected text "
58 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html")
59 Call sMakeReadOnlyDocumentEditable
60 printlog " Jump to beginning of document "
61 Call wTypeKeys "<Mod1 Home>"
62 Call wTypeKeys "<Shift Down><Shift End>"
66 printlog " + Open new document "
68 printlog " + Edit / Paste Special "
73 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
79 printlog " Paste 'Text' in all available clipboard formats "
80 Kontext "InhaltEinfuegen"
81 if InhaltEinfuegen.Exists then
82 printlog " + Write Clipboard format under pasted content "
83 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"text")
84 printlog " + Save document as ..\user\work\html_to_draw_text.odg"
85 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_draw_text.odg", "draw8")
87 printlog " + Close saved document "
90 printlog " + Reopen saved document "
91 if hFileOpen (gOfficepath + "user\work\html_to_draw_text.odg",false) = false then
97 Warnlog "Unable to remove checkbox: " + Active.Gettext
103 printlog " + Close saved document "
106 Warnlog "Dialog 'Paste Special' is not up!"
110 printlog " Close active document "
111 Do Until GetDocumentCount = 0
116 ' ----------------------------------------------------------------------------------------------
118 testcase HTMLToDRAWField
119 gApplication = "HTML"
120 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
121 printlog " + Jump to beginning of document "
122 printlog " + Select paragraph with 'Date Field' "
123 printlog " + Copy selected text "
124 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html")
125 Call sMakeReadOnlyDocumentEditable
126 printlog " Jump to beginning of document "
127 Call wTypeKeys "<Mod1 Home>"
128 Call wTypeKeys "<Down>",2
129 Call wTypeKeys "<Home><Shift End>"
133 Call wTypeKeys "<Down>",1
134 Call wTypeKeys "<Home><Shift End>"
137 gApplication = "DRAW"
138 printlog " + Open new document "
140 printlog " + Edit / Paste Special "
145 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
151 printlog " Paste 'Field' in all available clipboard formats "
152 Kontext "InhaltEinfuegen"
153 if InhaltEinfuegen.Exists then
154 printlog " + Write Clipboard format under pasted content "
155 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"field")
156 printlog " + Save document as ..\user\work\html_to_draw_field.odg"
157 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_draw_field.odg", "draw8")
159 printlog " + Close saved document "
162 printlog " + Reopen saved document "
163 Call hFileOpen (gOfficepath + "user\work\html_to_draw_field.odg",false)
165 printlog " + Close saved document "
168 Warnlog "Dialog 'Paste Special' is not up!"
172 printlog " Close active document "
173 Do Until GetDocumentCount = 0
178 ' ----------------------------------------------------------------------------------------------
180 testcase HTMLToDRAWTable
181 gApplication = "HTML"
182 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
183 printlog " + Jump to beginning of document "
184 printlog " + Select 'Table' "
185 printlog " + Copy selected table "
186 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html")
187 Call sMakeReadOnlyDocumentEditable
188 printlog " Jump to beginning of document "
189 Call wTypeKeys "<Mod1 Home>"
190 Call wTypeKeys "<Down>",5
191 Call wTypeKeys "<Mod1 A>",2
194 gApplication = "DRAW"
195 printlog " + Open new document "
197 printlog " + Edit / Paste Special "
202 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
208 printlog " Paste 'Table' in all available clipboard formats "
209 Kontext "InhaltEinfuegen"
210 if InhaltEinfuegen.Exists then
211 printlog " + Write Clipboard format under pasted content "
212 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"table")
213 printlog " + Save document as ..\user\work\html_to_draw_table.odg"
214 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_draw_table.odg", "draw8")
216 printlog " + Close saved document "
219 printlog " + Reopen saved document "
220 Call hFileOpen (gOfficepath + "user\work\html_to_draw_table.odg",false)
222 printlog " + Close saved document "
225 Warnlog "Dialog 'Paste Special' is not up!"
229 printlog " Close active document "
230 Do Until GetDocumentCount = 0
235 ' ----------------------------------------------------------------------------------------------
237 testcase HTMLToDRAWGraphicLinked
238 gApplication = "HTML"
239 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
240 printlog " + Jump to beginning of document "
241 printlog " + Select 'Linked Graphic' "
242 printlog " + Copy selected Linked Graphic "
243 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html")
244 Call sMakeReadOnlyDocumentEditable
245 printlog " Jump to beginning of document "
246 Call wTypeKeys "<Mod1 Home>"
247 Call wTypeKeys ( "<Shift F4>" )
250 gApplication = "DRAW"
251 printlog " + Open new document "
253 printlog " + Edit / Paste Special "
258 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
264 printlog " Paste 'Linked Graphic' in all available clipboard formats "
265 Kontext "InhaltEinfuegen"
266 if InhaltEinfuegen.Exists then
267 printlog " + Write Clipboard format under pasted content "
268 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"graphicL")
269 printlog " + Save document as ..\user\work\html_to_draw_graphic1.odg"
270 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_draw_graphic1.odg", "draw8")
272 printlog " + Close saved document "
275 printlog " + Reopen saved document "
276 Call hFileOpen (gOfficepath + "user\work\html_to_draw_graphic1.odg",false)
278 printlog " + Close saved document "
281 Warnlog "Dialog 'Paste Special' is not up!"
285 printlog " Close active document "
286 Do Until GetDocumentCount = 0
291 ' ----------------------------------------------------------------------------------------------
293 testcase HTMLToDRAWControl
294 gApplication = "HTML"
295 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
296 printlog " + Jump to beginning of document "
297 printlog " + Select 'Control' "
298 printlog " + Copy selected Control "
299 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html")
300 Call sMakeReadOnlyDocumentEditable
301 printlog " Jump to beginning of document "
302 Call wTypeKeys "<Mod1 Home>"
303 Call wTypeKeys ( "<Shift F4>" )
304 Call wTypeKeys "<Tab>"
307 gApplication = "DRAW"
308 printlog " + Open new document "
310 printlog " + Edit / Paste Special "
315 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
321 printlog " Paste 'Control' in all available clipboard formats "
322 Kontext "InhaltEinfuegen"
323 if InhaltEinfuegen.Exists then
324 printlog " + Write Clipboard format under pasted content "
325 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"control")
326 printlog " + Save document as ..\user\work\html_to_draw_control.odg"
327 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_draw_control.odg", "draw8")
329 printlog " + Close saved document "
332 printlog " + Reopen saved document "
333 Call hFileOpen (gOfficepath + "user\work\html_to_draw_control.odg",false)
335 printlog " + Close saved document "
338 Warnlog "Dialog 'Paste Special' is not up!"
342 printlog " Close active document "
343 Do Until GetDocumentCount = 0
348 ' ----------------------------------------------------------------------------------------------
350 testcase HTMLToDRAWFloatingFrame
351 gApplication = "HTML"
352 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
353 printlog " + Jump to beginning of document "
354 printlog " + Select 'Floating Frame' "
355 printlog " + Copy selected Floating Frame "
356 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html")
357 Call sMakeReadOnlyDocumentEditable
358 printlog " Jump to beginning of document "
359 Call wTypeKeys "<Mod1 Home>"
360 Call wTypeKeys ( "<Shift F4>" )
361 Call wTypeKeys "<Tab>",2
365 Warnlog "Edit / Copy is disabled ! Maybe object not selected!"
369 gApplication = "DRAW"
370 printlog " + Open new document "
372 printlog " + Edit / Paste Special "
377 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
383 printlog " Paste 'Floating Frame' in all available clipboard formats "
384 Kontext "InhaltEinfuegen"
385 if InhaltEinfuegen.Exists then
386 printlog " + Write Clipboard format under pasted content "
387 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"control")
388 printlog " + Save document as ..\user\work\html_to_draw_float.odg"
389 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_draw_float.odg", "draw8")
391 printlog " + Close saved document "
394 printlog " + Reopen saved document "
395 Call hFileOpen (gOfficepath + "user\work\html_to_draw_float.odg",false)
397 printlog " + Close saved document "
400 Warnlog "Dialog 'Paste Special' is not up!"
404 printlog " Close active document "
405 Do Until GetDocumentCount = 0