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_217_.inc,v $
12 '* last change: $Author: vg $ $Date: 2008-08-18 12:24:52 $
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 HTMLToCALCGraphicLinked
45 Call HTMLToCALCControl
46 Call HTMLToCALCFloatingFrame
50 ' ---------------------------------------------------------------------------------
52 testcase HTMLToCALCText
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",false)
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_calc_text.ods"
85 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_calc_text.ods", "calc8")
87 printlog " Close saved document "
90 printlog " Reopen saved document "
91 if hFileOpen (gOfficepath + "user\work\html_to_calc_text.ods",true) = 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 HTMLToCALCField
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",false)
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 = "CALC"
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_calc_field.ods"
152 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_calc_field.ods", "calc8")
154 printlog " Close saved document "
157 printlog " Reopen saved document "
158 Call hFileOpen (gOfficepath + "user\work\html_to_calc_field.ods",true)
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 HTMLToCALCTable
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",false)
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
190 gApplication = "CALC"
191 printlog " Open new document "
193 printlog " Edit / Paste Special "
198 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(2) then
206 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"table")
207 printlog " Write Clipboard format under pasted content "
208 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_calc_table.ods", "calc8")
209 printlog " Save document as ..\user\work\html_to_calc_table.ods"
211 printlog " Close saved document "
212 Call hFileOpen (gOfficepath + "user\work\html_to_calc_table.ods",true)
213 printlog " Reopen saved document "
215 printlog " Close saved document "
217 Warnlog "Dialog 'Paste Special' is not up!"
221 printlog " Close active document "
222 Do Until GetDocumentCount = 0
227 ' ----------------------------------------------------------------------------------------------
229 testcase HTMLToCALCGraphicLinked
230 gApplication = "HTML"
231 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
232 printlog " Jump to beginning of document "
233 printlog " Select 'Linked Graphic' "
234 printlog " Copy selected Linked Graphic "
235 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html",false)
236 Call sMakeReadOnlyDocumentEditable
237 printlog " Jump to beginning of document "
238 Call wTypeKeys "<Mod1 Home>"
239 Call wTypeKeys ( "<Shift F4>" )
243 gApplication = "CALC"
244 printlog " Open new document "
246 printlog " Edit / Paste Special "
251 warnlog "Unable to execute 'Edit / Paste Special'! Test failed! Manually not reproducable"
257 printlog " Paste 'Linked Graphic' in all available clipboard formats "
258 Kontext "InhaltEinfuegen"
259 if InhaltEinfuegen.Exists then
260 printlog " Write Clipboard format under pasted content "
261 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"graphicL")
262 printlog " Save document as ..\user\work\html_to_calc_graphic1.ods"
263 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_calc_graphic1.ods", "calc8")
265 printlog " Close saved document "
268 printlog " Reopen saved document "
269 Call hFileOpen (gOfficepath + "user\work\html_to_calc_graphic1.ods",false)
271 printlog " Close saved document "
274 Warnlog "Dialog 'Paste Special' is not up!"
278 printlog " Close active document "
279 Do Until GetDocumentCount = 0
284 ' ----------------------------------------------------------------------------------------------
286 testcase HTMLToCALCControl
287 gApplication = "HTML"
288 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
289 printlog " Jump to beginning of document "
290 printlog " Select 'Control' "
291 printlog " Copy selected Control "
292 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html",false)
293 Call sMakeReadOnlyDocumentEditable
294 printlog " Jump to beginning of document "
295 Call wTypeKeys "<Mod1 Home>"
296 Call wTypeKeys ( "<Shift F4>" )
297 Call wTypeKeys "<Tab>"
300 gApplication = "CALC"
301 printlog " Open new document "
303 printlog " Edit / Paste Special "
308 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
314 printlog " Paste 'Control' in all available clipboard formats "
315 Kontext "InhaltEinfuegen"
316 if InhaltEinfuegen.Exists then
317 printlog " Write Clipboard format under pasted content "
318 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"control")
319 printlog " Save document as ..\user\work\html_to_calc_control.sxc"
320 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_calc_control.ods", "calc8")
322 printlog " Close saved document "
325 printlog " Reopen saved document "
326 Call hFileOpen (gOfficepath + "user\work\html_to_calc_control.ods",false)
328 printlog " Close saved document "
331 Warnlog "Dialog 'Paste Special' is not up!"
335 printlog " Close active document "
336 Do Until GetDocumentCount = 0
341 ' ----------------------------------------------------------------------------------------------
343 testcase HTMLToCALCFloatingFrame
344 gApplication = "HTML"
345 printlog " Open File '..\\writer\\optional\\input\\clipboard\\html.html' "
346 printlog " Jump to beginning of document "
347 printlog " Select 'Floating Frame' "
348 printlog " Copy selected Floating Frame "
349 Call hFileOpen (gtesttoolpath & "writer\optional\input\clipboard\html.html",false)
350 Call sMakeReadOnlyDocumentEditable
351 printlog " Jump to beginning of document "
352 Call wTypeKeys "<Mod1 Home>"
353 Call wTypeKeys ( "<Shift F4>" )
354 Call wTypeKeys "<Tab>",2
360 Warnlog "Edit / Copy is disabled ! Maybe object not selected!"
364 gApplication = "CALC"
365 printlog " Open new document "
367 printlog " Edit / Paste Special "
372 Warnlog "Unable to execute 'Edit / Paste Special'! Test failed!"
377 printlog " Paste 'Floating Frame' in all available clipboard formats "
378 Kontext "InhaltEinfuegen"
379 if InhaltEinfuegen.Exists(3) then
380 printlog " Write Clipboard format under pasted content "
381 Call wPasteAvailableClipboardFormats(Auswahl.GetItemCount,"control")
382 printlog " Save document as ..\user\work\html_to_calc_float.ods"
383 Call hFileSaveAsWithFilterKill (gOfficepath + "user\work\html_to_calc_float.ods", "calc8")
384 printlog " Close saved document "
386 printlog " Reopen saved document "
387 Call hFileOpen (gOfficepath + "user\work\html_to_calc_float.ods",false)
388 printlog " Close saved document "
391 Warnlog "Dialog 'Paste Special' is not up!"
395 printlog " Close active document "
396 Do Until GetDocumentCount = 0