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_opt_1_.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 10:43:01 $
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 '*******************************************************************
39 ' #1 tiAlwaysWithCurrentPage
40 '\******************************************************************
42 testcase tiAlwaysWithCurrentPage()
46 printlog "Open file 'impdraw\required\input\diashow.od?"
47 hFileOpen ConvertPath (gTesttoolPath + "graphics\required\input\diashow.odp")
48 WaitSlot(10000) 'sleep 10
50 printlog "Check if the document is writable"
51 if fIsDocumentWritable = false then
52 printlog "Make the document writable and check if it's succesfull"
53 if fMakeDocumentWritable = false then
54 warnlog "The document can't be make writeable. Test stopped."
59 printlog "Test with default option."
60 printlog "Checking: 'Always with current page' - default"
62 printlog "Setting Options to start with current page."
63 setStartCurrentPage(true)
64 printlog "Check if Navigator is open. Default: closed."
65 Kontext "NavigatorDraw"
66 if NavigatorDraw.exists (5) then
67 warnlog "presupposition not met: navigator should be closed on loading the document!"
73 printlog "Making sure after loading we are on slide one."
76 warnlog "Presupposition not met. After loading the file not the first slide is up. It is number: " + i
79 printlog "Press Key [Page Down] two times to get to slide number three. We are on slide one."
80 hTypeKeys ("<home><PageDown><PageDown>")
81 printlog "Start the slideshow with 'Slide Show->Slide Show."
83 kontext "DocumentPresentation"
84 printlog "Open the navigator View->Navigator."
85 Kontext "NavigatorDraw"
86 printlog "Opening navigator if none is there."
87 if (not NavigatorDraw.exists(5)) then
90 printlog "The slideshow has to start on slide 3."
91 printlog "running routine for slide 3 and 4."
93 Kontext "NavigatorDraw"
94 printlog "Checking for navigator.."
95 if (not NavigatorDraw.exists(5)) then
98 printlog "Getting number of current slide."
99 printlog "Countervariable is " & i
101 printlog "Current slide number is: " & i & "."
102 printlog "Typing pagedown to get to next slide."
103 DocumentPresentation.TypeKeys "<pagedown>"
104 WaitSlot (5000) 'sleep (5)
107 printlog "Trying to end presentation with mouseclick on black endscreen."
109 DocumentPresentation.mousedown (50,50,1)
110 DocumentPresentation.mouseup (50,50,1)
112 warnlog "TimeOut on pressing mouse button."
115 printlog "Trying to recognize if slideshow did not end.."
117 gMouseClick 50,50 ' this one works to recognice the not ending !
118 Printlog "- Slideshow ended at the right time"
120 Warnlog "- Slideshow still running "
121 kontext "DocumentPresentation"
122 printlgo "Ending presentation with ESC."
123 DocumentPresentation.TypeKeys "<ESCAPE>"
125 WaitSlot (2000) 'sleep 2
127 printlog "Test with changed option: start with first slide."
128 setStartCurrentPage(false)
129 printlog "UnChecked: Always with current page."
130 printlog "press Key [Home] to get to the first slide."
131 kontext "DocumentImpress"
132 printlog "Deselect object."
135 printlog "Making sure navigator is open."
136 Kontext "NavigatorDraw"
137 if (not NavigatorDraw.exists(5)) then
140 printlog "Checking if we are on slide one."
141 i = fGetSlideNumber()
143 warnlog "Start-condition not met. Not the first slide is up. It is number: " & i & "."
145 printlog "Press Key [Page Down] two times to get to slide number three."
146 hTypeKeys "<PageDown> <PageDown>"
147 printlog "Start the slideshow with 'Slide Show->Slide Show."
149 kontext "DocumentPresentation"
150 printlog "Open the navigator View->Navigator."
151 Kontext "NavigatorDraw"
152 printlog "Checking if navigator is open."
153 if (not NavigatorDraw.exists(5)) then
156 printlog "The slideshow has to start on slide 1."
157 printlog "Running routine for slide 1-4. i = 1 to 3 because we start already on slide 1."
159 Kontext "NavigatorDraw"
160 if (not NavigatorDraw.exists(5)) then
163 printlog "Getting number of current slide."
165 printlog "Current slide is: " & i & "."
166 DocumentPresentation.TypeKeys "<pagedown>"
170 printlog "Current slide is: " & i & "."
171 DocumentPresentation.TypeKeys "<pagedown>"
172 printlog "Trying to end presentation with mouseclick on black endscreen."
174 DocumentPresentation.mousedown (50,50,1)
175 DocumentPresentation.mouseup (50,50,1)
176 Printlog "- Slideshow ended at the right time"
178 Warnlog "- Slideshow still running "
179 kontext "DocumentPresentation"
180 printlog "Ending running presentation with ESC."
181 DocumentPresentation.TypeKeys "<ESCAPE>"
184 Kontext "NavigatorDraw"
185 printlog "Checking if navigator is open."
186 if (not NavigatorDraw.exists(5)) then
189 printlog "Checking if we are on slide 3."
190 i = fGetSlideNumber()
192 warnlog "We are on the wrong slide! Should be 3 but it is: " & i
195 printlog "Close the navigator View->Navigator."
196 Kontext "NavigatorDraw"
197 if NavigatorDraw.exists(5) then
201 printlog "Restore: check Always with current page."
202 setStartCurrentPage(true)
205 '-------------------------------------------------------------------------------