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_slideshow2.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 :
38 '*******************************************************************
40 ' #1 tPraesentationAnimation
41 ' #1 tPraesentationEffekt
42 ' #1 tSlideShowInteraction
43 ' #1 tAendernObjektBenennen
44 ' #1 tSlideshowBackgroundAllSlides
45 ' #1 tSlideshowBackgroundSelectedSlide
47 '\******************************************************************
49 testcase tPraesentationAnimation
51 Printlog "- Slideshow/Animation"
53 Call hNewDocument '/// new document ///'
55 InsertGraphicsFromFile '/// insert graphic ///'
57 Dateiname.SetText ConvertPath (gTesttoolPath + "global/input/graf_inp/desp.bmp")
62 gMouseClick 90,90 '/// deselect graphic ///'
64 InsertGraphicsFromFile '/// insert 2nd graphic ///'
66 Dateiname.SetText ConvertPath (gTesttoolPath + "global/input/graf_inp/borabora.jpg")
71 Call hTypekeys "<TAB>"
73 Opl_SD_EffekteZulassen '/// open animation dialogue ///'
77 BildAufnehmen.Click '/// add graphic 10 times ///'
81 if AnzahlBilder.GetText <> "10" Then '/// get number of frames (should be 10) ///'
82 WarnLog " - Adding pictures did not work"
84 PrintLog " Pictures added"
87 if AlleAufnehmen.IsEnabled Then WarnLog " - Add all should not be enabled because only 1 object is selected"
89 Kontext "DocumentImpress"
90 EditSelectAll '/// select both graphics in document ///'
96 AlleAufnehmen.Click '/// add them 5 times (10 frames) ///'
100 if AnzahlBilder.GetText <> "20" Then '/// compare total numbers of frame ///'
101 WarnLog " - Adding pics does not work"
103 PrintLog " all pics added"
106 ErstesBild.Click '/// jump to 1st frame ///'
108 if AnzahlBilder.GetText <> "1" Then '/// get number index of selected frame ///'
109 WarnLog " - Jump back to beginning does not work"
111 PrintLog " Jump back to beginning works"
114 LetztesBild.Click '/// jump to last frame ///'
116 if AnzahlBilder.GetText <> "20" Then '/// control number index of selected frame ///'
117 WarnLog " - Jump to end does not work"
119 PrintLog " Jumped to end"
122 Abspielen.Click '/// play animation ///'
124 Kontext "DocumentImpress"
125 EditSelectAll '/// delete graphics in document ///'
126 DocumentImpress.TypeKeys "<DELETE>"
129 Erstellen.Click '/// create animation ///'
132 Kontext "DocumentImpress"
134 EditCopy '/// try to copy created animation to make sure it is created ///'
135 PrintLog " Animation created"
137 WarnLog " - Animation not created"
142 if AnimationsgruppeGruppenobjekt.IsChecked = True Then '/// set duration time of frames ///'
144 AnzeigedauerProBild.SetText "1"
145 WarnLog " - Control should be disabled"
147 PrintLog " Control disabled because Groupobjekt = " + AnimationsgruppeGruppenobjekt.IsChecked
151 AnimationsgruppeBitmapobjekt.Check '/// check group object ///'
153 AnzeigedauerProBild.SetText "3" '/// set frame visibility time to 3 ///'
154 SetClipboard AnzeigedauerProBild.GetText
155 AnzeigedauerProBild.More '/// raise value for frame time ///'
156 if AnzeigedauerProBild.GetText<> GetClipboardText Then
157 PrintLog " Duration per frame works"
159 WarnLog " - Duration could not be changed"
163 Zaehler = AnzahlDurchlaeufe.GetItemCount '/// test different settings for pass amount ///'
165 AnzahlDurchlaeufe.Select i
167 PrintLog " Number of loops is set"
170 ZaehlerAnpassung=Anpassung.GetItemCount
171 for i=1 to ZaehlerAnpassung
175 BildLoeschen.Click '/// delete 1 frame ///'
176 if AnzahlBilder = "20" Then
177 WarnLog " - Deleting pictures does not work"
179 PrintLog " Picture No.20 deleted"
182 AlleLoeschen.Click '/// delete all frames ///'
188 if Abspielen.IsEnabled = true Then '/// check if play button is still active ///'
189 WarnLog " - Not all pics are deleted"
191 PrintLog " All pics deleted"
194 Animation.Close '/// close animation flyer ///'
196 Call hCloseDocument '/// close document ///'
199 '---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
201 testcase tPraesentationEffekt
202 qaerrorlog "Test not yet ready."
204 Printlog "- Slideshow/Effect"
216 Call hNewDocument '/// new document ///'
217 '/// check state of navigator ! expected: closed ///'
219 if Navigator.exists then
220 '///+ close navigator ! ///'
222 Warnlog "Navigator was open. Check earlier tests. Now closed."
224 printlog "Navigator: NOT available. Good."
227 kontext "DocumentImpress"
229 hRechteckErstellen (20,20,50,50) '/// create rectangle ///'
232 Printlog " - Test effects"
233 gMouseClick 90,90 '/// deselect rectangle ///'
235 DocumentImpress.TypeKeys "<TAB>" '/// select rectangle ///'
237 DocumentImpress.TypeKeys "<F2>" '/// go into text edit mode (F2) ///'
239 DocumentImpress.TypeKeys "test text to test text effects" '/// type text into the rectangle ///'
241 DocumentImpress.TypeKeys "<ESCAPE>"
243 DocumentImpress.TypeKeys "<TAB>"
249 Zaehler=Effekteliste.GetItemCount
250 for i=2 to Zaehler '/// Start from the second entry since the first one is "No effect" ///'
251 Effekteliste.Select i
252 SetClipboard Effekteliste.GetSelText
253 Effekt.TypeKeys "<TAB>"
254 Effekteauswahl.TypeKeys "<RIGHT>" ,2
263 if GetClipboardText<>Effekteliste.GetSelText Then Warnlog " - Invisible color not changed"
267 Printlog " - Test speed setting"
272 ZaehlerKmh=Geschwindigkeit.GetItemCount
273 for j=1 to ZaehlerKmh
274 Geschwindigkeit.Select j
275 SetClipboard Geschwindigkeit.GetSelText
282 if GetClipboardText <> Geschwindigkeit.GetSelText Then Warnlog " - Speed setting did not change"
284 Printlog " - Test text effects"
287 ZaehlerText=TexteffekteListe.GetItemCount
288 for k=1 to ZaehlerText
289 TexteffekteListe.Select k
290 SetClipboard TexteffekteListe.GetSelText
291 Effekt.TypeKeys "<TAB>"
292 Texteffektauswahl.TypeKeys "<RIGHT>" ,2
305 Printlog " - Test invisible color"
307 Effekteliste.Select 1
308 Effekteauswahl.TypeKeys "<RIGHT>" ,2
314 Warnlog "- Extras Button not active"
320 if (NOT Abblendfarbe.IsEnabled) then
321 MitFarbeAbblenden.Click
324 if Abblendfarbe.IsEnabled = False Then Warnlog " - Control should not be enabled"
332 Effekteliste.Select 1
333 Effekteauswahl.TypeKeys "<RIGHT>" ,3
337 Effekteauswahl.TypeKeys "<RIGHT>"
343 Printlog " - Test blend with color"
344 MitFarbeAbblenden.Click
348 Abblendfarbe.Select Zufall
349 SetClipboard Abblendfarbe.GetSelText
353 MitFarbeAbblenden.Click
356 Abblendfarbe.Select Zufall
357 SetClipboard Abblendfarbe.GetSelText
361 Printlog " - Test order"
363 Effekteliste.Select 2
367 Printlog " - Test preview"
368 Vorschaufenster.Click
371 if Vorschau.Exists = False Then Warnlog " - Preview window does not exist"
379 if NOT klang.Exists then
380 warnlog "- Control Sound does not exist"
382 if Klangliste.Exists = false Then Klang.Click
384 ZaehlerTon = Klangliste.GetItemCount
385 for n=1 to ZaehlerTon
388 SetClipboard Klangliste.GetSelText
389 VollstaendigAbspielen.Click
392 Kontext "DocumentImpress"
401 if Klangliste.IsVisible = False Then Klang.Click
408 '---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
410 testcase tSlideShowInteraction
413 Dim Zaehler as integer
414 dim b115364 as boolean
416 Datei$ = ConvertPath (gOfficePath + "user\work\interac.odp")
418 '/// open application ///'
421 setStartCurrentPage(TRUE) '/// Set "start with current page to ON ///'
423 '/// call 'Insert->Slide' three times and name the slides 2, 3, 4 and create a rectangl� on it ///'
424 '///+ we now have 4 slides ?! :-) ///'
425 Kontext "DocumentImpress"
429 hTypekeys "<Pagedown>" , 10 ' workaround for issue i56267. Has to be removed when cws impress73 has be integrated
431 Kontext "DocumentImpress"
433 Call hRechteckErstellen (i*10,i*10,i*20,i*20)
437 '/// check state of navigator ! expected: closed -> open navigator ///'
439 if Navigator.exists then
440 qaerrorlog "Navigator: already open :-("
442 printlog "Navigator: NOT available :-) will be opened now."
443 Kontext "DocumentImpress"
444 DocumentImpress.TypeKeys "<MOD1 SHIFT F5>"
449 '/// Slide Show->Interaction ///'
451 Kontext "TabInteraktion"
453 if AktionBeiMausklick.GetItemCount = 11 Then
454 Printlog "- List is complete"
456 Warnlog "- Number of possible actions is wrong. It should be: 11, but it is: " + AktionBeiMausklick.GetItemCount
460 AktionBeiMausklick.Select 1 'Keine Aktion bei Mausclick
461 Printlog (AktionBeiMausklick.GetSelText + " chosen")
462 If Durchsuchen.IsVisible then Warnlog "- Control should be invisible because AktionBeiMausklick = " + AktionBeiMausKlick.GetSelText
465 Kontext "TabInteraktion"
466 AktionBeiMausklick.Select 2 'Go to previous Slide
467 Printlog (AktionBeiMausklick.GetSelText + " chosen")
468 if Durchsuchen.IsVisible Then Warnlog "- Control should be invisible, beacause Action = " + AktionBeiMausKlick.GetSelText
471 Kontext "DocumentImpress"
477 Kontext "NavigatorDraw"
479 if Not Liste.GetSelIndex = 3 Then
480 Warnlog "- jumped to wrong slide"
482 Printlog "- jumped to correct slide"
486 Kontext "DocumentImpress"
492 Kontext "TabInteraktion"
493 AktionBeiMausklick.select 3 'Go to next Slide
494 Printlog (AktionBeiMausKlick.GetSelText + " chosen")
497 Kontext "DocumentImpress"
503 Kontext "NavigatorDraw"
504 if Liste.GetSelIndex <> 4 Then
505 Warnlog "- Jumped to wrong slide. Jumped to " + Liste.GetSelIndex + " instead of 4."
507 Printlog " Jumped to correct slide"
510 kontext "DocumentImpress"
516 Kontext "TabInteraktion"
517 AktionBeiMausklick.select 4 'Go to first Slide
518 Printlog AktionBeiMausKlick.GetSelText
522 Kontext "DocumentImpress"
528 Kontext "NavigatorDraw"
529 if Liste.GetSelIndex <> 1 Then Warnlog "- jumped to wrong slide. Jumped to " + Liste.GetSelIndex + " instead of 1."
530 Letzte.Click 'Liste.Select 4
531 Kontext "DocumentImpress"
538 warnlog "SlideshowInteraction diasabled :-("
540 Kontext "TabInteraktion"
541 AktionBeiMausklick.select 5 'Go to last page
542 printlog AktionBeiMausKlick.GetSelText
545 Kontext "NavigatorDraw"
546 if Not Liste.GetSelIndex = 1 Then Warnlog "- jumped to wrong slide"
548 kontext "DocumentImpress"
551 hMouseClick DocumentImpress,50,50
552 Call hRechteckErstellen 20,20,50,50
564 Kontext "TabInteraktion"
565 AktionBeiMausklick.select 6 'Sprung zu Seite oder Objekt
566 printlog AktionBeiMausKlick.GetSelText
568 if Not ListeSprungZuSeiteObjekt.IsVisible Then Warnlog " list seems to be invisible"
571 if ListeSprungZuSeiteObjekt.GetSelIndex <> 3 Then
572 Warnlog " Search does not work. Current slide is: " + ListeSprungZuSeiteObjekt.GetSelText
577 Kontext "DocumentImpress"
582 Kontext "NavigatorDraw"
583 if Liste.GetSelIndex <> 2 Then
584 Warnlog "- Jumped to wrong destination"
585 printlog Liste.GetSelIndex
587 Liste.TypeKeys "<RETURN>"
589 Kontext "DocumentImpress"
593 Kontext "DocumentImpress"
597 Kontext "TabInteraktion"
599 AktionBeiMausKlick.Select 7 'Go to Document
600 Printlog AktionBeiMausKlick.GetSelText + " chosen"
606 Dateiname.SetText ConvertPath (gTesttoolPath + "graphics\required\input\recht_49.odp")
609 Kontext "TabInteraktion"
613 Kontext "DocumentImpress"
615 Warnlog "- Search button could not be accessed"
618 DocumentImpress.MouseDown 90,90
619 DocumentImpress.MouseUp 90,90
621 Kontext "DocumentImpress"
622 DocumentImpress.Mousedown 30,30
625 if messagebox.exists then
626 printlog "baeh: '" + messagebox.gettext + "'"
628 messagebox.ok ' was default in so7
630 warnlog "behaviour changed #115364# mother document gets closed :-("
631 if fileExists(ConvertPath (gOfficePath + "user\work\bug115364.odp")) then
632 kill ConvertPath (gOfficePath + "user\work\bug115364.odp")
634 messagebox.yes ' don't save changes, before going on!
636 kontext "SpeichernDlg"
637 Dateiname.setText ConvertPath (gOfficePath + "user\work\bug115364.odp")
644 Kontext "DocumentImpress"
645 DocumentImpress.MouseUp 30,30
650 Kontext "DocumentImpress"
651 DocumentImpress.MouseDown 25,25
652 DocumentImpress.MouseUp 25,25
654 Warnlog "- Jump to document did not work or preview window did not appear"
657 if (not b115364) then
661 hFileOpen (ConvertPath (gOfficePath + "user\work\bug115364.odp"))
665 '/// Do Page down + Page up due to focusing-problems ///'
667 hTypeKeys "<PAGEDOWN>"
669 Kontext "NavigatorDraw"
670 if NavigatorDraw.Exists = FALSE then
671 qaerrorlog "Navigator: NOT available :-( will be opened now!"
672 Kontext "DocumentImpress"
673 DocumentImpress.TypeKeys "<MOD1 SHIFT F5>"
675 printlog "Navigator: already open :-)"
677 Kontext "NavigatorDraw"
679 if Naechste.IsEnabled then
682 warnlog "'Next' wasn't visible. Clicking 'First' + Two 'Next'."
690 Kontext "DocumentImpress"
695 Kontext "TabInteraktion"
697 AktionBeiMausKlick.Select 8
698 Printlog AktionBeiMausKlick.GetSelText + " chosen"
703 Kontext "TabInteraktion"
705 if not AktionBeiMausKlick.GetSelIndex = 8 Then Warnlog "- Not the right action chosen"
707 AktionBeiMausKlick.Select 8 'Play sound
708 Printlog AktionBeiMausKlick.GetSelText + "- chosen"
712 Kontext "NavigatorDraw"
715 Kontext "DocumentImpress"
719 Kontext "TabInteraktion"
725 Dateiname.SetText ConvertPath (gTesttoolPath + "graphics\required\input\blip.wav")
730 if Active.Exists Then
731 Warnlog Active.GetText + " Gallery might be empty"
738 Kontext "TabInteraktion"
739 SetClipboard Klangwahl.GetText
743 Kontext "TabInteraktion"
745 if Klangwahl.GetText <> GetClipboardText then Warnlog "- Not the right sound chosen"
748 InsertGraphicsFromFile
750 Kontext "GrafikeinfuegenDlg"
752 if Verknuepfen.IsChecked then Verknuepfen.UnCheck
753 Dateiname.SetText ConvertPath (gTesttoolPath + "global\input\graf_inp\enter.bmp")
756 Kontext "NavigatorDraw"
761 Kontext "TabInteraktion"
763 AktionBeiMausKlick.Select 9 'Objektaktion ausfuehren
764 Printlog AktionBeiMausKlick.GetSelText + " chosen"
766 Zaehler=Effekt.GetItemCount
769 Printlog Effekt.GetSelText + " chosen"
774 Kontext "TabInteraktion"
780 Kontext "TabInteraktion"
782 AktionBeiMausKlick.Select 11 'Macro
783 Printlog AktionBeiMausKlick.GetSelText + " chosen"
787 Kontext "ScriptSelector"
789 ScriptSelector.Cancel
791 Kontext "TabInteraktion"
797 Kontext "TabInteraktion"
799 if not AktionBeiMausKlick.GetSelIndex = 11 Then Warnlog "- Wrong action used"
801 AktionBeiMausKlick.Select 12 'End Presentation
802 Printlog AktionBeiMausKlick.GetSelText
806 SlideShowPresentationSettings
807 Kontext "Bildschirmpraesentation"
808 if not Fenster.IsChecked Then Fenster.Check
809 BildschirmPraesentation.OK
811 Kontext "DocumentImpress"
812 DocumentImpress.TypeKeys "<F5>"
814 Kontext "DocumentPresentation"
816 DocumentPresentation.MouseDown 50,50
817 DocumentPresentation.MouseUp 50,50
819 if DocumentPresentation.Exists then
820 qaerrorlog "#i51418# Sound played instead of ending presentation"
821 DocumentPresentation.TypeKeys "<ESCAPE>"
825 Kontext "DocumentImpress"
827 Printlog "- Slideshow ended at right point"
829 Warnlog "- Program is still in slideshow mode"
830 Kontext "DocumentPresentation"
831 DocumentPresentation.TypeKeys "<ESCAPE>"
834 Kontext "DocumentImpress"
835 '/// Close the Navigator ///'
836 DocumentImpress.TypeKeys "<MOD1 SHIFT F5>"
838 '/// Set "start with current page to ON = Default ///'
839 setStartCurrentPage(TRUE)
843 '---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
845 testcase tAendernObjektBenennen
846 Printlog "- Context/Name object"
849 Kontext "DocumentImpress"
850 if NOT DocumentImpress.Exists then
851 Warnlog "- Due to Bug 91799 the document disappeared right after loading"
856 hRechteckErstellen (20,20,30,30)
858 hRechteckErstellen (60,60,80,80)
860 gMouseMove (10,10,90,90)
861 Printlog " - check if menu entry is disabled for normal objects"
864 Warnlog " function should be only enabled for graphics, ole objects and groups"
866 Printlog " Function disabled"
869 Kontext "DocumentImpress"
875 Kontext "NameDlgObject"
876 NameField.SetText "Test"
879 Printlog " - Name object worked"
880 Kontext "DocumentImpress"
882 DocumentImpress.TypeKeys "<DEL>"
883 InsertGraphicsFromFile
884 Kontext "GrafikEinfuegenDlg"
885 Dateiname.SetText ConvertPath (gTesttoolPath + "global\input\graf_inp\enter.bmp")
891 printlog " - Name a graphic file"
894 Kontext "NameDlgObject"
895 Namefield.SetText "Grafik"
898 Printlog " - Name a graphic object did work"
900 Warnlog " - Function should have been enabled"
907 '---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
909 testcase tSlideshowBackgroundAllSlides
911 Dim Background$ as string
913 Dim Zaehler as integer
914 Background$ = ConvertPath(gOfficeBasisPath + "share\gallery\emoticons\grin.gif")
915 Datei$ = ConvertPath (gOfficePath + "user\work\background.odp")
917 '/// Create a new document ///'
918 Printlog "- SlideshowBackground"
921 '/// Insert a new Slide ///'
922 Kontext "DocumentImpress"
925 '/// Open the Contextmenu ///'
926 DocumentImpress.OpenContextMenu
928 '/// Select the entry "Slide" ///'
929 hMenuFindSelect (".uno:PageMenu", true, 1, true)
930 '/// Select the entry "Background" ///'
933 '/// In the open-file dialogue, choose and open a graphic-file you wish to have as a background ///'
934 kontext "GrafikEinfuegenDlg"
935 If GrafikEinfuegenDlg.Exists Then
936 DateiName.SetText (Background$)
939 warnlog "GrafikEinfuegenDlg not existent... check why."
942 '/// If an "active"-message shows up, press "yes" to apply this background to all slides. ///'
944 if Active.Exists then
947 QaErrorLog "No dialogue considering if we wish to apply the background to all slides."
950 '/// Save the document ///'
951 Call hFileSaveAsKill (Datei$)
952 '/// Close the document ///'
954 '/// Open the document ///'
955 Call hFileOpen (Datei$)
956 '/// Close the document ///'
960 '---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
962 testcase tSlideshowBackgroundSelectedSlide
964 Dim Background$ as string
966 Dim Zaehler as integer
967 Background$ = ConvertPath(gOfficeBasisPath + "share\gallery\emoticons\grin.gif")
968 Datei$ = ConvertPath (gOfficePath + "user\work\background.odp")
970 '/// Create a new document ///'
971 Printlog "- SlideshowBackground"
974 '/// Insert a new Slide ///'
975 Kontext "DocumentImpress"
978 '/// Open the Contextmenu ///'
979 DocumentImpress.OpenContextMenu
981 '/// Select the entry "Slide" ///'
982 hMenuFindSelect (".uno:PageMenu", true, 1, true)
983 '/// Select the entry "Background" ///'
986 '/// In the open-file dialogue, choose and open a graphic-file you wish to have as a background ///'
987 kontext "GrafikEinfuegenDlg"
988 If GrafikEinfuegenDlg.Exists Then
989 DateiName.SetText (Background$)
992 warnlog "GrafikEinfuegenDlg not existent... check why."
995 '/// If an "active"-message shows up, press "No" to only apply this background to the selected slide. ///'
997 if Active.Exists then
1000 QaErrorLog "No dialogue considering if we wish to apply the background to all slides."
1003 '/// Save the document ///'
1004 Call hFileSaveAsKill (Datei$)
1005 '/// Close the document ///'
1007 '/// Open the document ///'
1008 Call hFileOpen (Datei$)
1009 '/// Close the document ///'
1013 '---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------