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_219_.inc,v $
12 '* last change: $Author: vg $ $Date: 2008-08-18 12:25:15 $
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 '\***********************************************************************
41 Call HTMLToIMPRESSText
42 Call HTMLToIMPRESSField
43 Call HTMLToIMPRESSTable
44 Call HTMLToIMPRESSGraphicLinked
45 Call HTMLToIMPRESSControl
46 Call HTMLToIMPRESSFloatingFrame
50 ' ---------------------------------------------------------------------------------
52 testcase HTMLToIMPRESSText
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>"
65 gApplication = "IMPRESS"
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_impress_text.odp"
85 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_impress_text.odp", "impress8")
87 printlog " Close saved document "
90 printlog " Reopen saved document "
91 if hFileOpen (gOfficepath + "user\work\html_to_impress_text.odp",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 HTMLToIMPRESSField
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>"
132 gApplication = "IMPRESS"
133 printlog " Open new document "
135 printlog " Edit / Paste Special "
140 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
146 printlog " Paste 'Field' in all available clipboard formats "
147 Kontext "InhaltEinfuegen"
148 if InhaltEinfuegen.Exists then
149 printlog " Write Clipboard format under pasted content "
150 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"field")
151 printlog " Save document as ..\user\work\html_to_impress_field.odp"
152 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_impress_field.odp", "impress8")
154 printlog " Close saved document "
157 printlog " Reopen saved document "
158 Call hFileOpen (gOfficepath + "user\work\html_to_impress_field.odp",false)
160 printlog " Close saved document "
163 Warnlog "Dialog 'Paste Special' is not up!"
167 printlog " Close active document "
168 Do Until GetDocumentCount = 0
173 ' ----------------------------------------------------------------------------------------------
175 testcase HTMLToIMPRESSTable
176 gApplication = "HTML"
177 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
178 printlog " Jump to beginning of document "
179 printlog " Select 'Table' "
180 printlog " Copy selected table "
181 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html")
182 Call sMakeReadOnlyDocumentEditable
183 printlog " Jump to beginning of document "
184 Call wTypeKeys "<Mod1 Home>"
185 Call wTypeKeys "<Down>",5
186 Call wTypeKeys "<Mod1 A>",2
189 gApplication = "IMPRESS"
190 printlog " Open new document "
192 printlog " Edit / Paste Special "
197 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
203 printlog " Paste 'Table' in all available clipboard formats "
204 Kontext "InhaltEinfuegen"
205 if InhaltEinfuegen.Exists then
206 printlog " Write Clipboard format under pasted content "
207 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"table")
208 printlog " Save document as ..\user\work\html_to_impress_table.odp"
209 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_impress_table.odp", "impress8")
211 printlog " Close saved document "
214 printlog " Reopen saved document "
215 Call hFileOpen (gOfficepath + "user\work\html_to_impress_table.odp",false)
217 printlog " Close saved document "
220 Warnlog "Dialog 'Paste Special' is not up!"
224 printlog " Close active document "
225 Do Until GetDocumentCount = 0
230 ' ----------------------------------------------------------------------------------------------
232 testcase HTMLToIMPRESSGraphicLinked
233 gApplication = "HTML"
234 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
235 printlog " Jump to beginning of document "
236 printlog " Select 'Linked Graphic' "
237 printlog " Copy selected Linked Graphic "
238 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html")
239 Call sMakeReadOnlyDocumentEditable
240 printlog " Jump to beginning of document "
241 Call wTypeKeys "<Mod1 Home>"
242 Call wTypeKeys ( "<Shift F4>" )
245 gApplication = "IMPRESS"
246 printlog " Open new document "
248 printlog " Edit / Paste Special "
253 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
259 printlog " Paste 'Linked Graphic' in all available clipboard formats "
260 Kontext "InhaltEinfuegen"
261 if InhaltEinfuegen.Exists then
262 printlog " Write Clipboard format under pasted content "
263 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"graphicL")
264 printlog " Save document as ..\user\work\html_to_impress_graphic1.odp"
265 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_impress_graphic1.odp", "impress8")
267 printlog " Close saved document "
270 printlog " Reopen saved document "
271 Call hFileOpen (gOfficepath + "user\work\html_to_impress_graphic1.odp",false)
273 printlog " Close saved document "
276 Warnlog "Dialog 'Paste Special' is not up!"
280 printlog " Close active document "
281 Do Until GetDocumentCount = 0
286 ' ----------------------------------------------------------------------------------------------
288 testcase HTMLToIMPRESSControl
289 gApplication = "HTML"
290 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
291 printlog " Jump to beginning of document "
292 printlog " Select 'Control' "
293 printlog " Copy selected Control "
294 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html")
295 Call sMakeReadOnlyDocumentEditable
296 printlog " Jump to beginning of document "
297 Call wTypeKeys "<Mod1 Home>"
298 Call wTypeKeys ( "<Shift F4>" )
299 Call wTypeKeys "<Tab>"
302 gApplication = "IMPRESS"
303 printlog " Open new document "
305 printlog " Edit / Paste Special "
310 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
316 printlog " Paste 'Control' in all available clipboard formats "
317 Kontext "InhaltEinfuegen"
318 if InhaltEinfuegen.Exists then
319 printlog " Write Clipboard format under pasted content "
320 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"control")
321 printlog " Save document as ..\user\work\html_to_impress_control.odp"
322 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_impress_control.odp", "impress8")
324 printlog " Close saved document "
327 printlog " Reopen saved document "
328 Call hFileOpen (gOfficepath + "user\work\html_to_impress_control.odp",false)
330 printlog " Close saved document "
333 Warnlog "Dialog 'Paste Special' is not up!"
337 printlog " Close active document "
338 Do Until GetDocumentCount = 0
343 ' ----------------------------------------------------------------------------------------------
345 testcase HTMLToIMPRESSFloatingFrame
346 gApplication = "HTML"
347 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
348 printlog " Jump to beginning of document "
349 printlog " Select 'Floating Frame' "
350 printlog " Copy selected Floating Frame "
351 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html")
352 Call sMakeReadOnlyDocumentEditable
353 printlog " Jump to beginning of document "
354 Call wTypeKeys "<Mod1 Home>"
355 Call wTypeKeys ( "<Shift F4>" )
356 Call wTypeKeys "<Tab>",2
360 Warnlog "Edit / Copy is disabled ! Maybe object not selected!"
364 gApplication = "IMPRESS"
365 printlog " Open new document "
367 printlog " Edit / Paste Special "
372 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
378 printlog " Paste 'Floating Frame' in all available clipboard formats "
379 Kontext "InhaltEinfuegen"
380 if InhaltEinfuegen.Exists then
381 printlog " Write Clipboard format under pasted content "
382 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"control")
383 printlog " Save document as ..\user\work\html_to_impress_float.odp"
384 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_impress_float.odp", "impress8")
386 printlog " Close saved document "
389 printlog " Reopen saved document "
390 Call hFileOpen (gOfficepath + "user\work\html_to_impress_float.odp",false)
392 printlog " Close saved document "
395 Warnlog "Dialog 'Paste Special' is not up!"
399 printlog " Close active document "
400 Do Until GetDocumentCount = 0