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_slidecopy.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-09-04 09:17:52 $
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: includefile for Slidecopy-testing
38 '*******************************************************************************
39 ' #1 tiSlideCopyNewPresentation
40 ' #1 tiSlideCopyDuplicate
41 ' #1 tiSlideCopyPasteSpecial
42 ' #1 tiSlideCopyInSlideSorter
43 '\******************************************************************************
45 testcase tiSlideCopyNewPresentation
50 printlog "This test copies one slide from one presentation to another."
51 printlog "Make new presentation"
53 printlog "Insert three objects: Connector, Door-plate, and Smiley."
55 printlog "First we Insert a Connector."
61 warnlog "bug for GH from FHA; .tearoff doesnt tell success"
63 kontext "Connectorsbar"
68 gMouseMove (10,10,30,30)
70 kontext "Connectorsbar"
74 printlog "We rename the object via the contextmenu."
76 DocumentImpress.TypeKeys "<SHIFT F10>"
78 printlog "then Choose rename."
79 if hMenuFindSelect(27027, true, 14) = false then
80 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
85 kontext "NameDlgObject"
86 NameField.SetText "First"
88 kontext "DocumentImpress"
89 hMouseClick DocumentImpress, 90, 90
90 '----------------------------------------------------------------------------1
91 printlog "Then we insert the second object: a Door-plate."
97 warnlog "bug for GH from FHA; .tearoff doesnt tell success"
101 StarShapesDoorplate.click
104 gMouseMove (40,40,60,60)
110 printlog "And then we rename the object."
112 DocumentImpress.TypeKeys "<SHIFT F10>"
114 if hMenuFindSelect(27027, true, 15) = false then
115 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
119 kontext "NameDlgObject"
120 NameField.SetText "Second"
122 kontext "DocumentImpress"
123 hMouseClick DocumentImpress, 90, 90
124 '----------------------------------------------------------------------------2
125 printlog "Then we insert the thrid object: a Smiley."
131 warnlog "bug for GH from FHA; .tearoff doesnt tell success"
133 kontext "SymbolShapes"
135 SymbolShapesSmiley.Click
138 gMouseMove (70,70,89,89)
140 kontext "SymbolShapes"
144 printlog "We rename the object via the Context-menu."
145 DocumentImpress.TypeKeys "<SHIFT F10>"
148 if hMenuFindSelect(27027, true, 15) = false then
149 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
153 kontext "NameDlgObject"
154 NameField.SetText "Third"
156 kontext "DocumentImpress"
157 hMouseClick DocumentImpress, 90, 90
158 '---------------------------------------------------------------------------3
159 '/// Copy the slide to the clipboard ///'
161 SlidesControl.TypeKeys "<PAGEUP>"
163 SlidesControl.TypeKeys "<SHIFT F10>"
165 printlog "We copy the object via the Context-menu."
167 if hMenuFindSelect(5711, true, 10) = false then
168 Warnlog "Context-Menu-entry `Copy` was not found. Therefore the test ends."
172 '/// Close the presentation-window ///'
174 '/// Open a new presentation ///'
176 '/// Paste the slide from the clipboard ///'
179 '/// Delete the first slide ///'
181 '/// Check if all three objects exists, and has the right values ///'
182 kontext "DocumentImpress"
184 hTypeKeys "<TAB>", 1 'Select the first object.
185 'Bring up the kontext-menu for the object
187 DocumentImpress.TypeKeys "<SHIFT F10>"
189 printlog "We rename the object via the Context-menu."
190 if hMenuFindSelect(27027, true, 14) = false then
191 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
195 printlog "Read out what the name is, and checks if it's correct."
196 kontext "NameDlgObject"
197 value1 = NameField.GetText
199 if value1 = "First" then
200 printlog "First object was found correctly"
202 Warnlog "Wrong object or object-name! The name found was: " + value1
204 kontext "DocumentImpress"
205 hMouseClick DocumentImpress, 90, 90
206 DocumentImpress.TypeKeys "<TAB TAB>" 'Select the second object.
207 'Bring up the kontext-menu for the object
209 DocumentImpress.TypeKeys "<SHIFT F10>"
211 printlog "We rename the object via the Context-menu."
212 if hMenuFindSelect(27027, true, 15) = false then
213 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
217 printlog "Read out what the name is, and check if it's correct."
219 kontext "NameDlgObject"
220 value12 = NameField.GetText
223 if value12 = "Second" then
224 printlog "Second object was found correctly"
226 Warnlog "Wrong object or object-name! The name found was: " + value12
229 kontext "DocumentImpress"
230 hMouseClick DocumentImpress, 90, 90
231 DocumentImpress.TypeKeys "<TAB TAB TAB>" 'Select the third object.
232 'Bring up the kontext-menu for the object
234 DocumentImpress.TypeKeys "<SHIFT F10>"
236 printlog "We rename the object via the Context-menu."
237 if hMenuFindSelect(27027, true, 15) = false then
238 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
242 printlog "Read out what the name is, and check if it's correct."
243 kontext "NameDlgObject"
244 value13 = NameField.GetText
247 if value13 = "Third" then
248 printlog "Third object was found correctly"
250 Warnlog "Wrong object or object-name! The name found was: " + value13
253 '/// Close the bars we opened before. ///'
254 kontext "Connectorsbar"
255 if Connectorsbar.Exists then Connectorsbar.Close
256 kontext "SymbolShapes"
257 if SymbolShapes.Exists then SymbolShapes.Close
259 if StarShapes.Exists then StarShapes.Close
261 '/// Close Presentation. End testcase ///'
263 endcase 'tiSlideCopyNewPresentation
265 '-------------------------------------------------------------------------
267 testcase tiSlideCopyDuplicate
270 Dim value12 as string
271 Dim value13 as string
273 '/// Make a duplicate of a slide. In the same presentation ///'
274 '/// Make new presentation ///'
276 '/// Insert three objects: Connector, Door-plate, and Smiley ///'
281 Verbinder.TearOff ' insert connector
283 warnlog "bug for GH from FHA; .tearoff doesnt tell success"
285 kontext "Connectorsbar"
289 kontext "DocumentImpress"
291 gMouseMove (10,10,30,30)
299 DocumentImpress.TypeKeys "<SHIFT F10>"
303 if hMenuFindSelect(27027, true, 14) = false then
304 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
308 kontext "NameDlgObject"
309 NameField.SetText "First"
313 kontext "DocumentImpress"
314 hMouseClick DocumentImpress, 90, 90
316 '2 Insert Door-plate.
320 StarShapes.TearOff ' insert connector
322 warnlog "bug for GH from FHA; .tearoff doesnt tell success"
326 StarShapesDoorplate.click
328 kontext "DocumentImpress"
330 gMouseMove (40,40,60,60)
338 kontext "DocumentImpress"
339 DocumentImpress.TypeKeys "<SHIFT F10>"
342 if hMenuFindSelect(27027, true, 15) = false then
343 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
347 kontext "NameDlgObject"
348 NameField.SetText "Second"
352 kontext "DocumentImpress"
353 hMouseClick DocumentImpress, 90, 90
359 SymbolShapes.TearOff ' insert connector
361 warnlog "bug for GH from FHA; .tearoff doesnt tell success"
363 kontext "SymbolShapes"
365 SymbolShapesSmiley.Click
368 gMouseMove (70,70,89,89)
376 DocumentImpress.TypeKeys "<SHIFT F10>"
379 if hMenuFindSelect(27027, true, 15) = false then
380 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
384 kontext "NameDlgObject"
385 NameField.SetText "Third"
389 kontext "DocumentImpress"
390 hMouseClick DocumentImpress, 90, 90
392 '/// Close the bars we opened before. ///'
393 kontext "Connectorsbar"
394 if Connectorsbar.Exists then Connectorsbar.Close
395 kontext "SymbolShapes"
396 if SymbolShapes.Exists then SymbolShapes.Close
398 if StarShapes.Exists then StarShapes.Close
400 '/// Copy the slide to the clipboard ///'
402 SlidesControl.TypeKeys "<PAGEUP>"
404 SlidesControl.TypeKeys "<SHIFT F10>"
407 if hMenuFindSelect(5711, true, 10) = false then
408 Warnlog "Context-Menu-entry `Copy` was not found.Therefore the test ends."
413 '/// Paste the content from the Clipboard ///'
415 'open context-menu choose 'paste'
419 kontext "InsertPaste"
420 if InsertPaste.Exists(1) then
425 '/// Check if we have two slides, and that the objects exists, and has the right values ///'
428 SlidesControl.TypeKeys "<PAGEUP>"
430 for i = 1 to 2 ' we have two slides, so we do this two times to check everything.
431 Printlog "Checking objects the " + i + " + time."
432 kontext "DocumentImpress"
433 hMouseClick DocumentImpress, 90, 90
434 DocumentImpress.TypeKeys "<TAB>" 'Select the first object.
436 'Bring up the kontext-menu for the object
437 DocumentImpress.TypeKeys "<SHIFT F10>"
440 if hMenuFindSelect(27027, true, 14) = false then
441 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
446 'Read out what the name is, and check if its correct.
447 kontext "NameDlgObject" '"LinieName" "NameDlgPage"
448 value1 = NameField.GetText
449 NameDlgObject.OK 'TypeKeys "<Enter>"
451 if value1 = "First" then
452 printlog "First object was found correctly"
454 Warnlog "Wrong object or object-name! The name found was: " + value1
458 DocumentImpress.TypeKeys "<TAB>", 2
460 DocumentImpress.TypeKeys "<SHIFT F10>"
463 if hMenuFindSelect(27027, true, 15) = false then
464 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
469 'Read out what the name is, and check if its correct.
470 kontext "NameDlgObject"
471 value12 = NameField.GetText
474 if value12 = "Second" then
475 printlog "Second object was found correctly"
477 Warnlog "Wrong object or object-name! The name found was: " + value12
481 hTypeKeys "<TAB>", 3 'Select the third object.
484 'Bring up the kontext-menu for the object
485 DocumentImpress.TypeKeys "<SHIFT F10>"
488 if hMenuFindSelect(27027, true, 15) = false then
489 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
494 'Read out what the name is, and check if its correct.
495 kontext "NameDlgObject"
496 value13 = NameField.GetText
499 if value13 = "Third" then
500 printlog "Third object was found correctly"
502 Warnlog "Wrong object or object-name! The name found was: " + value13
505 SlidesControl.TypeKeys "<DOWN>"
508 '/// Close Presentation. End testcase ///'
510 endcase 'tiSlidecopyDuplicate
512 '-----------------------------------------------------------------------
514 testcase tiSlideCopyPasteSpecial
515 qaerrorlog "#i93377#: Paste special dialog does not come up with kontext on slide pane"
521 '/// Copies slide, and pastes it with "Paste Special", ///'
522 '/// just to see if the office can handle it ///'
523 '/// Make new presentation ///'
525 '/// Insert three objects: Connector, Door-plate, and Smiley ///'
531 Verbinder.TearOff ' insert connector
533 warnlog "bug for GH from FHA; .tearoff doesnt tell success"
535 kontext "Connectorsbar"
540 gMouseMove (10,10,30,30)
543 kontext "DocumentImpress"
544 hMouseClick DocumentImpress, 90, 90
546 '2 Insert Door-plate.
550 StarShapes.TearOff ' insert connector
552 warnlog "bug for GH from FHA; .tearoff doesnt tell success"
556 StarShapesDoorplate.click
559 gMouseMove (40,40,60,60)
562 kontext "DocumentImpress"
563 hMouseClick DocumentImpress, 90, 90
569 SymbolShapes.TearOff ' insert connector
571 warnlog "bug for GH from FHA; .tearoff doesnt tell success"
573 kontext "SymbolShapes"
575 SymbolShapesSmiley.Click
578 gMouseMove (70,70,89,89)
581 '/// Copy the slide to the clipboard ///'
583 SlidesControl.TypeKeys "<PAGEUP>"
584 SlidesControl.TypeKeys "<SHIFT F10>"
587 if hMenuFindSelect(5711, true, 10) = false then
588 Warnlog "Context-Menu-entry `Copy` was not found. Therefore the test ends."
593 '/// Try to paste special. And check that the office still stays alive ///'
595 kontext "InhaltEinfuegen"
598 '/// Close the bars we opened before. ///'
599 kontext "Connectorsbar"
600 if Connectorsbar.Exists then Connectorsbar.Close
601 kontext "SymbolShapes"
602 if SymbolShapes.Exists then SymbolShapes.Close
604 if StarShapes.Exists then StarShapes.Close
607 kontext "DocumentImpress"
608 '/// Close Presentation. End testcase ///'
611 endcase 'tiSlideCopyPasteSpecial
613 '-----------------------------------------------------------------------
614 testcase tiSlideCopyInSlideSorter
615 qaerrorlog "#i58418#: Pasting in slide sorter sets slide to wrong position"
621 '/// Copies slides within the slidesorter, and makes sure they are pasted on the correct position ///'
622 '/// Make new presentation ///'
624 '/// Insert an object: Connector, on the first slide ///'
630 warnlog "bug for GH from FHA; .tearoff doesnt tell success"
632 kontext "Connectorsbar"
638 kontext "DocumentImpress"
640 gMouseMove (10,10,30,30)
642 Printlog " Inserted a Connector-object."
646 DocumentImpress.TypeKeys "<SHIFT F10>"
649 if hMenuFindSelect(27027, true, 14) = false then
650 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
654 kontext "NameDlgObject"
655 NameField.SetText "First"
658 Printlog " Renamed a the object to 'First'"
661 '/// Rename slide to "1" ///'
663 SlidesControl.TypeKeys "<PAGEUP>"
664 SlidesControl.TypeKeys "<SHIFT F10>"
667 if hMenuFindSelect(27268, true, 2) = false then
668 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
673 kontext "NameDlgPage"
674 NameField.SetText "1"
677 Printlog " Renamed the Slide to '1'"
679 kontext "DocumentImpress"
680 hMouseClick DocumentImpress, 90, 90
683 '/// Insert a new slide ///'
685 SlidesControl.TypeKeys "<TAB><PAGEDOWN>"
686 SlidesControl.OpenContextMenu
689 if hMenuFindSelect(27014, true, 1) = false then
690 Warnlog "Context-Menu-entry `Insert slide` was not found. Therefore the test ends."
694 Printlog " Inserted a new slide."
695 '/// Insert an object: Door-plate, on the second slide ///'
701 warnlog "bug for GH from FHA; .tearoff doesnt tell success"
705 StarShapesDoorplate.click
707 kontext "DocumentImpress"
709 gMouseMove (40,40,60,60)
711 Printlog " Inserted a Door-Plate-object."
715 hTypeKeys "<SHIFT F10>"
718 if hMenuFindSelect(27027, true, 15) = false then
719 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
724 kontext "NameDlgObject"
725 NameField.SetText "Second"
728 Printlog " Renamed a the object to 'Second'"
730 kontext "DocumentImpress"
731 hMouseClick DocumentImpress, 90, 90
733 '/// Rename slide to "2" ///'
735 SlidesControl.OpenContextMenu
738 if hMenuFindSelect(27268, true, 3) = false then
739 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
743 kontext "NameDlgPage"
744 NameField.SetText "2"
747 Printlog " Renamed the slide '2'"
749 '/// Insert a new slide ///'
751 Slidescontrol.TypeKeys "<PAGEDOWN>", 2
752 Slidescontrol.TypeKeys "<SHIFT F10>"
755 if hMenuFindSelect(27014, true, 1) = false then
756 Warnlog "Context-Menu-entry `Insert slide` was not found. Therefore the test ends."
760 Printlog " Inserted a new slide."
762 '/// Insert an object: Smiley, on the second slide ///'
768 warnlog "bug for GH from FHA; .tearoff doesnt tell success"
770 kontext "SymbolShapes"
772 SymbolShapesSmiley.Click
775 gMouseMove (70,70,89,89)
777 Printlog " Inserted a Smiley-object."
782 hTypeKeys "<SHIFT F10>"
785 if hMenuFindSelect(27027, true, 15) = false then
786 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
790 kontext "NameDlgObject"
791 NameField.SetText "Third"
793 Printlog " Renamed a the object to 'Third'"
795 '/// Rename slide to "3" ///'
797 Slidescontrol.TypeKeys "<PAGEDOWN>", 2
798 SlidesControl.OpenContextMenu
801 if hMenuFindSelect(27268, true, 3) = false then
802 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
807 kontext "NameDlgPage"
808 NameField.SetText "3"
811 Printlog " Renamed the slide '3'"
813 '/// Close the bars we opened before. ///'
814 kontext "Connectorsbar"
815 if Connectorsbar.Exists then Connectorsbar.Close
816 kontext "SymbolShapes"
817 if SymbolShapes.Exists then SymbolShapes.Close
819 if StarShapes.Exists then StarShapes.Close
821 '/// Change to Slidesorter ///'
822 kontext "DocumentImpress"
825 '/// Now we have changed view to the slidesorter ///'
828 Printlog " Changed view to 'SlideSorter'"
829 '/// Make sure the last slide is selcted ///'
830 SlidesControl.TypeKeys "<TAB>"
831 SlidesControl.TypeKeys "<PAGEDOWN>", 3
833 '/// Cut the last slide ///'
834 SlidesControl.TypeKeys "<MOD1 X>"
836 '/// Make sure the first slide is selected ///'
837 SlidesControl.TypeKeys "<TAB>"
838 SlidesControl.TypeKeys "<PAGEUP>", 2
841 '/// Paste the Slide ///'
843 SlidesControl.TypeKeys "<MOD1 V>"
845 '/// choose "Before" as specification for where
846 Kontext "InsertPaste"
847 if InsertPaste.Exists(3) then
850 Printlog " Pasted slide 'Before'"
852 warnlog " Problem when copying/pasting slide."
855 '/// Check where the slide ended up ///'
857 SlidesControl.TypeKeys "<TAB>"
858 SlidesControl.TypeKeys "<PAGEUP>", 3 'to get to the first slide
859 SlidesControl.TypeKeys "<SHIFT F10>"
862 if hMenuFindSelect(27268, true, 3) = false then
863 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
868 kontext "NameDlgPage"
869 if NameField.GetText <> "3" then
870 Warnlog "Wrong slide found! Expected nr 3, but found " + NameField.GetText + "."
872 Printlog " Slide nr 3 was found correctly."
878 '/// Choose the slide in the middle (named "1") ///'
879 SlidesControl.TypeKeys "<TAB>"
880 SlidesControl.TypeKeys "<PAGEDOWN>", 3 'to get to the last slide
881 SlidesControl.TypeKeys "<PAGEUP>" 'to go back one step
882 SlidesControl.OpenContextMenu (true)
883 ' Check the name of that slide (via Rename)
884 if hMenuFindSelect(27268, true, 3) = false then
885 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
890 kontext "NameDlgPage"
891 if NameField.GetText <> "1" then
892 Warnlog "Wrong slide found! Expected nr 1, but found " + NameField.GetText + "."
894 Printlog " Slide nr 1 was found correctly in the middle position."
900 '/// Cut the slide ///'
901 SlidesControl.TypeKeys "<SHIFT F10>"
903 if hMenuFindSelect(5710, true, 10) = false then
904 Warnlog "Context-Menu-entry `Cut` was not found. Therefore the test ends."
909 '/// Make sure we have selected the last slide ///'
910 SlidesControl.TypeKeys "<TAB>"
911 SlidesControl.TypeKeys "<PAGEDOWN>", 2
913 '/// Place the mousepointer to the left of the first slide ///'
916 SlidesControl.MouseMove 2, 3
917 SlidesControl.OpenContextMenu true
920 '/// Paste the Slide ///'
921 if hMenuFindSelect(5712, true, 12) = false then
922 Warnlog "Context-Menu-entry `Paste` were not found. Therefore the test ends."
928 '/// Choose "After" as specification for where ///'
929 Kontext "InsertPaste"
930 if InsertPaste.Exists(3) then
933 Printlog " Pasted slide 'After'"
935 warnlog " Problem when copying/pasting slide."
938 '/// Check where the slide ended up. Should have showed up at the last position ///'
940 SlidesControl.TypeKeys "<TAB>"
941 SlidesControl.TypeKeys "<PAGEDOWN>", 3 'to get to the last slide
942 SlidesControl.TypeKeys "<SHIFT F10>" '= open context menu
945 if hMenuFindSelect(27268, true, 3) = false then
946 Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
951 kontext "NameDlgPage"
952 if NameField.GetText <> "1" then
953 Warnlog "Wrong slide found! Expected nr 1, but found " + NameField.GetText + "."
955 Printlog " Slide nr 1 was found correctly."
960 '/// Close Presentation. End testcase ///'
962 endcase 'tiSlideCopyInSlideSorter
964 '------------------------------------------------------------------------
966 'TODO FHA - Check the objects after pasting them.