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_pengine.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 shaddow-function on a picture
38 '*******************************************************************
42 '\*******************************************************************
44 testcase tiPenginefast
45 ' dim i,t,q as integer
47 dim sFileName as string
49 '/// the Presentation-Engine consists of showing the presentation, with all it's effects. ///'
51 '/// Create a new presentation. ///'
56 '/// Open the test-file. ///'
57 Call hDateiOeffnen (gTesttoolpath + "graphics\required\input\allshapes.odp") 'effects.odp")
59 '/// Start the slideshow. ///'
62 kontext "DocumentPresentation"
63 DocumentPresentation.TypeKeys "<SPACE>"
64 '/// Wait for the presentation to reach a certain moment. ///'
66 DocumentPresentation.TypeKeys "<SPACE>"
68 DocumentPresentation.TypeKeys "<SPACE>"
70 DocumentPresentation.TypeKeys "<SPACE>"
72 '/// Press "Space" again, to continue with slide two. ///'
73 DocumentPresentation.TypeKeys "<SPACE>"
75 DocumentPresentation.TypeKeys "<SPACE>"
77 DocumentPresentation.TypeKeys "<SPACE>"
79 DocumentPresentation.TypeKeys "<SPACE>"
81 '/// And press "Space" again, to exit the presentation-mode. ///'
82 DocumentPresentation.TypeKeys "<SPACE>"
88 '/// Open the test-file. ///'
89 Call hDateiOeffnen (gTesttoolpath + "graphics\required\input\effects.odp")
90 '/// Start the slideshow. ///'
93 '/// Press "Space" again, to continue with slide two. ///'
94 kontext "DocumentPresentation"
95 DocumentPresentation.TypeKeys "<SPACE>"
97 printlog "End of first page."
98 DocumentPresentation.TypeKeys "<SPACE>"
100 printlog "End of second page."
101 DocumentPresentation.TypeKeys "<SPACE>"
103 printlog "End of third page."
104 DocumentPresentation.TypeKeys "<SPACE>"
106 printlog "End of fourth page."
107 DocumentPresentation.TypeKeys "<SPACE>"
109 printlog "End of fifth page."
110 DocumentPresentation.TypeKeys "<SPACE>"
111 printlog "End of sixth page."
112 DocumentPresentation.TypeKeys "<SPACE>"
114 printlog "End of seventh page."
115 DocumentPresentation.TypeKeys "<SPACE>"
117 printlog "End of eight page."
118 DocumentPresentation.TypeKeys "<SPACE>"
120 printlog "End of ninth page."
121 DocumentPresentation.TypeKeys "<SPACE>"
123 printlog "End of tenth page."
124 DocumentPresentation.TypeKeys "<SPACE>"
126 printlog "End of eleventh page."
127 if DocumentPresentation.Exists then
128 warnlog "DocumentPresentation shouldnt be visible right now."
129 DocumentPresentation.TypeKeys "<SPACE>"
131 printlog "Presentation ended correctly."
132 kontext "DocumentImpress"
135 '/// Insert a new slide. ///'
138 ' hTypekeys "<Pagedown>"
141 '/// Menu: Slideshow: Check every menu-item. ///'
144 ' #1 tSlideShowSlideShow
145 ' #1 tSlideShowRehearseTimings
146 ' #1 tSlideShowSlideShowSettings
147 ' #1 tSlideShowCustomSlideShow
148 ' #1 tSlideShowSlideTransition
149 ' #1 tSlideShowShowHideSlide
151 ' Slideshow menu 1 - Slide show
152 ' Slideshow menu 2 - Slide show settings
153 ' Slideshow menu 3 - Rehearse timings
154 ' Slideshow menu 4 - Interaction
155 ' Slideshow menu 6 - Slide Transition
156 ' Slideshow menu 7 - Show / Hide slide
157 ' Slideshow menu 8 - Custom Slide show
160 'Printlog " Here starts the test "
162 'Presentation - Start / Stop. Different ways to do it.
163 'Presentation - Effects.
166 '/// Slideshow Settings: Range: test all three alternatives. ///'
167 '/// Test if the Slideshow-types (Default, Window, Auto) works. ///'
168 '/// Check if the checkboxes works. ///'
169 '/// Close dialogue. ///'
170 '/// Add an object. ///'
171 '/// Custom Animation: Add an Animation to the object. ///'
172 '/// Run the slideshow. ///'
174 '/// Change to the next effect and continue through every animation in ///'
175 '/// Entrance, Emphasis, Exit and Motion Paths. ///'
176 '/// While testing - test the speed-choices for every kind of animation. ///'
177 '/// Check if the "Change" and "Remove"-buttons. ///'
178 '/// Check the Start, "Direction" and "Speed" variables. ///'
179 '/// Add two effects to one object and change the order. ///'
180 '/// Try the Play and "Slide Show"-button. ///'
181 '/// Try the Automatic preview-button. ///'
183 '/// Slidetransition. ///'
184 '/// Go through every kind of effect, speed, and sound. ///'
185 '/// Check loop until next sound. ///'
186 '/// Check the Advance slide with mouseclick-function. ///'
187 '/// Check the "Apply to all slides", "Play", and "Slide Show"-buttons. ///'
188 '/// Check Automatic preview. ///'
190 '/// Some effects doesnt have a right / left orientation. Test these. ///'
191 '/// Possibility: check random effects and see if something hangs. ///'
193 '/// Load/Save-test: Does the settings last? ///'
195 '/// Are two different objects dependant or independent from each other? ///'
197 '/// Close Application ///'
199 Printlog "Finished Optional-test for Presentation-Engine"
203 testcase tSlideShowInteraction
206 Dim Zaehler as integer
207 dim b115364 as boolean
209 Datei$ =ConvertPath (gOfficePath + "user\work\interac.sxi")
211 ' '/// save file as presentation with name '"user\\work\\diashow.sxi")' ///'
212 ' hFileSaveAsWithFilterKill ( sFile , gImpressFilter, FALSE )
213 ' Printlog "saved presetation: '" + sFile + "'"
215 '/// open application ///'
218 setStartCurrentPage(FALSE) '/// Set "start with current page to OFF ///'
220 '/// call 'Insert->Slide' three times and name the slides 2, 3, 4 and create a rectangle on it ///'
221 '///+ we now have 4 slides ?! :-) ///'
225 hTypekeys "<Pagedown>"
227 Call hRechteckErstellen (i*10,i*10,i*20,i*20)
231 '/// check state of navigator ! expected: closed -> open navigator ///'
233 if Navigator.exists then
234 warnlog "Navigator: already open :-("
236 printlog "Navigator: NOT available :-( will be opened now!"
241 '/// Slide Show->Interaction ///'
243 Kontext "TabInteraktion"
245 if AktionBeiMausklick.GetItemCount = 13 Then
246 Printlog "- List is complete"
248 Warnlog "- Number of possible actions is wrong. It should be: 13, but it is: " + AktionBeiMausklick.GetItemCount
252 AktionBeiMausklick.Select 1 'Keine Aktion bei Mausclick
253 Printlog (AktionBeiMausklick.GetSelText + " chosen")
254 If Durchsuchen.IsVisible then Warnlog "- Control should be invisible because AktionBeiMausklick = " + AktionBeiMausKlick.GetSelText
257 Kontext "TabInteraktion"
258 AktionBeiMausklick.Select 2 'Sprung zur vorhergehenden Seite
259 Printlog (AktionBeiMausklick.GetSelText + " chosen")
260 if Durchsuchen.IsVisible Then Warnlog "- Control should be invisible, beacause Action = " + AktionBeiMausKlick.GetSelText
263 Kontext "DocumentImpress"
269 Kontext "NavigatorDraw"
271 if Not Liste.GetSelIndex = 3 Then
272 Warnlog "- jumped to wrong slide"
274 Printlog "- jumped to correct slide"
278 Kontext "DocumentImpress"
284 Kontext "TabInteraktion"
285 AktionBeiMausklick.select 3 'Sprung zur naechsten Seite
286 Printlog (AktionBeiMausKlick.GetSelText + " chosen")
290 Kontext "DocumentImpress"
294 Kontext "NavigatorDraw"
295 if Liste.GetSelIndex <> 4 Then
296 Warnlog "- Jumped to wrong slide"
298 Printlog " Jumped to correct slide"
301 kontext "DocumentImpress"
307 Kontext "TabInteraktion"
308 AktionBeiMausklick.select 4 'Sprung zur ersten Seite
309 Printlog AktionBeiMausKlick.GetSelText
313 Kontext "DocumentImpress"
316 Kontext "NavigatorDraw"
317 if Liste.GetSelIndex <> 1 Then Warnlog "- jumped to wrong slide"
318 Letzte.Click 'Liste.Select 4
319 Kontext "DocumentImpress"
326 warnlog "SlideshowInteraction diasabled :-("
328 Kontext "TabInteraktion"
329 AktionBeiMausklick.select 5 'Sprung zur letzten Seite
330 printlog AktionBeiMausKlick.GetSelText
333 Kontext "NavigatorDraw"
334 if Not Liste.GetSelIndex = 1 Then Warnlog "- jumped to wrong slide"
336 kontext "DocumentImpress"
337 Call hRechteckErstellen 20,20,50,50
349 Kontext "TabInteraktion"
350 AktionBeiMausklick.select 6 'Sprung zu Seite oder Objekt
351 printlog AktionBeiMausKlick.GetSelText
353 if Not ListeSprungZuSeiteObjekt.IsVisible Then Warnlog " list seems to be invisible"
356 if ListeSprungZuSeiteObjekt.GetSelIndex <> 3 Then Warnlog " Search does not work"
357 printlog ListeSprungZuSeiteObjekt.GetSelIndex
361 Kontext "DocumentImpress"
365 Kontext "NavigatorDraw"
366 if Liste.GetSelIndex <> 2 Then Warnlog "- Jumped to wrong destination"
367 printlog Liste.GetSelIndex
369 Kontext "DocumentImpress"
373 Kontext "DocumentImpress"
377 Kontext "TabInteraktion"
379 AktionBeiMausKlick.Select 7 'Sprung zu Dokument
380 Printlog AktionBeiMausKlick.GetSelText + " chosen"
386 Dateiname.SetText ConvertPath (gTesttoolPath + "graphics\required\input\recht_49.sxi")
389 ' check if the document is writable
390 if fIsDocumentWritable = false then
391 ' make the document writable and check if it's succesfull
392 if fMakeDocumentWritable = false then
393 warnlog "The document can't be make writeable. Test stopped."
398 Warnlog "- Search button could not be accessed"
401 Kontext "TabInteraktion"
405 Kontext "DocumentImpress"
406 DocumentImpress.MouseDown 90,90
407 DocumentImpress.MouseUp 90,90
409 Kontext "DocumentImpress"
410 DocumentImpress.Mousedown 30,30
413 if messagebox.exists then
414 printlog "baeh: '" + messagebox.gettext + "'"
416 messagebox.ok ' was default in so7
418 warnlog "behaviour changed #115364# mother document gets closed :-("
419 if fileExists(ConvertPath (gOfficePath + "user\work\bug115364.sxi")) then
420 kill ConvertPath (gOfficePath + "user\work\bug115364.sxi")
422 messagebox.yes ' don't save changes, before going on!
424 kontext "SpeichernDlg"
425 Dateiname.setText ConvertPath (gOfficePath + "user\work\bug115364.sxi")
432 Kontext "DocumentImpress"
433 DocumentImpress.MouseUp 30,30
438 Kontext "DocumentImpress"
439 DocumentImpress.MouseDown 25,25
440 DocumentImpress.MouseUp 25,25
442 Warnlog "- Jump to document did not work or preview window did not appear"
445 if (not b115364) then
449 hDateiOeffnen (ConvertPath (gOfficePath + "user\work\bug115364.sxi"))
453 Kontext "NavigatorDraw"
457 Kontext "DocumentImpress"
462 Kontext "TabInteraktion"
464 AktionBeiMausKlick.Select 9
465 Printlog AktionBeiMausKlick.GetSelText + " chosen"
471 Kontext "TabInteraktion"
473 if not AktionBeiMausKlick.GetSelIndex = 9 Then Warnlog "- Not the right action chosen"
475 AktionBeiMausKlick.Select 9 'Klang abspielen
476 Printlog AktionBeiMausKlick.GetSelText + "- chosen"
480 Kontext "NavigatorDraw"
483 Kontext "DocumentImpress"
487 Kontext "TabInteraktion"
493 Dateiname.SetText ConvertPath (gTesttoolPath + "graphics\required\input\blip.wav")
498 if Active.Exists Then
499 Warnlog Active.GetText + " Gallery might be empty"
506 Kontext "TabInteraktion"
507 SetClipboard Klangwahl.GetText
511 Kontext "TabInteraktion"
513 if Klangwahl.GetText <> GetClipboardText then Warnlog "- Not the right sound chosen"
516 InsertGraphicsFromFile
518 Kontext "GrafikeinfuegenDlg"
520 if Verknuepfen.IsChecked then Verknuepfen.UnCheck
521 Dateiname.SetText ConvertPath (gTesttoolPath + "global\input\graf_inp\enter.bmp")
524 Kontext "NavigatorDraw"
529 Kontext "TabInteraktion"
531 AktionBeiMausKlick.Select 11 'Objektaktion ausfuehren
532 Printlog AktionBeiMausKlick.GetSelText + " chosen"
534 Zaehler=Effekt.GetItemCount
537 Printlog Effekt.GetSelText + " chosen"
539 if Langsam.IsEnabled Then Warnlog "- Control should not be enabled, because no effect chosen"
540 if Mittel.IsEnabled Then Warnlog "- Control should not be enabled, because no effect chosen"
541 if Schnell.IsEnabled Then Warnlog "- Control should not be enabled, because no effect chosen"
548 Kontext "TabInteraktion"
554 Kontext "TabInteraktion"
556 AktionBeiMausKlick.Select 10 'Objekt ausblenden
557 Printlog AktionBeiMausKlick.GetSelText + " chosen"
558 ListeObjektAktion.Select 1
566 Kontext "DocumentImage"
569 Kontext "TabInteraktion"
571 AktionBeiMausKlick.Select 13 'Makro
572 Printlog AktionBeiMausKlick.GetSelText + " chosen"
580 Kontext "TabInteraktion"
586 Kontext "TabInteraktion"
588 if not AktionBeiMausKlick.GetSelIndex = 12 Then Warnlog "- Wrong action used"
590 AktionBeiMausKlick.Select 14 'Praesentation beenden
591 Printlog AktionBeiMausKlick.GetSelText
595 SlideShowPresentationSettings
596 Kontext "Bildschirmpraesentation"
597 if not Fenster.IsChecked Then Fenster.Check
598 BildschirmPraesentation.OK
600 Kontext "DocumentImpress"
601 DocumentImpress.TypeKeys "<MOD1 F2>"
603 Kontext "DocumentPresentation"
605 DocumentPresentation.MouseDown 50,50
606 DocumentPresentation.MouseUp 50,50
609 Kontext "DocumentImpress"
611 Printlog "- Slideshow ended at right point"
613 Warnlog "- Program is still in slideshow mode"
614 Kontext "DocumentPresentation"
615 DocumentPresentation.TypeKeys "<ESCAPE>"
618 Kontext "DocumentImpress"
619 DocumentImpress.TypeKeys "<SHIFT MOD1 F5>"
621 setStartCurrentPage(TRUE) '/// Set "start with current page to ON = Default ///'
625 ' Slideshow menu 5 - Custom Animation
627 testcase tSlideShowCustomAnimation
628 dim bError as boolean
630 '/// open application ///'
632 '/// create textbox with text ///'
633 Call hTextrahmenErstellen ("Test text to test text effects", 10, 10, 20, 40 )
634 '/// Slide Show->Custom Animation... ///'
635 SlideShowCustomAnimation
637 '/// click button 'Add...' ///'
639 '/// Dialog 'Custom Animation' comes up ///'
641 '/// Switch to TabPage: Entrance ///'
642 active.setPage(TabEntrance)
643 kontext "TabEntrance"
644 if TabEntrance.exists(5) then
645 DialogTest(TabEntrance)
646 '/// select in the listbox 'Effects' the second entry ///'
649 AutomaticPreview.unCheck
651 AutomaticPreview.Check
653 '/// Switch to TabPage: Emphasis ///'
654 active.setPage(TabEmphasis)
655 kontext "TabEmphasis"
656 if TabEmphasis.exists(5) then
657 DialogTest(TabEmphasis)
660 warnlog "Impress:Tasks Pane:Custom Animation:TabEmphasis tabPage doesn't work."
663 '/// Switch to TabPage: Exit ///'
664 active.setPage(TabExit)
666 if TabExit.exists(5) then
670 warnlog "Impress:Tasks Pane:Custom Animation:TabExit tabPage doesn't work."
673 '/// Switch to TabPage: Motion Paths ///'
674 active.setPage(TabMotionPaths)
675 kontext "TabMotionPaths"
676 if TabMotionPaths.exists(5) then
677 DialogTest(TabMotionPaths)
681 warnlog "Impress:Tasks Pane:Custom Animation:TabMotionPaths tabPage doesn't work."
683 '/// Close dialog 'Custom Animation' with 'OK' ///'
688 warnlog "Impress:Tasks Pane:Custom Animation:Add... button didn't work."
692 '/// click button 'Change...' ///'
694 '/// Dialog 'Custom Animation' comes up ///'
696 '/// Switch to TabPage: Entrance ///'
697 active.setPage(TabEntrance)
698 kontext "TabEntrance"
699 if (NOT TabEntrance.exists(5)) then
700 warnlog "Impress:Tasks Pane:Custom Animation:Change... button didn't work."
704 EffectStart.getItemCount
705 if EffectProperty.isEnabled then
706 EffectProperty.getItemCount
708 '/// CLick on button '...' (Options) ///'
711 if TabEffect.exists(5) then
712 dialogTest(TabEffect)
714 AfterAnimation.getItemCount
715 '/// switch to TabPage 'Timing' ///'
717 active.setPage TabTiming
719 if TabTiming.exists(5) then
720 dialogTest(TabTiming)
721 TimingStart.getItemCount
726 TriggerAnimate.isChecked
727 TriggerStart.isChecked
730 warnlog "Impress:Tasks Pane:Custom Animation:Effect Options: Timing TabPage didn't work."
732 '/// switch to TabPage 'Timing' ///'
734 active.setPage TabTextAnimation
735 kontext "TabTextAnimation"
736 if TabTextAnimation.exists(5) then
737 dialogTest(TabTextAnimation)
738 GroupText.getItemCount
739 AnimateAttachedShape.isChecked
740 TabTextAnimation.cancel
742 warnlog "Impress:Tasks Pane:Custom Animation:Effect Options: TextAnimation TabPage didn't work."
745 warnlog "Impress:Tasks Pane:Custom Animation:... button didn't work."
748 EffectSpeed.getItemCount
749 EffectList.getItemCount
751 EffectSlideShow.click
753 kontext "DocumentPresentation"
754 if DocumentPresentation.exists (5) then
755 printlog "Presentation started :-)"
756 DocumentPresentation.typeKeys "<escape>"
758 warnlog "Impress:Tasks Pane:Custom Animation:Slide Show button doesn't start slideshow!"
761 EffectAutomaticPreview.isChecked
762 '/// click button 'Remove' ///'
765 '/// close application ///'