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_pengine2.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 10:42:41 $
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 : Tests the Presentation-Engines effects
38 '*******************************************************************
40 ' #1 tiPengineAnimationEffectsPreview
41 ' #1 tiPengineAnimationEffectsOptions
42 ' #1 tiPengineAllShapesAndEffects
43 ' #1 tiPengine2ObjectsGetsEffects
45 '\*******************************************************************
47 testcase tiPengineAnimationEffectsPreview
50 '/// open application ///'
52 '/// create textbox with text ///'
53 Call hTextrahmenErstellen ("Test text to test text effects", 35, 35, 70, 70 )
54 '/// Slide Show->Custom Animation... ///'
55 SlideShowCustomAnimation
57 '/// click button 'Add...' ///'
59 '/// Dialog 'Custom Animation' comes up ///'
61 '/// Switch to TabPage: Entrance ///'
62 active.setPage(TabEntrance)
64 if TabEntrance.exists(5) then
65 DialogTest(TabEntrance)
67 '/// Switch to TabPage: Emphasis ///'
69 active.setPage(TabEmphasis)
71 if TabEmphasis.exists(5) then
72 DialogTest(TabEmphasis)
76 warnlog "Impress:Tasks Pane:Custom Animation:TabEmphasis tabPage doesn't work."
80 '/// Switch to TabPage: Exit ///'
81 active.setPage(TabExit)
83 if TabExit.exists(5) then
88 warnlog "Impress:Tasks Pane:Custom Animation:TabExit tabPage doesn't work."
92 '/// Switch to TabPage: Motion Paths ///'
93 active.setPage(TabMotionPaths)
94 kontext "TabMotionPaths"
95 if TabMotionPaths.exists(5) then
96 DialogTest(TabMotionPaths)
100 warnlog "Impress:Tasks Pane:Custom Animation:TabMotionPaths tabPage doesn't work."
104 '/// Switch to TabPage: Entrance ///'
105 active.setPage(TabEntrance)
106 kontext "TabEntrance"
107 if TabEntrance.exists(5) then
109 '/// Close dialog 'Custom Animation' with 'OK' ///'
112 warnlog "Error when switching Tab"
117 warnlog "Impress:Tasks Pane:Custom Animation:Add... button didn't work."
121 '/// click button 'Change...' ///'
123 '/// Dialog 'Custom Animation' comes up ///'
126 '/// Switch to TabPage: Entrance ///'
127 active.setPage(TabEntrance)
128 kontext "TabEntrance"
129 if (NOT TabEntrance.exists(5)) then
130 warnlog "Impress:Tasks Pane:Custom Animation:Change... button didn't work."
134 EffectStart.GetItemCount
135 if EffectProperty.IsVisible then
136 EffectProperty.GetItemCount
138 '/// CLick on button '...' (Options) ///'
141 if TabEffect.Exists(5) then
142 dialogTest(TabEffect)
144 AfterAnimation.GetItemCount
146 '/// switch to TabPage 'Timing' ///'
148 Active.SetPage TabTiming
150 if TabTiming.Exists(5) then
151 dialogTest(TabTiming)
152 TimingStart.GetItemCount
157 TriggerAnimate.IsChecked
158 TriggerStart.IsChecked
161 warnlog "Impress:Tasks Pane:Custom Animation:Effect Options: Timing TabPage didn't work."
164 '/// switch to TabPage 'Timing' ///'
166 active.setPage TabTextAnimation
167 kontext "TabTextAnimation"
168 if TabTextAnimation.Exists(5) then
169 dialogTest(TabTextAnimation)
170 GroupText.GetItemCount
171 AnimateAttachedShape.IsChecked
172 TabTextAnimation.Cancel
174 warnlog "Impress:Tasks Pane:Custom Animation:Effect Options: TextAnimation TabPage didn't work."
177 warnlog "Impress:Tasks Pane:Custom Animation:... button didn't work."
180 EffectSpeed.GetItemCount
181 EffectList.GetItemCount
184 EffectSlideShow.Click
186 kontext "DocumentPresentation"
187 if DocumentPresentation.Exists (15) then
188 printlog "Presentation started :-)"
189 DocumentPresentation.TypeKeys "<SPACE>"
190 if DocumentPresentation.Exists (15) then
191 DocumentPresentation.TypeKeys "<SPACE>"
193 if DocumentPresentation.Exists (15) then
194 DocumentPresentation.TypeKeys "<ESCAPE>"
197 warnlog "Impress:Tasks Pane:Custom Animation:Slide Show button doesn't start slideshow!"
201 EffectAutomaticPreview.Check
202 '/// click button 'Remove' ///'
206 '/// close application ///'
208 endcase 'tiPengineAnimationEffectsPreview
210 '------------------------------------------------------------------------------
212 testcase tiPengineAnimationEffectsOptions
213 dim bError as boolean
226 dim numberx as integer
227 dim Effectname1 as string
228 dim StartName1 as string
229 dim PropertyName1 as string
231 '/// open application ///'
233 '/// create textbox with text ///'
234 Call hTextrahmenErstellen ("Test text to test text effects", 35, 35, 70, 70 )
235 '/// Slide Show->Custom Animation... ///'
236 SlideShowCustomAnimation
237 '/// Dialog 'Custom Animation' comes up ///'
239 '/// Click button 'Add...' to add an effect to the text ///'
242 '/// Switch to TabPage: Entrance ///'
243 active.setPage(TabEntrance)
244 kontext "TabEntrance"
245 if TabEntrance.exists(5) then
246 AutomaticPreview.UnCheck
247 Printlog "Testing effects in - TabEntrance"
248 i = Effects.GetItemCount
250 Effects.TypeKeys "<HOME DOWN>"
252 '/// Choose ten random effects, and test them. ///'
257 numberx = Int((i*Rnd))
258 if (numberx<1) OR (numberx>i) then ' Just so we get it between 1 and the amount of items.
262 printlog numberx ' Log what effect were about to select. Just for debugging.
263 Effects.TypeKeys "<HOME>"
264 Effects.TypeKeys "<DOWN>", numberx ' Select the effect.
266 Printlog "Effect Nr: " + (Effects.GetSelIndex -1) + ". Name: " + Effects.GetSelText ' Log the number and effect-name.
267 Effectname1 = Effects.GetSelText
268 if AutomaticPreview.IsChecked = TRUE then sleep 1 ' Sleep one sec to at least let the preview start.
269 d = Effects.GetSelIndex
271 optionstest2 ' Do the optionstest for this effect.
276 Warnlog "Something wrong when exiting Impress:Tasks Pane:Custom Animation: ... (options)"
278 kontext "TabEntrance"
279 '/// Select the next entry ///'
280 Effects.TypeKeys "<DOWN>", e
281 p = Effects.GetSelIndex
284 if Speed.isVisible then
285 if Speed.isEnabled then
286 s = Speed.GetItemCount
291 warnlog "The speed nr: " + q + " had some kind of problem. Check it."
296 Warnlog "Speed in Effect Options were not to be found."
299 kontext "TabEntrance"
300 Printlog "Test of Entrance-list ended."
301 AutomaticPreview.Check
305 warnlog "Impress:Tasks Pane:Custom Animation:Add... button didnt work."
308 EffectAutomaticPreview.Check
309 '/// click button 'Remove' ///'
311 '/// close application ///'
313 endcase 'tiPengineAnimationEffectsOptions
315 '------------------------------------------------------------------------------------------------------------------------------------------------------
317 testcase tiPengineAllShapesAndEffects
318 dim sFileName as string
320 '/// the Presentation-Engine consists of showing the presentation, with all it's effects. ///'
322 '/// Create a new presentation. ///'
326 '/// Open the test-file. ///'
327 Call hFileOpen (gTesttoolpath + "graphics\required\input\allshapes2.odp") 'effects.odp")
329 '/// Start the slideshow. ///'
330 Call hTypeKeys "<F5>"
332 kontext "DocumentPresentation"
333 while DocumentPresentation.exists()
334 DocumentPresentation.TypeKeys "<SPACE>"
338 Kontext "DocumentImpress"
339 if (DocumentImpress.exists(1)) then
342 warnlog "presentation not ended."
348 '/// Open the test-file. ///'
349 Call hFileOpen (gTesttoolpath + "graphics\required\input\effects.odp")
352 '/// Start the slideshow. ///'
353 CALL hTypeKeys "<F5>"
355 '/// Press "Space" again, to continue with slide two. ///'
356 kontext "DocumentPresentation"
357 while DocumentPresentation.exists()
358 DocumentPresentation.TypeKeys "<SPACE>"
362 printlog "End of eleventh page."
363 if DocumentPresentation.Exists then
364 warnlog "DocumentPresentation shouldnt be visible right now."
365 DocumentPresentation.TypeKeys "<SPACE>"
367 printlog "Presentation ended correctly."
368 kontext "DocumentImpress"
371 '/// Close Application ///'
373 Printlog "Finished Optional-test for Presentation-Engine"
374 endcase 'tiPengineAllShapesAndEffects
376 '-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
378 testcase tiPengine2ObjectsGetsEffects
383 dim sFileName as string
385 printlog "the Presentation-Engine consists of showing the presentation, with all it's effects."
387 printlog "Create a new presentation."
393 printlog "insert a Smiley."
394 printlog "From the toolbar: Insert three objects:"
395 printlog "insert a Smiley."
397 if Toolbar.Exists then
398 if Toolbar.IsVisible then
403 warnlog "Issue for GH; .tearoff doesnt tell success"
406 kontext "SymbolShapes"
407 SymbolShapesSmiley.Click
411 gMouseMove (40,40,60,60)
415 kontext "SymbolShapes"
418 printlog "Unmark all objects"
421 printlog "Mark the Smiley"
424 warnlog "No toolbar visible, please notify the test-administrator"
427 warnlog "toolbar not visible"
430 printlog "Smiley inserted, time to add some effects."
432 printlog "Effect no 1"
434 printlog "Slide Show->Custom Animation..."
435 SlideShowCustomAnimation
437 printlog "Click button 'Add...'"
439 printlog "Dialog 'Custom Animation' comes up"
441 printlog "Switch to TabPage: Entrance"
442 active.setPage(TabEntrance)
443 kontext "TabEntrance"
444 if TabEntrance.exists(5) then
445 DialogTest(TabEntrance)
446 printlog "Find 'Dissolve-in'."
447 TabEntrance.TypeKeys "<DOWN>", 6
450 Printlog "Added effect 'Dissolve-in'"
452 warnlog "Tab Entrance does not exist?"
456 printlog "Effect no 2"
458 printlog "Add a second effect to the object"
461 printlog "Dialog 'Custom Animation' comes up"
462 printlog "Switch to TabPage: Emphasis"
464 active.setPage(TabEmphasis)
465 kontext "TabEmphasis"
466 if TabEmphasis.exists(5) then
467 DialogTest(TabEmphasis)
468 Effects.Select 5 'Transparency
470 printlog "Close dialog 'Custom Animation' with 'OK'"
472 Printlog "Added effect 'Transparency'"
474 warnlog "Error when switching Tab"
478 printlog "Effect no 3"
480 printlog "Insert new slide"
482 Printlog "Inserted new Slide"
485 printlog "Make sure the last slide is selcted"
486 SlidesControl.TypeKeys "<TAB>"
487 SlidesControl.TypeKeys "<PAGEDOWN>", 3
490 printlog "Insert new object"
491 Call hTextrahmenErstellen ("Test text for the second slide to test the PresentationEngine", 35, 35, 70, 70)
493 printlog "Add the Transformation-Effect 'put on the brakes'"
494 SlideShowCustomAnimation
496 printlog "Click button 'Add...'"
498 printlog "Dialog 'Custom Animation' comes up"
500 printlog "Switch to TabPage: Entrance"
501 active.setPage(TabEntrance)
502 kontext "TabEntrance"
503 if TabEntrance.exists(5) then
504 printlog "Add Transformation-Effect: 'Put on the Breaks'"
505 TabEntrance.TypeKeys "<DOWN>", 30
508 Printlog "Added effect 'Put on the Breaks'"
510 warnlog "Impress:Tasks Pane:Custom Animation:Add... button didn't work."
514 printlog "Effect no 4"
516 printlog "Click button 'Add...'"
518 printlog "Dialog 'Custom Animation' comes up"
520 printlog "Switch to TabPage: Motion Paths"
521 active.setPage(TabMotionPaths)
522 kontext "TabMotionPaths"
523 if TabMotionPaths.exists(5) then
524 printlog "Add motion-path-effect: 'schwosch'"
525 TabMotionPaths.TypeKeys "<DOWN>", 66
528 Printlog "Added effect 'Schwosch'"
531 warnlog "Couldn't find the Tabpage: MotionPaths. Check why."
534 printlog "Press 'PageUp' to get to the first slide"
537 printlog "Run the slideshow with F5."
540 kontext "DocumentPresentation"
541 if DocumentPresentation.Exists (15) then
542 Printlog "Presentation started, calling 1st effect, 1st object."
543 DocumentPresentation.TypeKeys "<SPACE>"
546 warnlog "Slideshow didn't start. Check why."
548 printlog "calling 2nd effect, 1st object."
549 DocumentPresentation.TypeKeys "<SPACE>"
551 printlog "calling 2nd slide."
552 DocumentPresentation.TypeKeys "<SPACE>"
554 printlog "calling 1st effect, 2nd object"
555 DocumentPresentation.TypeKeys "<SPACE>"
557 printlog "calling 2nd effect, 2nd object"
558 DocumentPresentation.TypeKeys "<SPACE>"
560 printlog "ending presentation"
561 DocumentPresentation.TypeKeys "<SPACE>"
563 Kontext "DocumentPresentation"
564 printlog "getting back to edit view."
565 DocumentPresentation.TypeKeys "<SPACE>"
567 if DocumentPresentation.Exists(5) then
568 warnlog "Presentation should have ended. Check why it didn't."
571 Kontext "DocumentImpress"
573 printlog "Close the document"
575 Printlog "Finished Optional-test for Presentation-Engine"
576 endcase 'tiPengine2ObjectsGetsEffects
578 '------------------------------------------------------------------------------------------------------------------------------------------------------
580 Function TestAnimations
581 '/// select in the listbox 'Effects' the second entry///'
588 i = Effects.GetItemCount
589 s = Speed.GetItemCount
590 AutomaticPreview.Check
591 Effects.TypeKeys "<HOME>"
594 if AutomaticPreview.isChecked = TRUE then sleep 1
595 Printlog "Effect has position Nr: " + Effects.GetSelIndex + ". Name of effect: " + Effects.GetSelText
596 '/// Select the next entry ///'
597 Effects.TypeKeys "<DOWN>"
598 p = Effects.GetSelIndex
600 Printlog "Test of effects ended."
604 if Speed.IsEnabled then
610 AutomaticPreview.Check
612 AutomaticPreview.Check