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_slidelayer.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-08-28 11:44:12 $
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 tiInsertExpandSlide
40 ' #1 tiInsertSummarySlide
41 ' #1 tiFormatSeitenlayout
44 '\********************************************************************
46 ' Dateiname.SetText ConvertPath (gTesttoolPath + "global\input\graf_inp\enter.bmp")
47 ' Inhalt.SetText ConvertPath (gTesttoolPath + "graphics\required\input\leer.sxd") '/// auto.sdd choosen ///'
49 '-------------------------------------------------------------------------------
50 testcase tiInsertExpandSlide
54 dim b116350 as boolean
56 '/// open application ///'
58 '/// create presupposition ///
59 '///+ View->Master View->Outline View ///'
60 ViewWorkspaceOutlineView
62 Kontext "DocumentImpressOutlineView"
63 '///+ create a slide with some levels...and some more slides with just one level... ///'
64 '///+ it should look like this: ///'
65 '///+-------------------------------------------------- ///'
71 '///+ - - - - - - F///'
79 '///+-------------------------------------------------- ///'
80 DocumentImpressOutlineView.TypeKeys "Slide 1"
82 DocumentImpressOutlineView.TypeKeys "<return><tab>"
83 DocumentImpressOutlineView.TypeKeys chr(64+i)
85 DocumentImpressOutlineView.TypeKeys "<return>"
86 DocumentImpressOutlineView.TypeKeys ("<shift tab>",5)
88 DocumentImpressOutlineView.TypeKeys chr(65+i)
89 DocumentImpressOutlineView.TypeKeys "<return>"
91 DocumentImpressOutlineView.TypeKeys ("<shift tab>")
93 DocumentImpressOutlineView.TypeKeys "Slide " + i
94 DocumentImpressOutlineView.TypeKeys "<return>"
96 DocumentImpressOutlineView.TypeKeys "<backspace>"
97 '///+ View->Master View->Drawing View ///'
98 ViewWorkspaceDrawingView
100 '///+ there have to be 5 slides now ///'
103 '/// goto the first slide ///'
105 '///<b> Insert->Expand Slide </b>///'
107 ' usually the content of the new pages is the same as the curren, there is a slide created for every part in the first outline level (gliederungsebene)
109 if (8 = fGetSlideCount (8)) then
110 printlog "Insert Expand Slide accomplished correctly"
112 warnLog "Bug with Insert Expand Slide"
114 '///+ check slide content ///'
115 hTypeKeys ("<TAB><F2>"
118 sTemp = GetClipboard()
119 if (sTemp <> "A") then
120 Warnlog "wrong slide content, expected: '" + "Slide 1" + "'; but got: '" + sTemp + "'"
125 hTypeKeys "<pagedown>"
126 hTypeKeys ("<TAB><F2>")
129 sTemp = GetClipboard()
130 if (sTemp <> chr(64+i)) then
131 Warnlog "Wrong slide content, expected: '" + chr(64+i) + "'; but got: '" + sTemp + "'"
137 hTypeKeys "<pagedown>" 'If the first slide existed, this is where it would have been.
138 hTypeKeys ("<TAB><F2>")
141 sTemp = GetClipboard()
142 if (sTemp <> ("Slide "+i)) then
143 Warnlog "Wrong slide content, expected: '" + "Slide "+i + "'; but got: '" + sTemp + "'"
149 hTypeKeys "<escape><home>"
150 '///<b> Insert->Expand Slide </b>///'
152 '/// And since the Second slide now should be named "B", we check that first ///'
153 hTypeKeys ("<TAB><F2>")
158 printlog "Something wrong when trying to select Slide-name."
160 sTemp = GetClipboard()
161 if (sTemp <> "B") then
162 Warnlog "Wrong slide content, expected: 'B'; but got: '" + sTemp + "'"
166 hTypeKeys "<pagedown>"
167 hTypeKeys ("<TAB><F2>")
173 printlog "Something wrong when trying to select Slide-name."
175 sTemp = GetClipboard()
176 if (sTemp <> chr(64+i)) then
177 Warnlog "Wrong slide content, expected: '" + chr(64+i) + "'; but got: '" + sTemp + "'"
181 hTypeKeys "<pagedown>"
182 hTypeKeys ("<TAB><F2>")
187 sTemp = GetClipboard()
188 if (sTemp <> ("Slide "+i)) then
189 Warnlog "Wrong slide content, expected: '" + "Slide "+i + "'; but got: '" + sTemp + "'"
193 hTypeKeys "<pagedown>" 'If the first slide existed, this is where it would have been.
194 hTypeKeys ("<TAB><F2>")
198 '/// close application ///'
200 endcase 'tiInsertExpandSlide
202 '-------------------------------------------------------------------------------
203 testcase tiInsertSummarySlide
207 dim saText (10) as string
210 saText (i) = chr(64+i)
215 printlog "Open application."
218 printlog "Presupposition : on the slide has to be something from the outline view AND i have to be on such a slide!"
219 printlog "View->Master View->Outline View."
220 ViewWorkspaceOutlineView
222 Kontext "DocumentImpressOutlineView"
223 DocumentImpressOutlineView.TypeKeys "<home>"
224 printlog "+ create 7 slides like this:"
225 printlog "+--------------------------------------------------"
233 printlog "+--------------------------------------------------"
235 DocumentImpressOutlineView.TypeKeys (saText(i) + "<return>")
238 printlog "View->Master View->Drawing View ."
239 ViewWorkspaceDrawingView
241 printlog "Goto first slide by typing [home]"
243 printlog "test menue entries"
244 printlog "Insert->Summery Slide."
248 warnlog "InsertSummerySlide didnt work. Check why."
251 printlog "slide is appended after the last slide"
252 printlog "the content of the slide depends on from which slide the function was called!"
253 printlog "it is only from the actual slide to the end of the presentation"
254 printlog "it is aloowed to have a slide without the outline stuff inbetween"
255 printlog "check slide content"
262 htypekeys "<mod1 Home>"
265 hTypeKeys "<Shift End>"
267 sTemp = GetClipboardText
268 if (saText(i) <> sTemp) then
269 if ((i=5) OR (i=7)) then
270 if (saText(6) <> sTemp) then
271 Warnlog "WRONG: is: '" + sTemp + "'; should: '" + saText(6) + "'"
273 Printlog "is: '" + sTemp + "'; should: '" + saText(i) + "'"
276 Warnlog "WRONG: is: '" + sTemp + "'; should: '" + saText(i) + "'"
279 Printlog "is: '" + sTemp + "'; should: '" + saText(i) + "'"
281 hTypeKeys "<down><home>"
283 printlog "close application"
285 endcase 'tiInsertSummarySlide
287 '------------------------------------------------------------------------------
288 testcase tiFormatSeitenlayout
290 qaerrorlog "outcommented due to bug"
293 Printlog "Format/Page Layout"
294 Call hNewDocument '/// new impress document ///'
296 FormatPage '/// format page ///'
299 SetClipboard LayoutsPreview.GetText '/// get page name ///'
300 SeitenName.SetText "Test" '/// change page name ///'
302 if Hintergrund.IsChecked=False Then '/// check background ///'
306 if Hintergrund.IsChecked=False Then PrintLog " Background is deactivated"
309 if ObjekteAufDemHintergrund.IsChecked = True Then '/// change status of objects on background ///'
310 PrintLog " Object on background is activated"
311 ObjekteAufDemHintergrund.UnCheck
312 if ObjekteAufDemHintergrund.IsChecked = False Then PrintLog " Objects on background are deactivated"
314 ObjekteAufDemHintegrund.Check
315 PrintLog " Object on background is activated"
317 Seitenlayout.OK '/// close dialog ///'
319 FormatPage '/// reopen dialog ///'
320 Kontext "LayoutsPreview"
322 if GetClipboardText <> SeitenName.GetText Then
323 PrintLog " Page name is correct"
325 WarnLog " Page name is not correct"
328 LayoutsPreview.TypeKeys "<TAB>" '/// assign different page layout ///'
329 LayoutsPreview.TypeKeys "<DOWN>" ,2
330 LayoutsPreview.TypeKeys "<Return>"
333 if Active.Exists (5) then
334 printlog "active (1): "+active.gettext
337 kontext "Pagelayout_UndoDeleteWarning"
338 Pagelayout_UndoDeleteWarning.OK
339 printlog "Can't redo this action! Apply template? -> OK (1) "
340 'DontShowAgain.check ' since it's a level2 test i COULD do this .-) TBO
342 Kontext "DocumentImpress"
344 DocumentImpress.MouseDoubleClick 25,60
346 Kontext "GrafikEinfuegenDlg" '/// check in document if layout has changed ///'
348 if GrafikEinfuegenDlg.exists (5) then
350 DateiName.SetText ConvertPath (gTesttoolPath + "global\input\graf_inp\baer.tif")
357 if Active.Exists Then
358 Warnlog Active.GetText
362 WarnLog " LayoutsPreview did not work"
365 warnlog "Clicked beside :-( I tried to click into the dokument, to insert a graphic, but missed the right point :-("
368 Kontext "DocumentImpress"
369 Call hCloseDocument '/// close document ///'
370 endcase 'tiFormatSeitenlayout
372 '------------------------------------------------------------------------------
375 '/// resulting from regression in #111862# ///'
376 dim sReference(2) as string
377 dim sText(2) as string
381 if gApplication = "IMPRESS" then
382 ExtensionString = "odp"
384 ExtensionString = "odg"
386 printlog "Used extension string is: " & ExtensionString
387 sFile = convertPath(gOfficePath + "user/work/" + getTestcaseName & "." & ExtensionString)
388 printlog "Filepath is: " & sFile
389 if Dir (sFile) <> "" then kill (sFile)
391 sReference(1) = "Koelle"
392 sReference(2) = "Alaaf!"
393 '/// open application ///'
396 '/// Format->Modify Layout ///'
399 LayoutsPreview.TypeKeys "<TAB>"
400 LayoutsPreview.TypeKeys "<Home><Right>"
402 kontext "Pagelayout_UndoDeleteWarning"
403 if Pagelayout_UndoDeleteWarning.exists then
404 Pagelayout_UndoDeleteWarning.ok
407 LayoutsPreview.TypeKeys "<Return>"
408 printlog "(a) setting title and body text"
410 hTypeKeys("<Tab><F2>")
411 hTypeKeys(sReference(i))
414 sText(i) = getClipboardText()
416 hTypeKeys("<Escape>")
417 if (sText(i) <> sReference(i)) then
418 warnlog "(1) selected text '" + sText(i) + "' is different from inserted text '" + sReference(i) + "'"
422 '/// deselect all by typing key 'ESCAPE' again ///'
423 hTypeKeys("<Escape>")
425 hFileSaveAsKill(sFile)
428 printlog "(b) checking title and body text"
430 hTypeKeys("<Tab><F2>")
434 sText(i) = getClipboardText()
438 if (sText(i) <> sReference(i)) then
439 warnlog " (2) selected text '" + sText(i) + "' is different from inserted text '" + sReference(i) + "'"
441 hTypeKeys("<Escape>")
446 printlog " (c) checking title and body text of saved document"
450 hTypeKeys("<Tab><F2>")
454 sText(i) = getClipboardText()
458 hTypeKeys("<Escape>")
459 if (sText(i) <> sReference(i)) then
460 warnlog " (3) selected text '" + sText(i) + "' is different from inserted text '" + sReference(i) + "'"
467 '------------------------------------------------------------------------------
470 qaerrorlog "outcommented due to bug"
472 dim sReference(2) as string
473 dim sText(2) as string
477 sFile = convertPath(gOfficePath + "/user/work/" + getTestcaseName + ".sxi")
479 if FileExists(sFile) then
483 sReference(1) = "Koelle"
484 sReference(2) = "Alaaf!"
485 '/// open application ///'
488 '/// Format->Modify Layout ///'
491 LayoutsPreview.TypeKeys "<TAB>"
492 LayoutsPreview.TypeKeys "<Home>"
493 LayoutsPreview.TypeKeys "<Return>"
494 Kontext "Pagelayout_UndoDeleteWarning"
495 if Pagelayout_UndoDeleteWarning.exists(5) then
496 Pagelayout_UndoDeleteWarning.OK
499 LayoutsPreview.TypeKeys "<Right>"
500 LayoutsPreview.TypeKeys "<Return>"
501 Kontext "Pagelayout_UndoDeleteWarning"
502 if Pagelayout_UndoDeleteWarning.exists(5) then
503 Pagelayout_UndoDeleteWarning.OK
506 LayoutsPreview.TypeKeys "<Right>"
507 LayoutsPreview.TypeKeys "<Return>"
508 Kontext "Pagelayout_UndoDeleteWarning"
509 if Pagelayout_UndoDeleteWarning.exists(5) then
510 Pagelayout_UndoDeleteWarning.OK
516 while ((getMouseStyle <> 6) AND (i<100))
519 'printlog getMouseStyle
522 gMouseMove(30, i, 70, i+20)
527 '------------------------------------------------------------------------------