summaryrefslogtreecommitdiff
path: root/testautomation/graphics/optional/includes/impress/i_slideshow3.inc
blob: dc6277f7b608ff3fa6639de60ba057c1e96af394 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
'encoding UTF-8  Do not remove or change this line!
'**************************************************************************
'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'* 
'* Copyright 2008 by Sun Microsystems, Inc.
'*
'* OpenOffice.org - a multi-platform office productivity suite
'*
'* $RCSfile: i_slideshow3.inc,v $
'*
'* $Revision: 1.1 $
'*
'* last change: $Author: jsi $ $Date: 2008-06-16 10:42:42 $
'*
'* This file is part of OpenOffice.org.
'*
'* OpenOffice.org is free software: you can redistribute it and/or modify
'* it under the terms of the GNU Lesser General Public License version 3
'* only, as published by the Free Software Foundation.
'*
'* OpenOffice.org is distributed in the hope that it will be useful,
'* but WITHOUT ANY WARRANTY; without even the implied warranty of
'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'* GNU Lesser General Public License version 3 for more details
'* (a copy is included in the LICENSE file that accompanied this code).
'*
'* You should have received a copy of the GNU Lesser General Public License
'* version 3 along with OpenOffice.org.  If not, see
'* <http://www.openoffice.org/license.html>
'* for a copy of the LGPLv3 License.
'*
'/************************************************************************
'*
'* Owner : wolfram.garten@sun.com
'*
'* short description :
'*
'*******************************************************************
' #1 tExtrasInteraktion
' #1 tExtrasEffekt
' #1 tExtrasPraesentationseinstellungen
' #1 tExtrasIndividuellePraesentation
' #1 tExtrasInteraktion
' #1 tSlideshowContextMenuOneSlide
' #1 tSlideshowContextMenuMoreSlides
' #1 tiMousePointerHides
'\******************************************************************

testcase tExtrasInteraktion
    Printlog " -  SlideShow/Interaction"
 Call hNewDocument
 sleep 1
 Call hTextrahmenErstellen ("Seite 1",10,10,40,40)		'/// create textbox ///'
 SlideShowPresentationSettings							'/// Set slide show settings ///'
 Kontext "Bildschirmpraesentation"
 NavigatorSichtbar.Check								'/// Navigator visible ///'
 Bildschirmpraesentation.OK
 SlideShowInteraction									'/// open Interaction ///'
 Kontext "Interaktion"
 if Interaktion.exists(5)then
    AktionBeiMausklick.Select 1							'/// Select "Go to previous slide" ///'
 else
    Print "Interaction doesnt exist, something is wrong here."
 endif
 Interaktion.OK
 Kontext "DocumentImpress"
 SlideShowSlideshow								        '/// Run slideshow ///'
 Sleep (2)
 Kontext "DokumentPraesentation"
 DokumentPraesentation.TypeKeys "<ESCAPE>"
 Sleep 2
 Kontext "DocumentImpress"
 gMouseClick 20,20
 EditSelectAll
  try
     EditCopy
     Printlog "  Interaction ->No action works"
     Kontext "DocumentImpress"
  catch
     Warnlog "  - Interaction->does not work properly: Should be: Page 2  but it is: " + GetClipboardText
     DocumentImpress.TypeKeys "<ESCAPE>"
     Kontext "DocumentImpress"
  endcatch
 hCloseDocument
 Call hNewDocument
 Call hRechteckErstellen (50,50,80,80)							'/// create rectangle ///'
 SlideShowInteraction
 Kontext "Interaktion"
 Dim i
 Dim Zaehler
 Zaehler=AktionBeiMausklick.GetItemCount
  For i=2 to Zaehler
      AktionBeiMausklick.Select i							'/// select actions ///'
      SetClipboard AktionBeiMausklick.GetSelText
      Interaktion.OK
      Kontext "DocumentImpress"
      EditSelectAll
      SlideShowInteraction
      Kontext "Interaktion"
        if GetClipboardText<>AktionBeiMausklick.GetSelText Then
           Warnlog "  Action at mouseclick - " + GetClipboardText + " - not taken"		'/// control if action is saved (closing reopening dialog) ///'
        else
           Printlog "  Action at mouseclick - " + GetClipboardText + " - runs"
        end if
  next i
  Interaktion.OK
   sleep 1
 Call hCloseDocument									'/// close document ///'
endcase

testcase tExtrasEffekt
    qaerrorlog "Test not yet ready."
     goto endsub
 Dim i
 Dim j
 Dim k
 Dim l
 Dim m
 Dim n
 Dim Zaehler
 Dim ZaehlerKmh
 Dim ZaehlerText
 Dim ZaehlerTon
 Dim Zufall
 Call hNewDocument									'/// New impress document ///'

   '///  check state of navigator ! expected: closed ///'
   Kontext "Navigator"
   if Navigator.exists then
      '///+ close navigator ! ///'
      Navigator.Close
      Warnlog "Navigator was open. Check earlier tests. Now closed."
   else
      printlog "Navigator: NOT available. Good."
   endif

 gMouseClick 50,50
 hRechteckErstellen (20,20,50,50)					'/// create rectangle ///'
 sleep 2
 DocumentImpress.TypeKeys "<F2>"
 DocumentImpress.TypeKeys "- This is text to test the text effects of the Effects flyer"
 sleep 1
 gMouseClick 90,90									'/// deselect rectangle ///'
 DocumentImpress.TypeKeys "<TAB>"							'/// reselect rectangle ///'

  sleep 1
  Kontext "Effekt"
    Printlog "  - Test effect flyer"

  SlideShowEffects									'/// Open effect flyer ///'
  Kontext "ExtrasEffekt"
  sleep 1
  Effekte.Click
  Zaehler=Effekteliste.GetItemCount					'/// select each effect 1 time, assign effect and close dialog ///'
    for i=1 to Zaehler								'/// reopen dialog and check if the effect is still there ///'
        Effekteliste.Select i
        SetClipboard Effekteliste.GetSelText
        Effekt.TypeKeys "<TAB>"
        Effekteauswahl.TypeKeys "<RIGHT>" ,2
        sleep 1
        Zuweisen.Click
        Effekt.Close
        SlideShowEffects
        Kontext "Effekt"
        sleep 1
         if GetClipboardText<>Effekteliste.GetSelText Then Warnlog "  - Invisible color not chosen"
            printlog GetClipboardText + " should be " + Effekteliste.GetSelText

            sleep 1
    next i
    sleep 2
  Texteffekte.Click									'/// test text effects ///'
  sleep 1
  ZaehlerKmh=Geschwindigkeit.GetItemCount
    for j=1 to ZaehlerKmh
        Geschwindigkeit.Select j
        SetClipboard Geschwindigkeit.GetSelText
        Zuweisen.Click
        Effekt.Close
        SlideShowEffects
        Kontext "Effekt"
        sleep 1
         if GetClipboardText<>Geschwindigkeit.GetSelText Then Warnlog "  - Speed not taken over"
    next j
     Printlog "  - Speed test ok"

     Printlog "  - Test text effects"
  Texteffekte.Click
  sleep 1
  ZaehlerText=TexteffekteListe.GetItemCount
    for k=1 to ZaehlerText
        TexteffekteListe.Select k
        printlog TexteffekteListe.GetSelText + "-effect choosen"
        SetClipboard TexteffekteListe.GetSelText
        Effekt.TypeKeys "<TAB>"
        Texteffektauswahl.TypeKeys "<RIGHT>" ,2
        N:    	Zuweisen.Click
        sleep 1
        Effekt.Close
        SlideShowEffects
        Kontext "Effekt"
        sleep 1
        Texteffekte.Click
        printlog "and when we closed the window and opened again... " + TexteffekteListe.GetSelText + " was choosen"
        sleep 1
         if GetClipboardText<>TexteffekteListe.GetSelText Then Warnlog "  - Texteffect did not changed"
            sleep 1
    next k
     Printlog "  - Test invisible color"
  Effekte.Click
  Effekteliste.Select 1
  Effekteauswahl.TypeKeys "<RIGHT>",2
  Zuweisen.Click
  sleep 1
  Extras.Click
  sleep 1
  randomize
  Zufall=((2*Rnd)+1)
    for l=1 to 4
        UnsichtbarMachen.Click
        sleep 1
         if Abblendfarbe.IsEnabled=True Then Warnlog "  - control shouldn't be enabled"
        Zuweisen.Click
        Effekt.Close
        SlideShowEffects
        Kontext "Effekt"
        sleep 1
        Effekteauswahl.TypeKeys "<RIGHT>",2
        Extras.Click										'/// test extras ///'
        sleep 1
        UnsichtbarMachen.Click
        sleep 1
        Zuweisen.Click
        sleep 1
    next l
     Printlog "  - Blend with color"
    sleep 2
    for m=1 to 5
        MitFarbeAbblenden.Click
        sleep 2
        Abblendfarbe.Select Zufall
        SetClipboard Abblendfarbe.GetSelText
        Zuweisen.Click
        Effekt.Close
        SlideShowEffects
        Kontext "Effekt"
        sleep 1
        Effekteauswahl.TypeKeys "<RIGHT>",3
        sleep 1
        Extras.Click
        sleep 1
        MitFarbeAbblenden.Click
        sleep 1
        Zuweisen.Click
        sleep 1
'	     if GetClipboardText<>Abblendfarbe.GetSelText Then Warnlog "  - Blendingcolor did not take over"
    next m
     Printlog "  - Test order"
  Effekte.Click
  sleep 1
  Effekteliste.Select 2
  Zuweisen.Click
  Reihenfolge.Click
  sleep 1
  sleep 1
  Printlog "  - test preview window"
  Vorschaufenster.Click									'/// open preview window ///'
  sleep 1
   Kontext "Vorschau"
      if Vorschau.Exists = False Then Warnlog "  - Preview window not opened"
   Vorschau.Close
   Kontext "Effekt"
   Extras.Click
    if not Klangliste.IsEnabled Then Klang.Click					'/// insert sound ///'
   sleep 1
'  ZaehlerTon=Klangliste.GetItemCount
   for n=1 to 5
       SetClipboard Klangliste.GetSelText
       Klangliste.Select n
       VollstaendigAbspielen.Click
       Effekt.Close
       SlideShowEffects
       Kontext "Effekt"
       sleep 1
       Extras.Click
       sleep 1
        if GetClipboardText<>Klangliste.GetSelText Then Warnlog "  - sound did not change"
    next n
   Effekt.Close
   sleep 1
 Call hCloseDocument												'/// close document ///'
endcase

testcase tExtrasPraesentationseinstellungen
dim waschecked as boolean
     Printlog "  - SlideShow/Slideshow settings"
  Call hNewDocument							'/// New impress document ///'
  setStartCurrentPage(FALSE)                '/// Set ToolsOptions - Presentation - StartCurrentPage = off ///'
  '///  check state of navigator ! expected: closed ///'
  Kontext "Navigator"
  if Navigator.exists then
     '///+ close navigator ! ///'
     Navigator.Close
     Warnlog "Navigator was open. Check earlier tests. Now closed."
  else
     printlog "Navigator: NOT available. Good."
  endif
  Kontext "DocumentImpress"
   ExtrasPraesentationseinstellung
   Kontext "Bildschirmpraesentation"
   AbDia.Check
  SetClipboard AbDiaName.GetItemCount
  Bildschirmpraesentation.OK
  InsertSlide								'/// insert slide ///'
  sleep 2
  hTypekeys "<Pagedown>"
  sleep 2
  SlideShowPresentationSettings				'/// slideshow settings ///'
  Kontext "Bildschirmpraesentation"
   if AbDiaName.GetItemCount <> GetClipboardText Then
      Printlog "  - Added page appears in list"
   else
      Warnlog "  - Page not added to the list"
   end if
  AlleDias.Check							'/// check all dias///'
      Printlog "  - Test all slides"
  Bildschirmpraesentation.OK
  hCloseDocument							'/// close document ///'
    DateiOeffnen							'/// open document (diashow.odp) ///'
  Kontext "OeffnenDlg"
  if OeffnenDlg.Exists(10) then
     Dateiname.SetText ConvertPath (gTesttoolPath + "graphics\required\input\diashow.odp")
  else
     Warnlog "Took more then 10 seconds to get the file-open -dialogue open. Ending Test."
     goto endsub
  endif
  Oeffnen.Click
  sleep (60)
  ' check if the document is writable
  if fIsDocumentWritable = false then
     ' make the document writable and check if it's succesfull
     if fMakeDocumentWritable = false then
        warnlog "The document can't be make writeable. Test stopped."
        goto endsub
     endif
  endif
  Kontext "DocumentImpress"
  sleep 1
  SlideShowPresentationSettings
  Kontext "Bildschirmpraesentation"
   if Fenster.IsChecked = False Then			'/// slideshow runs in window mode checked ///'
      Fenster.Check
      Printlog "  - Slideshow in window mode"
   else
      Printlog "  - Slideshow in window mode checked"
   end if
  Bildschirmpraesentation.OK

    Printlog "  - Testing slide show"
  SlideShowSlideshow							'/// run slideshow ///'
  sleep (3)
  Kontext "DocumentPresentation"
  DocumentPresentation.TypeKeys "<pagedown>"
   try
      Kontext "DocumentImpress"
      ViewZoom							'/// try using menue entrees (should be disabled while slideshow is running) ///'
      Warnlog "  - In slide show mode controls shouldn't be enabled"
      Kontext "Massstab"
      Massstab.OK
   catch
       Kontext "DocumentPresentation"
       Printlog "  - Slideshow runs"
   endcatch
  sleep 2
  DocumentPresentation.TypeKeys "<pagedown>"
  sleep 2
  DocumentPresentation.TypeKeys "<pagedown>"
  sleep 2
  DocumentPresentation.TypeKeys "<pagedown>"
  sleep 2
  DocumentPresentation.TypeKeys "<pagedown>"
  sleep (5)

  kontext "DocumentPresentation"
  if DocumentPresentation.Exists(3) then                                '/// test if application is still in slideshow mode ///'
     warnlog "  - We are still in slideshow mode"
     DocumentPresentation.TypeKeys "<ESCAPE>"
     else
     Printlog "  - Test Abdia page 3 ended"
  endif

  Printlog "  - From slides test"
  SlideShowPresentationSettings						'/// open slideshow settings ///'
  Kontext "Bildschirmpraesentation"
  Fenster.Check						                '/// check slideshow in window mode ///'
  AbDia.Check
  AbDiaName.Select 3							'/// slideshow begins at dia 3///'
        Printlog "  -  From " + AbDiaName.GetSelText + " was the slides shown"
  Bildschirmpraesentation.OK
  SlideShowSlideshow							'/// run slideshow ///'
  sleep (3)
  Kontext "DocumentPresentation"
  DocumentPresentation.TypeKeys "<pagedown>" 'to get to 4
  sleep 2
  DocumentPresentation.TypeKeys "<pagedown>" ' to get to the end
  sleep 2
  '/// Click once more to get out of presentation-mode ///'
  DocumentPresentation.TypeKeys "<pagedown>" 'out
  sleep (3)
  kontext "DocumentPresentation"
  if DocumentPresentation.Exists(3) then
     warnlog "  - We are still in slideshow mode"
     DocumentPresentation.TypeKeys "<ESCAPE>"
     else
     Printlog "  - Test Abdia page 3 ended"
  endif
  Printlog "  - Repeat endless"

  Kontext "DocumentImpress"
  SlideShowPresentationSettings						'/// open slideshow settings ///'
  Kontext "Bildschirmpraesentation"
   if AbDia.IsChecked=True Then AlleDias.Check
   if Auto.IsChecked=False Then Auto.Check
  Bildschirmpraesentation.OK
  sleep (1)
  SlideShowSlideshow                            'start from 1
  sleep (3)
  Kontext "DocumentPresentation"
  DocumentPresentation.TypeKeys "<pagedown>"    'to 2
  sleep 2
  DocumentPresentation.TypeKeys "<pagedown>"    'to 3
  sleep 2
  DocumentPresentation.TypeKeys "<pagedown>"    'to 4
  sleep 2
  DocumentPresentation.TypeKeys "<pagedown>"    'to pause
  sleep 2
  DocumentPresentation.TypeKeys "<pagedown>"    'to 1
  sleep 2
  DocumentPresentation.TypeKeys "<pagedown>"    'to 2
  sleep 2
  DocumentPresentation.TypeKeys "<pagedown>"    'to 3
  sleep 2
  DocumentPresentation.TypeKeys "<MOD1 SHIFT F5>"   '/// Open the navigator ///'
  sleep 2
  DocumentPresentation.TypeKeys "<pagedown>"    'to 4
  sleep 2
  DocumentPresentation.TypeKeys "<pagedown>"    'to pause
  sleep 2
  DocumentPresentation.TypeKeys "<pagedown>"    'to 1
  sleep 3
  DocumentPresentation.TypeKeys "<pagedown>"    'to 2
  sleep 3
  DocumentPresentation.TypeKeys "<pagedown>"    'to 3
  sleep 3
  Kontext "NavigatorDraw"
  if NavigatorDraw.Exists then
     Printlog "   The navigator is open. good."
  else
     Warnlog "  The navigator should be accessable. Opening now."
     Kontext "DocumentImpress"
     DocumentImpress.TypeKeys "<MOD1 SHIFT F5>"
     Kontext "NavigatorDraw"
  end if
  sleep 2
  if Liste.GetSelIndex <> 3 then
     Warnlog "  - Diashow not repeated: We should be at page no 3, but we are at page no: " + Liste.GetSelIndex
     Kontext "DocumentPresentation"
     DocumentPresentation.TypeKeys "<MOD1 SHIFT F5>"            '/// Close the Navigator-window ///'
  else
     Printlog "  - Repeat endless does work"
     Kontext "DocumentPresentation"
     DocumentPresentation.TypeKeys "<MOD1 SHIFT F5>"            '/// Close the Navigator-window ///'
     sleep 2
  endif
  Kontext "DocumentPresentation"
  DocumentPresentation.TypeKeys "<ESCAPE>"
  sleep 2
  Kontext "DocumentImpress"
  gMouseClick 80,80
   try
      SlideShowPresentationSettings					'/// test endless repeating setting ///'
      Kontext "Bildschirmpraesentation"
      Bildschirmpraesentation.OK
      Printlog "  - Repeat endless"
   catch
      Warnlog "  - We are still in slideshow mode"
      DocumentPresentation.TypeKeys "<ESCAPE>"
      sleep 5
    endcatch
   Kontext "DocumentImpress"
    SlideShowPresentationSettings
    Kontext "BildschirmPraesentation"
    Fenster.Check
       Printlog "  - Test slide switching manually"				'/// test dia switch manual ///'
    if DiawechselManuel.IsChecked = False Then DiawechselManuel.Check
    BildschirmPraesentation.Ok
    sleep 1
    Kontext "DocumentImpress"
    DocumentImpress.TypeKeys "<MOD1 F2>"
    try
       ViewZoom
       Kontext "Massstab"
       Warnlog "  - No slide show mode with  'Ctrl+F2'"
    catch
       Printlog "  - Slide show started using 'Ctrl F2'"
    endcatch
    Kontext "DocumentPresentation"
    DocumentPresentation.TypeKeys "<pagedown>"
    sleep 1
    DocumentPresentation.TypeKeys "<MOD1 SHIFT F5>"
'     Kontext "NavigatorDraw"
     sleep 3
    DocumentPresentation.TypeKeys "<pagedown>"
    sleep 3
    DocumentPresentation.TypeKeys "<MOD1 SHIFT F5>"
    Kontext "Navigator"
    sleep 5

   '///  Check state of navigator ! Expected: closed ///'
   Kontext "Navigator"
   if Navigator.exists then
      '///+ Close Navigator ! ///'
      Navigator.Close
      Warnlog "Navigator: Should have been closed. Closing now."
   else
      printlog "Navigator: not available - Good"
   endif
  Kontext "DokumentPraesentation"
  DokumentPraesentation.TypeKeys "<ESCAPE>"  '/// Exit presentation-mode ///'
  Kontext "DocumentImpress"
  Call hCloseDocument					   '/// close document ///'
endcase

testcase tExtrasIndividuellePraesentation
    Printlog "- Slideshow/Individual slideshow"
 Call hNewDocument							'/// new impress document ///'
     '/// Deactivate "Start with current page" in ToolsOptions ///'
     setStartCurrentPage(FALSE)
   '///  check state of navigator ! expected: closed ///'
   Kontext "Navigator"
   if Navigator.exists then
      '///+ close navigator ! ///'
      Navigator.Close
      Warnlog "Navigator was open. Check earlier tests. Now closed."
   else
      printlog "Navigator: NOT available. Good."
   endif
     Printlog "  - insert 3 slides for the individual slide show"
       SlideShowPresentationSettings				'/// open slide show settings ///'
       Kontext "Bildschirmpraesentation"
       Fenster.Check
       Bildschirmpraesentation.OK
  InsertSlide                                                           '/// insert slide ///'
  sleep 2
  hTypekeys "<Pagedown>"
  sleep 2
  InsertSlide
  sleep 2
  hTypekeys "<Pagedown>"
  sleep 2
  InsertSlide								'/// insert another slide ///'
  sleep 2
  hTypekeys "<Pagedown>"
  sleep 2
  Printlog "  - Slides added"
  sleep 1
  Kontext "DocumentImpress"
  DocumentImpress.TypeKeys "<MOD1 SHIFT F5>"		'/// open navigator ///'
  sleep 1
  Kontext "NavigatorDraw"
   if NavigatorDraw.Exists Then
      Printlog "  - Navigator exists"
      Erste.Click							'/// switch to 1st slide ///'
      Kontext "DocumentImpress"
      DocumentImpress.MouseDown ( 50, 50 )  '/// Make a click onto the slide to focus onto that ///'
      DocumentImpress.MouseUp ( 50, 50 )
      hRechteckErstellen (10,10,20,20)		'/// create rectangle ///'
      Kontext "NavigatorDraw"
      Naechste.Click						'/// switch to 2nd slide ///'
      Kontext "DocumentImpress"
      hRechteckErstellen (30,30,40,40)		'/// create another rectangle ///'
      Kontext "NavigatorDraw"
      Naechste.Click						'/// switch to 3rd slide ///'
      Kontext "DocumentImpress"
      hRechteckErstellen (40,40,50,50)		'/// create rectangle ///'
      Kontext "NavigatorDraw"
      Naechste.Click						'/// switch to next slide ///'
      Kontext "DocumentImpress"
      hRechteckErstellen (50,50,60,60)		'/// create rectangle ///'
      Printlog "  - Created rectangles on all slides"
   else
      Warnlog "  No Navigator"
   end if
  sleep 1
  SlideShowCustomSlideshow					'/// open custom slideshow ///'
  Kontext "IndividuellePraesentation"
   Printlog "  - Create new slideshow"
  Neu.Click								    '/// create new individual slideshow ///'
  Kontext "IndividuellePraesentationDefinieren"
  PraesentationName.SetText "Test 1"		'/// set name of individiual slideshow to Test 1 ///'
  Dim i
  Dim Zaehler
  Zaehler=SeitenPraesentation.GetItemCount	'/// add slides to presentation ///'
     For i=1 to Zaehler
         SeitenPraesentation.SetNoSelection
         SeitenPraesentation.Select i
         Hinzufuegen.Click
          if SelectedSlides.GetItemCount=i Then
             Printlog "  - slide added to slideshow"
          else
             Warnlog "  Count does not match selection.  Should be: "+ i + " but is: "+ IndividuellePraesentation.GetItemCount
          end if
      next i
         Printlog "  - Add slides using multiple selections"
      SeitenPraesentation.Select 1
      Hinzufuegen.Click
      SeitenPraesentation.Select 2
      Hinzufuegen.Click
      SeitenPraesentation.Select 3
      Hinzufuegen.Click
      SeitenPraesentation.Select 4
      Hinzufuegen.Click

         if SelectedSlides.GetItemCount=8 Then			'/// control number of added slides ///'
            Printlog "  - slides has been added, multiple selection is working"
         else
            Warnlog "  Multiple selection does not work"
         end if

      IndividuellePraesentationDefinieren.OK
      sleep 2
  Kontext "IndividuellePraesentation"
     if IndividuellePraesentationBenutzen.IsChecked=False Then IndividuellePraesentationBenutzen.Check
     sleep 2
     Starten.Click									     '/// run presentation ///'
     Printlog "  - Individual slideshow started"
     sleep 5
  Kontext "Navigator"                               '/// Check if the navigator exists, if so - close it ///'
   if Navigator.Exists Then
      Printlog "  - Navigator exists, we close it"
      Navigator.Close								'/// close navigator ///'
      sleep 2
   end if
  Kontext "DocumentPresentation"
  sleep 3
  DocumentPresentation.TypeKeys "<RETURN>"
  sleep 2
  DocumentPresentation.TypeKeys "<RETURN>"
  sleep 2
  DocumentPresentation.TypeKeys "<RETURN>"
  sleep 2
  DocumentPresentation.TypeKeys "<RETURN>"
  sleep 2
  DocumentPresentation.TypeKeys "<RETURN>"
  sleep 2
  DocumentPresentation.TypeKeys "<RETURN>"
  sleep 2
  DocumentPresentation.TypeKeys "<RETURN>"
  sleep 2
  DocumentPresentation.TypeKeys "<RETURN>"
  sleep 2
  DocumentPresentation.TypeKeys "<ESCAPE>"
  sleep 5
  Kontext "IndividuellePraesentation"
  if IndividuellePraesentation.IsVisible=False Then
     Warnlog "  Slideshow should have ended"
     Kontext "DocumentPresentation"
     DocumentPresentation.TypeKeys "<ESCAPE>"
  else
     printlog "   Presentation seems to have ended successfully"
  end if

  sleep 2

  Kontext "IndividuellePraesentation"
  IndividuellePraesentation.Close                                '/// Close custom slideshow ///'

  Kontext "NavigatorDraw"                                           '/// Navigator: Control if right slide is displayed ///'
  printlog "  Now we switch to the navigator again"
  if Liste.GetSelIndex <> 4 then          '/// Unless -Start on first slide- is activated? Default = No ///'
     Warnlog "  This is not the right slide, it should be 4 but is: " + Liste.GetSelIndex
  else
     Printlog "  - Individual slideshow seems to work"
  end if
   SlideShowCustomSlideshow                                '/// open custom slideshow ///'
   '/// Set "Start with current page" back to default = on, in ToolsOptions ///'
   Kontext "IndividuellePraesentation"
  if IndividuellePraesentationBenutzen.IsChecked=False Then IndividuellePraesentationBenutzen.Check
  IndividuellePraesentation.Close
  sleep 2
  Kontext "Navigator" 'Draw
   if Navigator.exists then
       Navigator.Close   '/// Close the Navigator ///'
       Kontext "NavigatorDraw"
       if NavigatorDraw.exists then
           NavigatorDraw.Close
       endif
   else
      printlog "Navigator: NOT available. Good."
   endif
   Kontext "DocumentImpress"
   setStartCurrentPage(TRUE)
 Call hCloseDocument       '/// close document ///'
endcase

'****************************************************************************************************

testcase tSlideshowContextMenuOneSlide
    qaerrorlog "Test not yet ready."
     goto endsub
   dim NumberOfEntries as Integer
   Printlog "- ContextMenu in Slideshow"
   '/// New Impress Document ///'
   Call hNewDocument

      '/// Start the Slideshow. ///'
      hTypeKeys "<F5>"
      '/// Check that the right mousebutton brings up the Context-Menu. ///'
      Kontext "DocumentPresentation"
      DocumentPresentation.MouseDown 50, 50, 3
      DocumentPresentation.MouseUp 50, 50, 3
      '/// Check that the right-click brought up a Context-Menu. ///'
      '/// And check the number of Menu-Positions (there should be XXX of them ) ///'
      NumberOfEntries = 0
      sleep 2
      try
         NumberOfEntries = MenuGetItemCount
      catch
         warnlog "   No ContextMenu found? Please inform the Automatic Tester"
         kontext "DocumentImpress"
         hOpenContextMenu
         NumberOfEntries = MenuGetItemCount
      endcatch
      if (NumberOfEntries = 0) then
         Warnlog "   the Context-Menu doesnt contain any entries, or were not up. Test ends."
         Goto Endsub
      endif
      if NumberOfEntries <> 3 then
         warnlog "   Expected three entries in this Menu, but found " + NumberOfEntries
'      if NumberOfEntries <> 6 then
'         warnlog "   Expected six entries in this Menu, but found " + NumberOfEntries
      else
         printlog "   Number of Entries was: " + NumberOfEntries
      endif
      '/// Check that every position contains the expected Undermenu. ("Screen": Black/White. and "End Slideshow") ///'
      '/// And check that Menu-Item one opens an undermenu. ///'
      Printlog "   We open number one: " + MenuGetItemText(MenuGetItemID(1))
      hMenuSelectNr (1)
      sleep 2
      NumberOfEntries = MenuGetItemCount
      printlog "   Menu-entries: " + MenuGetItemCount
      if (NumberOfEntries <> 2) then
         Warnlog "   the third Context-Menu-entry was NOT 'Screen'."
      else
         Printlog "   We open the next number one: " + MenuGetItemText(MenuGetItemID(1))
         hMenuSelectNr (1)
      endif
      DocumentPresentation.MouseDown 50, 50, 3
      DocumentPresentation.MouseUp 50, 50, 3
      hMenuSelectNr (1) 'Open the Screen -menu.
      sleep 2
      Printlog "   We open number two: " + MenuGetItemText(MenuGetItemID(MenuGetItemCount))
      hMenuSelectNr (2) 'Choose "White"
      sleep 2

      'TODO - Due to existing bug, function not yet available.
      '/// Change to slideshow-ending. Check that the Context-Menu also comes up here. ///'
      'DocumentPresentation.
      hTypeKeys "<SPACE>"
      Kontext "DocumentPresentation"
      DocumentPresentation.MouseDown 50, 50, 3
      DocumentPresentation.MouseUp 50, 50, 3
      sleep 2
      NumberOfEntries = 0
      NumberOfEntries = MenuGetItemCount
      if NumberOfEntries <> 0 then
         printlog "   Menu-entries: " + MenuGetItemCount
      else
         warnlog "   No context-menu at Slideshow-endpage."
         DocumentPresentation.TypeKeys "<ESCAPE>"
      endif

      '/// And that one can go back. ///'
      hMenuSelectNr (1) 'Open the Goto Slide -menu.
      sleep 2
      Printlog "   We open number one (should be 'Goto First Slide'): " + MenuGetItemText(MenuGetItemID(1))
      hMenuSelectNr (2) 'Choose "Back" 'TODO ;: but now we just end the slideshow
      sleep 2

      Kontext "DocumentPresentation"
      DocumentPresentation.TypeKeys "<ESCAPE>"
      DocumentPresentation.TypeKeys "<ESCAPE>"
      Kontext "DocumentImpress"
      InsertSlide

      '/// Start the Slideshow. ///'
      hTypeKeys "<F5>"
      '/// Check that the right mousebutton brings up the Context-Menu. ///'
      Kontext "DocumentPresentation"
      DocumentPresentation.MouseDown 50, 50, 3
      DocumentPresentation.MouseUp 50, 50, 3
      sleep 2

      '/// Check that Menu-Item (three) really finishes the presentation. ///'
      Printlog "   We open the last entry (End Show): " + MenuGetItemText(MenuGetItemID(MenuGetItemCount))
      hMenuSelectNr (4) 'MenuGetItemCount) 'End Slideshow
      if DocumentPresentation.Exists then
         Warnlog "either wrong position for 'End Slideshow', or the command didnt work."
      else
         printlog "The presentation was closed, good."
      endif

      '/// Check that one can step one step forward, even if there is no more than one slide. ///'
      '/// Start the Slideshow. ///'
      hTypeKeys "<F5>"
      '/// Check that the right mousebutton brings up the Context-Menu. ///'
      sleep (2)
      Kontext "DocumentPresentation"
      DocumentPresentation.MouseDown 50, 50, 3
      DocumentPresentation.MouseUp 50, 50, 3
      sleep 2

      hMenuSelectNr (2) 'Open the Goto Slide -menu.

      '/// Select the 'one step forward' -entry ///'
      hMenuSelectNr (1)

      '/// Check that we're on the last slide ///'
      Kontext "DocumentPresentation"
      DocumentPresentation.MouseDown 50, 50, 3
      DocumentPresentation.MouseUp 50, 50, 3
      sleep 2

      hMenuSelectNr (2) 'Open the Goto Slide -menu.
      if MenuIsItemEnabled (MenugetItemID(4)) then
         printlog "Jumped to the right slide"
      else
         warnlog "possibly the 'jump to slide' -menu didnt quite work"
      endif

      '/// Close the Context-Menu ///'
      hMenuSelectNr (0)
      Kontext "DocumentPresentation"

      '/// Check if the context-menu also comes up at the very last page (slideshow-ending) ///'
      DocumentPresentation.TypeKeys "<SPACE>"
'      DocumentPresentation.TypeKeys "<SPACE>"
      sleep 1
      Kontext "DocumentPresentation"
      DocumentPresentation.MouseDown 50, 50, 3
      DocumentPresentation.MouseUp 50, 50, 3
      sleep 2

      if MenuGetItemText (MenuGetItemID(1)) <> "" then
         Printlog "Context-menu came up at the last page: correct."
      else
         Warnlog "Context-menu did NOT come up correctly at the last page: false."
      endif

      '/// Check if we from here, via the context menu, can go back to the first page ///'
      hMenuSelectNr (2) 'Open the Goto Slide -menu.
      sleep 1
      hMenuSelectNr (1) 'First Slide

      '/// Check that we're on the first slide ///'
      Kontext "DocumentPresentation"
      DocumentPresentation.MouseDown 50, 50, 3
      DocumentPresentation.MouseUp 50, 50, 3
      sleep 2

      hMenuSelectNr (2) 'Open the Goto Slide -menu.
      if MenuIsItemEnabled (MenugetItemID(3)) then
         printlog "Jumped to the right slide"
      else
         warnlog "possibly the 'jump to slide' -menu didnt quite work from the last slide"
      endif

      '/// Close the Context-Menu ///'
      MenuSelect (0)
      '/// Close the Presentation ///'
      hTypeKeys "<ESCAPE>"
   '/// Close Document ///'
   Call hCloseDocument
endcase 'tSlideshowContextMenuOneSlide

'****************************************************************************************************

testcase tSlideshowContextMenuMoreSlides
    qaerrorlog "Test not yet ready."
     goto endsub
   dim NumberOfEntries as Integer
   Printlog "- ContextMenu in Slideshow"
   '/// New Impress Document ///'
   Call hNewDocument
      '/// Insert three new Slides ///'
      InsertSlide
      InsertSlide
      InsertSlide
      '/// Start the Slideshow. ///'
      hTypeKeys "<F5>"
      sleep (3)
      '/// Check that the right mousebutton brings up the Context-Menu. ///'
      Kontext "DocumentPresentation"
      DocumentPresentation.MouseDown 50, 50, 3
      DocumentPresentation.MouseUp 50, 50, 3
      '/// Check that the right-click brought up a Context-Menu. ///'
      '/// And check the number of Menu-Positions (there should be XXX of them ) ///'
      NumberOfEntries = 0
      sleep 2
      try
         NumberOfEntries = MenuGetItemCount
      catch
         warnlog "   No ContextMenu found? Please inform the Automatic Tester"
         kontext "DocumentImpress"
         hOpenContextMenu
         NumberOfEntries = MenuGetItemCount
      endcatch
      if (NumberOfEntries = 0) then
         Warnlog "   the Context-Menu doesnt contain any entries, or were not up. Test ends."
         Goto Endsub
      endif
      if NumberOfEntries <> 6 then
         warnlog "   Expected six entries in this Menu, but found " + NumberOfEntries
      else
         printlog "   Number of Entries was: " + NumberOfEntries
      endif
      '/// Check that every position contains the expected Undermenu. ("Screen": Black/White. and "End Slideshow") ///'
      '/// And check that Menu-Item one opens an undermenu. ///'
      Printlog "   We open number four: " + MenuGetItemText(MenuGetItemID(4))
      hMenuSelectNr (3)
      sleep 2
      NumberOfEntries = MenuGetItemCount
      printlog "   Menu-entries: " + MenuGetItemCount
      if (NumberOfEntries <> 2) then
         Warnlog "   the first Context-Menu-entry was NOT 'Screen'."
      else
         Printlog "   We open the next number one: " + MenuGetItemText(MenuGetItemID(1))
         hMenuSelectNr (1)
      endif
      DocumentPresentation.MouseDown 50, 50, 3
      DocumentPresentation.MouseUp 50, 50, 3
      hMenuSelectNr (3) 'Open the Screen -menu.
      sleep 2
      Printlog "   We open number two: " + MenuGetItemText(MenuGetItemID(MenuGetItemCount))
      hMenuSelectNr (2) 'Choose "White"
      sleep 2

      'TODO - Due to existing bug, function not yet available.
      '/// Change to slideshow-ending. Check that the Context-Menu also comes up here. ///'
      'DocumentPresentation.
      hTypeKeys "<SPACE>"
      Kontext "DocumentPresentation"
      DocumentPresentation.MouseDown 50, 50, 3
      DocumentPresentation.MouseUp 50, 50, 3
      sleep 2
      NumberOfEntries = 0
      NumberOfEntries = MenuGetItemCount
      if NumberOfEntries <> 0 then
         printlog "   Menu-entries: " + MenuGetItemCount
      else
         warnlog "   No context-menu at Slideshow-endpage."
         DocumentPresentation.TypeKeys "<ESCAPE>"
      endif

      '/// And that one can go back. ///'
      hMenuSelectNr (2) 'Open the Goto Slide -menu.
      sleep 2
      Printlog "   We open number one (should be 'Goto First Slide'): " + MenuGetItemText(MenuGetItemID(1))
      hMenuSelectNr (2) 'Choose "Back" 'TODO ;: but now we just end the slideshow
      sleep 2

      Kontext "DocumentPresentation"
      DocumentPresentation.TypeKeys "<ESCAPE>"
      DocumentPresentation.TypeKeys "<ESCAPE>"
      Kontext "DocumentImpress"

      '/// Start the Slideshow. ///'
      hTypeKeys "<F5>"
      '/// Check that the right mousebutton brings up the Context-Menu. ///'
      Kontext "DocumentPresentation"
      DocumentPresentation.MouseDown 50, 50, 3
      DocumentPresentation.MouseUp 50, 50, 3
      sleep 2

      '/// Check that Menu-Item (three) really finishes the presentation. ///'
      Printlog "   We open the last entry (End Show): " + MenuGetItemText(MenuGetItemID(MenuGetItemCount))
      hMenuSelectNr (4)'MenuGetItemCount) 'End Slideshow
      sleep 4
      if DocumentPresentation.Exists then
         Warnlog "either wrong position for 'End Slideshow', or the command didnt work."
         Kontext "DocumentPresentation"
         DocumentPresentation.MouseDown 50, 50, 3
         DocumentPresentation.MouseUp 50, 50, 3
         sleep 2
         Printlog "   We open the last entry (End Show): " + MenuGetItemText(MenuGetItemID(MenuGetItemCount))
         hMenuSelectNr (4)'MenuGetItemCount) 'End Slideshow
      else
         printlog "The presentation was closed, good."
      endif

      '/// Check that one can step one step forward, even if there is no more than one slide. ///'
      '/// Start the Slideshow. ///'
      hTypeKeys "<F5>"
      sleep (3)
      '/// Check that the right mousebutton brings up the Context-Menu. ///'
      Kontext "DocumentPresentation"
      DocumentPresentation.MouseDown 50, 50, 3
      DocumentPresentation.MouseUp 50, 50, 3
      sleep 2

      hMenuSelectNr (2) 'Open the Goto Slide -menu.

      '/// Select the 'one step forward' -entry ///'
      hMenuSelectNr (1)

      '/// Check that we're on the last slide ///'
      Kontext "DocumentPresentation"
      DocumentPresentation.MouseDown 50, 50, 3
      DocumentPresentation.MouseUp 50, 50, 3
      sleep 2

      hMenuSelectNr (2) 'Open the Goto Slide -menu.
      if MenuIsItemEnabled (MenugetItemID(4)) then
         printlog "Jumped to the right slide"
      else
         warnlog "possibly the 'jump to slide' -menu didnt quite work"
      endif

      '/// Close the Context-Menu ///'
      hMenuSelectNr (0)
      Kontext "DocumentPresentation"

      '/// Check if the context-menu also comes up at the very last page (slideshow-ending) ///'
      DocumentPresentation.TypeKeys "<SPACE>"
      sleep 1
      Kontext "DocumentPresentation"
      DocumentPresentation.MouseDown 50, 50, 3
      DocumentPresentation.MouseUp 50, 50, 3
      sleep 2

      if MenuGetItemText (MenuGetItemID(1)) <> "" then
         Printlog "Context-menu came up at the last page: correct."
      else
         Warnlog "Context-menu did NOT come up correctly at the last page: false."
      endif

      '/// Check if we from here, via the context menu, can go back to the first page ///'
      hMenuSelectNr (2) 'Open the Goto Slide -menu.
      sleep 1
      hMenuSelectNr (1) 'First Slide

      '/// Check that we're on the first slide ///'
      Kontext "DocumentPresentation"
      DocumentPresentation.MouseDown 50, 50, 3
      DocumentPresentation.MouseUp 50, 50, 3
      sleep 2

      hMenuSelectNr (2) 'Open the Goto Slide -menu.
      if MenuIsItemEnabled (MenugetItemID(3)) then
         printlog "Jumped to the right slide"
      else
         warnlog "possibly the 'jump to slide' -menu didnt quite work from the last slide"
      endif

      '/// Close the Context-Menu ///'
      MenuSelect (0)
      '/// Close the Presentation ///'
      hTypeKeys "<ESCAPE>"
   '/// Close Document ///'
   Call hCloseDocument
endcase 'tSlideshowContextMenuMoreSlides

'****************************************************************************************************

testcase tiMousePointerHides
    qaerrorlog "Test not yet ready."
     goto endsub
   dim i as Integer
   Printlog "- ContextMenu in Slideshow"
   '/// New Impress Document ///'
   Call hNewDocument

      '/// Start the Slideshow. ///'
      hTypeKeys "<F5>"
      sleep 1
      i = 0
      while ((getMouseStyle = 0) AND (i<20))
          sleep 1
          inc (i)
          printlog getMouseStyle
          if (getMouseStyle <> 0) then i = 20
      wend
      if (getMouseStyle <> 0) then
         printlog "Mousepointer disappeared like it should have"
      else
         warnlog "the mousepointer was still visible, after 20 seconds."
      endif

      hTypeKeys "<ESCAPE>"
      hTypeKeys "<ESCAPE>"

   '/// Close Document ///'
   Call hCloseDocument
endcase 'tSlideshowContextMenuMoreSlides

'****************************************************************************************************