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: g_demoguide.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-08-28 11:41:51 $
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 : testcase to check the demo guide
38 '************************************************************************
40 ' #1 t_Introduction ' Description
41 ' #1 t_Interoperability ' Description
42 ' #1 t_DrawingEngine ' Description
45 '\***********************************************************************
46 testcase t_Introduction
48 gApplication = "IMPRESS"
50 '///Open new presentation
51 printlog "Open new presentation"
55 printlog "Open the Gallery"
59 if Gallery.NotExists(2) then
63 '///Choose computer theme and insert the third image
64 printlog "Choose an item from the gallery"
66 View.TypeKeys "<HOME><RIGHT><RIGHT>"
67 View.TypeKeys "<SHIFT F10>" 'OpenContextMenu(true)
69 MenuSelect(MenuGetItemID(1)) 'Insert
71 MenuSelect(MenuGetItemID(1)) 'Copy
73 '///+ - Check that we really got a copy of the object ///'
74 kontext "DocumentImpress"
75 DocumentImpress.OpenContextMenu(true)
79 Kontext "ExportierenDlg"
80 if ExportierenDlg.IsVisible(5) then
81 printlog " Gallery-object correctly copied into Slide."
84 warnlog " Doesn't seem like we copied anything from the Gallery... ?"
86 printlog "Delete the item"
87 kontext "DocumentImpress"
88 DocumentImpress.TypeKeys "<DELETE>"
89 printlog "Close the Gallery"
91 printlog "Insert computergraphic from file"
92 InsertGraphicsFromFile
94 Kontext "GrafikEinfuegenDlg"
96 Dateiname.settext Convertpath (gTesttoolPath + "graphics/required/input/screen_white.wmf")
99 Warnlog "Insert graphic doesn't work"
103 printlog "Resize object"
104 Kontext "DocumentImpress"
109 ContextPositionAndSize '/// Format-position and size
111 Active.SetPage TabPositionAndSize
112 Kontext "TabPositionAndSize"
114 SizePosition.TypeKeys "<UP> <UP> <LEFT> <LEFT>"
115 SizePosition.TypeKeys "<DOWN> <RIGHT>"
116 Width.SetText CStr((CInt(Width.GetText)) * 2)
117 TabPositionAndSize.OK
120 printlog "Break object"
121 Kontext "DocumentImpress"
126 hOpenContextMenu '(when the object is marked)
128 '/// Select part of object and make it black
129 printlog "Select part of object and make it black"
130 DocumentImpress.TypeKeys "<SHIFT TAB>"
133 Active.SetPage TabArea
139 '///Group the objects
140 printlog "Group the object"
141 kontext "DocumentImpress"
142 DocumentImpress.TypeKeys "<MOD1 A>"
143 hOpenContextMenu '(when the object is marked)
146 '///Add Layout "Title Only"
147 Printlog "Add Layout"
149 if (NOT Tasks.exists) then
150 warnlog "Tasks Panel not visible. Opening now."
153 Kontext "LayoutsPreview"
154 LayoutsPreview.TypeKeys "<HOME> <DOWN> <DOWN> <RETURN>"
157 Printlog "Add background"
160 printlog "Deselect all tabs from view menu in task pane except the needed."
162 MenuSelect(MenuGetItemID(5))
164 MenuSelect(MenuGetItemID(4))
166 MenuSelect(MenuGetItemID(3))
168 MenuSelect(MenuGetItemID(2))
169 Kontext "AvailableForUsePreview"
170 AvailableForUsePreview.TypeKeys "<HOME> <RIGHT> <RETURN>"
172 '///Add a transition effect
173 Printlog "Add a transition effect"
176 MenuSelect(MenuGetItemID(5))
178 MenuSelect(MenuGetItemID(1))
179 TransitionSound.GetItemCount 'needed for select
181 TransitionSound.Select 4
183 '///Close the document
184 Printlog "Close the document"
187 endcase 't_Introduction
188 '--------------------------------------------------------------------
189 testcase t_Interoperability
191 Dim sTemplatename as string
193 gApplication = "IMPRESS"
195 '///Open PowerPoint presentation
196 printlog "Open PowerPoint presentation"
197 hFileOpen (Convertpath (gTesttoolPath + "graphics/required/input/dotNetOverview.ppt"))
199 Call sMakeReadOnlyDocumentEditable
201 'Save the name of the origin background (taken from last slide)
202 Kontext "DocumentImpress"
203 DocumentImpress.TypeKeys "<END>"
205 sTemplatename = DocumentImpress.StatusGetText (6)
206 printlog " Background = " & sTemplatename 'Debugcode
208 printlog "Choose a masterpage from right pane"
211 printlog "Deselect all tabs accept the Master Pages"
213 MenuSelect(MenuGetItemID(5))
215 MenuSelect(MenuGetItemID(4))
217 MenuSelect(MenuGetItemID(3))
219 MenuSelect(MenuGetItemID(2))
221 Kontext "AvailableForUsePreview"
222 AvailableForUsePreview.TypeKeys "<HOME> <RIGHT> <RETURN>"
224 printlog " Verify that the background has changed"
225 Kontext "DocumentImpress"
226 printlog " Background is " & DocumentImpress.StatusGetText (6) 'Debugcode
227 if DocumentImpress.StatusGetText (6) = sTemplatename then
228 warnlog "The background is not changed"
229 else printlog " Background has been changed"
232 '///Switch back to original background
233 printlog "Switch back to original background"
235 Kontext "AvailableForUsePreview"
236 AvailableForUsePreview.TypeKeys "<HOME> <RETURN>"
238 Kontext "DocumentImpress"
239 if DocumentImpress.StatusGetText (6) = sTemplatename then
240 printlog " The background has been set back to default"
241 else warnlog "The background is " & DocumentImpress.StatusGetText (6) & " but should be: " & sTemplatename
245 printlog "Resort slides"
246 Kontext "DocumentImpress"
248 Kontext "SlidesControl"
249 SlidesControl.TypeKeys "<Mod1 X>"
250 Kontext "DocumentImpress"
251 DocumentImpress.TypeKeys "<HOME>"
253 Kontext "SlidesControl"
254 SlidesControl.TypeKeys "<Mod1 V>"
255 kontext "InsertPaste"
256 if InsertPaste.Exists(1) then
260 Printlog " Verify that the slide was moved correctly"
262 SlidesControl.TypeKeys "<PAGEUP>"
263 SlidesControl.TypeKeys "<SHIFT F10>"
264 if hMenuFindSelect(27268, true, 3) = false then
265 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
269 kontext "NameDlgPage"
270 if NameField.GetText <> ".NET Enterprise Federation" then
271 Warnlog "Wrong slide found! Expected no 3, but found " + NameField.GetText + "."
273 Printlog " The slide was correctly moved"
279 printlog "Switch views"
280 ViewWorkspaceOutlineView
284 Kontext "DocumentImpressOutlineView"
285 DocumentImpressOutlineView.TypeKeys "<MOD1 HOME><SHIFT END>"
286 DocumentImpressOutlineView.TypeKeys "<Mod1 C>"
288 if getclipboard() <> ".NET Enterprise" then
289 warnlog " Wrong selection in outlineview. Should be '.NET Enterprise', but is '" & getclipboard() +"'."
290 else printlog " Switching to Outlineview was successfull"
293 warnlog "Switching to Outlineview was not successfull"
295 ViewWorkspaceNotesView
298 Kontext "DocumentImpressNotesView"
299 DocumentImpressNotesView.TypeKeys "<TAB><TAB>"
300 DocumentImpressNotesView.OpenContextMenu(true)
302 MenuSelect(MenuGetItemID(3)) 'Open Contextmenu Line
305 printlog " Switching to Notesview was successfull"
307 warnlog "Switching to Notesview was not successfull"
309 ViewWorkspaceHandoutView
312 Kontext "DocumentImpressHandoutView"
313 DocumentImpressHandoutView.TypeKeys "<TAB>"
314 printlog " Switching to Handoutview was successfull"
316 warnlog "Switching to Handoutview was not successfull"
319 ViewWorkspaceSlidesView
323 SlidesControl.TypeKeys "<TAB>"
324 printlog " Switching to Slideview was successfull"
326 warnlog "Switching to Slideview was not successfull"
329 ViewWorkspaceDrawingView
332 Kontext "DocumentImpress"
333 DocumentImpress.TypeKeys "<TAB>"
334 printlog " Switching back to Drawingview was successfull"
336 warnlog "Switching to Drawingview was not successfull"
339 '///Travel through the presentation by left pane
340 printlog "Travel through the presentation by left pane to slide 7"
341 Kontext "DocumentImpress"
342 DocumentImpress.TypeKeys "<HOME><PAGEDOWN><PAGEDOWN><PAGEDOWN><PAGEDOWN><PAGEDOWN><PAGEDOWN><PAGEDOWN>"
343 Printlog " Verify that the correct slide (7) is reached"
345 Kontext "SlidesControl"
346 SlidesControl.OpenContextMenu
347 if hMenuFindSelect(27268, true, 3) = false then
348 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
352 kontext "NameDlgPage"
353 if NameField.GetText <> "Visual Studio.NET The complete development environment for building distributed applications for Windows and the Web" then
354 Warnlog "Wrong slide found! Expected no 7, but found " + NameField.GetText + "."
355 else Printlog " Slide 7 is reached"
360 printlog "Autoshape support"
361 Kontext "DocumentImpress"
362 DocumentImpress.TypeKeys "<TAB>"
364 Kontext "ExtrusionObjectBar"
365 printlog "Checking if ExtrusionObjectBar is already open."
366 if ExtrusionObjectBar.Exists then
367 printlog "ExtrusionObjectBar Exists = " & ExtrusionObjectBar.Exists
369 printlog "ExtrusionObjectBar Exists = " & ExtrusionObjectBar.Exists
370 printlog "Opening ExtrusionObjectBar."
371 ViewToolbarsThreeDSettings
373 ExtrusionTiltRight.Click
374 printlog " An autoshape was found and turned right"
376 warnlog "Turning autoshape was not successfully"
378 printlog "Close document"
381 endcase 't_Interoperability
382 '--------------------------------------------------------------------
383 testcase t_DrawingEngine
385 Dim sGroupPosition as string
386 Dim sObjectPosition as string
388 gApplication = "DRAW"
391 printlog "Open a drawing"
392 hFileOpen (Convertpath (gTesttoolPath + "graphics/required/input/Blueprint.odg"))
394 Call sMakeReadOnlyDocumentEditable
396 '///Select grouped object and enter group
397 printlog "Select group"
398 Kontext "DocumentDraw"
399 DocumentDraw.TypeKeys "<TAB><TAB>"
401 printlog " Save position of group"
402 ContextPositionAndSize 'Format-position and size
404 Active.SetPage TabPositionAndSize
405 Kontext "TabPositionAndSize"
406 sGroupPosition = PositionY.GetText
407 printlog " - GroupPosition is " & sGroupPosition
408 TabPositionAndSize.OK
409 printlog "Enter group"
410 Kontext "DocumentDraw"
414 '///Select and move single object
415 printlog "Select and move single object"
416 printlog " Select object"
417 Kontext "DocumentDraw"
418 DocumentDraw.TypeKeys "<TAB><TAB>"
420 printlog " Verify that the wanted object is selected"
421 DocumentDraw.TypeKeys "<SHIFT F10>" 'Open contextmenu
422 MenuSelect(MenuGetItemID(15)) 'Select NAME from context
423 kontext "NameDlgObject"
424 if NameField.GetText <> "Chair" then
425 Warnlog "Wrong object selected!"
426 else Printlog " The correct object is selected"
430 printlog " Save position of group"
431 ContextPositionAndSize 'Format-position and size
433 Active.SetPage TabPositionAndSize
434 Kontext "TabPositionAndSize"
435 sObjectPosition = PositionY.GetText
436 printlog " - ObjectPosition is " & sObjectPosition
437 TabPositionAndSize.OK
438 printlog " Move object"
439 Kontext "DocumentDraw"
440 DocumentDraw.TypeKeys "<UP><UP><UP>"
442 printlog " Verify that the object was moved"
443 ContextPositionAndSize '/// Format-position and size
445 Active.SetPage TabPositionAndSize
446 Kontext "TabPositionAndSize"
447 if PositionY.GetText <> sObjectPosition then
448 printlog " Single object was moved"
449 else warnlog "The object has not been moved"
451 TabPositionAndSize.OK
452 printlog " Exit group"
454 Printlog "Verify that the group is still on position"
455 printlog " Verify position"
456 ContextPositionAndSize 'Format-position and size
458 Active.SetPage TabPositionAndSize
459 Kontext "TabPositionAndSize"
460 if PositionY.GetText = sGroupPosition then
461 printlog " Group is still on position"
462 else warnlog "Group has moved from " & sGroupPosition & " to " & PositionY.GetText
464 TabPositionAndSize.OK
467 printlog "Close document"
470 endcase 't_DrawingEngine