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: i_saveloadlayout.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 10:42:42 $
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 : wolfram.garten@sun.com
36 '* short description: Save & Load testing of Layout -templates.
38 '**************************************************************************************
39 ' #1 tSaveLoadLayoutEmpty
40 ' #1 tSaveLoadLayoutOLE
41 ' #1 tSaveLoadLayoutText
42 ' #1 tSaveLoadLayoutOutline
43 ' #1 tSaveLoadLayoutPicture
44 ' #1 tSaveLoadLayoutChart
45 ' #1 tSaveLoadLayoutSpreadsheet
46 '\*************************************************************************************
48 testcase tSaveLoadLayoutEmpty
50 Dim NewFileDir as String
51 NewFileDir = ConvertPath (gOfficePath + "user\work\LayoutTest\")
53 '/// Create New folder in the Work-directory ///'
54 printlog " Will try to create the directory: " + NewFileDir
57 '/// Create a new document, add an empty Layout, Save the document in all available Formats, and open the saved files. ///'
59 '/// Make new Presentation ///'
60 gApplication = "IMPRESS"
63 '/// Choose and Insert an empty Layout. ///'
64 printlog " Choose and Insert an empty Layout."
68 LayoutsPreview.TypeKeys "<HOME>"
69 kontext "Pagelayout_UndoDeleteWarning"
70 if Pagelayout_UndoDeleteWarning.exists then
71 Pagelayout_UndoDeleteWarning.ok
74 '/// Press "Enter" to use the layout on the current slide ///'
75 LayoutsPreview.TypeKeys "<RETURN>"
78 '/// Save the document in different formats... ///'
79 '/// Close the file. ///'
80 '/// Load the different files. ///'
81 call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below.
83 '/// Delete the different files. ///'
84 printlog " Will try to delete the directory: " + NewFileDir
87 printlog "tSaveLoadLayoutEmpty ended."
88 '/// End the test ///'
89 endcase 'tSaveLoadLayoutEmpty
91 '****************************************************************************************************
93 testcase tSaveLoadLayoutOLE
94 Dim NewFileDir as String
95 NewFileDir = ConvertPath (gOfficePath + "user\work\LayoutTest\")
97 '/// Create New folder in the Work-directory ///'
98 printlog " Will try to create the directory: " + NewFileDir
101 '/// Create a new document, add a Layout with an OLE-field, Save the document in all available Formats, and open the saved files. ///'
103 '/// Make new Presentation ///'
104 gApplication = "IMPRESS"
107 '/// Choose and Insert an Layout with an OLE. ///'
108 printlog " Choose and Insert an Layout with an OLE."
112 LayoutsPreview.TypeKeys "<HOME>"
113 kontext "Pagelayout_UndoDeleteWarning"
114 if Pagelayout_UndoDeleteWarning.exists then
115 Pagelayout_UndoDeleteWarning.ok
118 '/// select the OLE placeholder and activate it with [Return] ///'
119 LayoutsPreview.TypeKeys ("<RIGHT>",13)
121 LayoutsPreview.TypeKeys ("<Return>")
123 kontext "DocumentImpress"
124 DocumentImpress.TypeKeys ("<TAB><TAB><TAB>")
125 DocumentImpress.TypeKeys ("<Return>")
128 kontext "OLEObjektInsert"
130 OLEObjektInsert.Cancel
131 Printlog " Correctly inserted a layout with an 'Insert OLE-Object'-frame."
133 warnlog "Ole wasn't selected :-("
139 '/// Save the document in all available formats... ///'
140 '/// Close the file. ///'
141 '/// Load the different files. ///'
142 call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below.
144 '/// Delete the different files. ///'
145 printlog " Will try to delete the directory: " + NewFileDir
148 printlog "tSaveLoadLayoutOLE ended."
149 '/// End the test ///'
150 endcase 'tSaveLoadLayoutOLE
152 '****************************************************************************************************
154 testcase tSaveLoadLayoutText
155 Dim NewFileDir as String
156 NewFileDir = ConvertPath (gOfficePath + "user\work\LayoutTest\")
158 '/// Create New folder in the Work-directory ///'
159 printlog " Will try to create the directory: " + NewFileDir
162 '/// Create a new document, add a Layout with a Textfield, Save the document in all available Formats, and open the saved files. ///'
164 '/// Make new Presentation ///'
165 gApplication = "IMPRESS"
168 '/// Choose and Insert an Layout with a Text-field. ///'
169 printlog " Choose and Insert an Layout with a Text-field."
173 LayoutsPreview.TypeKeys "<HOME>"
174 kontext "Pagelayout_UndoDeleteWarning"
175 if Pagelayout_UndoDeleteWarning.exists then
176 Pagelayout_UndoDeleteWarning.ok
179 '/// select the Text placeholder and activate it with [Return] ///'
180 LayoutsPreview.TypeKeys ("<RIGHT>")
182 LayoutsPreview.TypeKeys ("<Return>")
184 kontext "DocumentImpress"
185 DocumentImpress.TypeKeys ("<TAB><TAB><TAB>")
186 DocumentImpress.TypeKeys ("<Return>")
187 DocumentImpress.TypeKeys ("<ESCAPE>")
188 ' LayoutsPreview.TypeKeys "<RETURN>"
191 '/// Save the document in all available formats... ///'
192 '/// Close the file. ///'
193 '/// Load the different files. ///'
194 call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below.
196 '/// Delete the different files. ///'
197 printlog " Will try to delete the directory: " + NewFileDir
200 printlog "tSaveLoadLayoutText ended."
201 '/// End the test ///'
202 endcase 'tSaveLoadLayoutText
204 '****************************************************************************************************
206 testcase tSaveLoadLayoutOutline
207 Dim NewFileDir as String
208 NewFileDir = ConvertPath (gOfficePath + "user\work\LayoutTest\")
210 '/// Create New folder in the Work-directory ///'
211 printlog " Will try to create the directory: " + NewFileDir
214 '/// Create a new document, add a Layout with an Outline-field, Save the document in all available Formats, and open the saved files. ///'
216 '/// Make new Presentation ///'
217 gApplication = "IMPRESS"
220 '/// Choose and Insert an Layout with a Outline-field. ///'
221 printlog " Choose and Insert an Layout with a Outline-field."
225 LayoutsPreview.TypeKeys "<HOME>"
226 kontext "Pagelayout_UndoDeleteWarning"
227 if Pagelayout_UndoDeleteWarning.exists then
228 Pagelayout_UndoDeleteWarning.ok
231 '/// select the Outline placeholder and activate it with [Return] ///'
232 LayoutsPreview.TypeKeys ("<RIGHT>",3)
234 LayoutsPreview.TypeKeys ("<Return>")
236 kontext "DocumentImpress"
237 DocumentImpress.TypeKeys ("<TAB><TAB><TAB>")
238 DocumentImpress.TypeKeys ("<Return>")
239 DocumentImpress.TypeKeys ("<ESCAPE>")
242 '/// Save the document in all available formats... ///'
243 '/// Close the file. ///'
244 '/// Load the different files. ///'
245 call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below.
247 '/// Delete the different files. ///'
248 printlog " Will try to delete the directory: " + NewFileDir
251 printlog "tSaveLoadLayoutOutline ended."
252 '/// End the test ///'
253 endcase 'tSaveLoadLayoutOutline
255 '****************************************************************************************************
257 testcase tSaveLoadLayoutPicture
258 Dim NewFileDir as String
259 NewFileDir = ConvertPath (gOfficePath + "user\work\LayoutTest\")
261 '/// Create New folder in the Work-directory ///'
262 printlog " Will try to create the directory: " + NewFileDir
265 '/// Create a new document, add a Layout with a Graphic-field, Save the document in all available Formats, and open the saved files. ///'
267 '/// Make new Presentation ///'
268 gApplication = "IMPRESS"
271 '/// Choose and Insert an Layout with a Graphic-field. ///'
272 printlog " Choose and Insert an Layout with a Graphic-field."
276 LayoutsPreview.TypeKeys "<HOME>"
277 kontext "Pagelayout_UndoDeleteWarning"
278 if Pagelayout_UndoDeleteWarning.exists then
279 Pagelayout_UndoDeleteWarning.ok
282 '/// select the Picture placeholder and activate it with [Return] ///'
283 LayoutsPreview.TypeKeys ("<RIGHT>",8)
285 LayoutsPreview.TypeKeys ("<Return>")
287 kontext "DocumentImpress"
288 DocumentImpress.TypeKeys ("<TAB><TAB><TAB>")
289 DocumentImpress.TypeKeys ("<Return>")
290 DocumentImpress.TypeKeys ("<ESCAPE>")
293 '/// Save the document in all available formats. ///'
294 '/// Close the file. ///'
295 '/// Load the different files. ///'
296 call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below.
298 '/// Delete the different files. ///'
299 printlog " Will try to delete the directory: " + NewFileDir
300 app.rmDir NewFileDir 'ConvertPath (gOfficePath + "user\work\LayoutTest\")
302 printlog "tSaveLoadLayoutPicture ended."
303 '/// End the test ///'
304 endcase 'tSaveLoadLayoutPicture
306 '****************************************************************************************************
308 testcase tSaveLoadLayoutChart
309 Dim NewFileDir as String
310 NewFileDir = ConvertPath (gOfficePath + "user\work\LayoutTest\")
312 '/// Create New folder in the Work-directory ///'
313 printlog " Will try to create the directory: " + NewFileDir
316 '/// Create a new document, add a Layout for a Chart, Save the document in all available formats, and open the saved files. ///'
318 '/// Make new Presentation ///'
319 gApplication = "IMPRESS"
322 '/// Choose and Insert an Layout with a Chart-field. ///'
323 printlog " Choose and Insert an Layout with a Chart-field."
327 LayoutsPreview.TypeKeys "<HOME>"
328 kontext "Pagelayout_UndoDeleteWarning"
329 if Pagelayout_UndoDeleteWarning.exists then
330 Pagelayout_UndoDeleteWarning.ok
333 '/// select the Chart placeholder and activate it with [Return] ///'
334 LayoutsPreview.TypeKeys ("<RIGHT>",6)
336 LayoutsPreview.TypeKeys ("<Return>")
338 kontext "DocumentImpress"
339 DocumentImpress.TypeKeys ("<TAB><TAB><TAB>")
340 DocumentImpress.TypeKeys ("<Return>")
341 DocumentImpress.TypeKeys ("<ESCAPE>")
344 '/// Save the document in all available formats. ///'
345 '/// Close the file. ///'
346 '/// Load the different files. ///'
347 call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below.
349 '/// Delete the different files. ///'
350 printlog " Will try to delete the directory: " + NewFileDir
353 printlog "tSaveLoadLayoutChart ended."
354 '/// End the test ///'
355 endcase 'tSaveLoadLayoutChart
357 '****************************************************************************************************
359 testcase tSaveLoadLayoutSpreadsheet
360 Dim NewFileDir as String
361 NewFileDir = ConvertPath (gOfficePath + "user\work\LayoutTest\")
363 '/// Create New folder in the Work-directory ///'
364 printlog " Will try to create the directory: " + NewFileDir
367 '/// Create a new document, add a Layout containing a Spreadsheet, Save the document in all available Formats, and open the saved files. ///'
369 '/// Make new Presentation ///'
370 gApplication = "IMPRESS"
373 '/// Choose and Insert an Layout with a Spreadsheet-field. ///'
374 printlog " Choose and Insert an Layout with a Spreadsheet-field."
378 LayoutsPreview.TypeKeys "<HOME>"
379 kontext "Pagelayout_UndoDeleteWarning"
380 if Pagelayout_UndoDeleteWarning.exists then
381 Pagelayout_UndoDeleteWarning.ok
384 '/// select the Spreadsheet placeholder and activate it with [Return] ///'
385 LayoutsPreview.TypeKeys ("<RIGHT>",7)
387 LayoutsPreview.TypeKeys ("<Return>")
389 kontext "DocumentImpress"
390 DocumentImpress.TypeKeys ("<TAB><TAB><TAB>")
391 DocumentImpress.TypeKeys ("<Return>")
392 DocumentImpress.TypeKeys ("<ESCAPE>")
395 '/// Save the document in all available formats. ///'
396 '/// Close the file. ///'
397 '/// Load the different files. ///'
398 call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below.
400 '/// Delete the different files. ///'
401 printlog " Will try to delete the directory: " + NewFileDir
402 app.rmDir NewFileDir 'ConvertPath (gOfficePath + "user\work\LayoutTest\")
404 printlog "tSaveLoadLayoutSpreadsheet ended."
405 '/// End the test ///'
406 endcase 'tSaveLoadLayoutSpreadsheet
408 '-------------------------------------------------------------------------------