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: w_undo_history_4.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-09-04 09:20:57 $
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 : helge.delfs@sun.com
36 '* short description : Writer Undo-History - Test
38 '\***********************************************************************
42 Call tUndoOLEObject ' Objects (Insert/Delete)
43 Call tUndoFloatingFrame ' Floating Frame (Insert/Delete)
44 Call tUndoInsertFile ' Insert file
45 Call tUndoAsianPhoneticGuides ' Asian Phonetic Guides
46 Call tUndoAutocorrect ' Autocorrect / Autoformat
47 Call tUndoDrawObject ' Draw Object (Insert)
48 Call tUndoDrawObjectGroup ' Draw Object (Group/ungroup/Name/Delete)
49 Call tUndoSpellcheck ' Spellcheck (Autocheck/Spellcheck)
50 Call tUndoFormControl ' Form Control (Insert/resize/move/replace/change property/delete)
51 Call tUndoHeaderFooter ' Header/Footer insert and delete
55 testcase tUndoOLEObject
57 '/// <B>OLE-Objects (Insert/Delete)</B>
58 printlog "- Insert OLE-Object"
61 '/// Insert / Object / OLE-Object ///
63 Kontext "OLEObjektEinfuegen"
67 Call wTypeKeys "<Esc>"
69 Call gMouseClick(15,5)
71 '/// string in Undo-list has to be: "Insert object")
72 Call CheckUndoStringInUndoList ( 10, "InsertObject" )
74 printlog "- delete object"
75 '/// Select object with <Shift F4>
76 Call wTypeKeys "<Shift F4>"
78 '/// <B>Delete object</B>
79 Call wTypeKeys "<Delete>"
81 '/// press 'delete' to remove object
82 '/// string in Undo-list has to be: "Delete object")
83 Call CheckUndoStringInUndoList ( 10, "DeleteObject" )
90 testcase tUndoFloatingFrame
92 '/// <B>Floating frames</B>
93 printlog "- Insert floating frame"
96 '/// Insert / Floating frame
98 Kontext "TabEigenschaften"
99 '/// Choose a file as floating frame
100 Inhalt.Settext Convertpath (gTesttoolPath & "writer\optional\input\graphics\jolink.jpg" )
103 '/// string in Undo-list has to be: "Insert floating frame")
104 Call CheckUndoStringInUndoList ( 10, "InsertFloatingFrame" )
106 '/// Delete floating frame
107 printlog "- delete floating frame"
108 Call wTypeKeys "<Delete>"
109 '/// string in Undo-list has to be: "Delete floating frame")
110 Call CheckUndoStringInUndoList ( 10, "DeleteFloatingFrame" )
117 testcase tUndoInsertFile
119 '/// <B>Insert File</B>
120 printlog "- Insert file"
128 '/// Choose "..\\writer\\input\\htmltest.sxw"
129 if OeffnenDlg.Exists then
130 Dateiname.Settext Convertpath (gTesttoolPath & "writer\optional\input\undo\htmltest.sxw" )
133 Warnlog "File open dialog missing"
138 '/// string in Undo-list has to be: "Insert document")
139 Call CheckUndoStringInUndoList ( 10, "InsertDocument" )
146 testcase tUndoAsianPhoneticGuides
148 '/// <B>Asian Phonetic Guides</B>
149 printlog "- Asian Phonetic Guides"
152 '/// type some text and select it
153 Call wTypeKeys ( "JuppHeidiUndJuppHeida" )
154 Call wTypeKeys ( "<Home>" )
155 '/// Check if Asian support is enabled, if not enable it
156 if gAsianSup = true then
159 RubyText1.Settext "SeppHeidiUndSeppHeida"
163 Call ActiveDeactivateAsianSupport(True)
166 RubyText1.Settext "SeppHeidiUndSeppHeida"
169 Call ActiveDeactivateAsianSupport(False)
172 '/// string in Undo-list has to be: "Asian Phonectic Guides Setting")
173 Call CheckUndoStringInUndoList ( 10, "APGS" )
180 testcase tUndoAutocorrect
182 '/// <B>Autocorrect / Autoformat</B>
183 printlog "- Autocorrect / Autoformat"
186 '/// <B>Autocorrect</B>
187 printlog "- Autocorrect"
188 '/// type with quote and blank at the end 'www.sun.com '
189 Call wTypeKeys ( "www.sun.com " )
190 '/// string in Undo-list has to be: "AutoCorrect")
191 Call CheckUndoStringInUndoList ( 10, "AutoCorrect" )
193 '/// insert a line break
194 Call wTypeKeys ( "<Return>" )
195 '/// <B>Autoformat</B>
196 printlog "- Autoformat"
197 '/// type - AutoFormat test<Return>
198 Call wTypeKeys ( "- AutoFormat test<Return>" )
199 '/// string in Undo-list has to be: "AutoCorrect")
200 Call CheckUndoStringInUndoList ( 10, "AutoFormat" )
207 testcase tUndoDrawObject
208 '/// <B>Draw object</B>
209 printlog "- Draw object"
212 '/// Insert a freeform line object
219 Call hToolbarSelect ("Drawing", true)
221 printlog " - Draw Freeform"
223 Call gMouseMove ( 33, 40, 55, 51 )
224 Call gMouseMove ( 35, 31, 40, 90 )
225 Call gMouseMove ( 41, 91, 55 , 70 )
226 Call gMouseClick( 55, 70 )
227 Call wTypeKeys ("<Escape>")
229 '/// string in Undo-list has to be: "Insert draw object: freeform line")
230 Call CheckUndoStringInUndoList ( 10, "FreeForm" )
237 testcase tUndoDrawObjectGroup
239 '/// <B>Group of Drawing objects</B>
240 printlog "- Group of Drawing objects"
241 '/// new document ///
248 '/// Insert 2 drawing objects (rectangle) ///
249 Call wZeichenobjektEinfuegen ( "Rechteck", 40, 50, 60, 60 )
250 Call wTypeKeys "<ESCAPE>"
251 Call wTypeKeys "<ESCAPE>"
252 Call wZeichenobjektEinfuegen ( "Rechteck", 40, 55, 50, 65 )
253 '/// Select both objects ///
254 Call wObjektSelektieren ( 35, 35, 70, 70 )
255 '/// Select Format / Group / Group ///
257 printlog "- group objects"
260 '/// string in Undo-list has to be: "Group draw objects")
261 Call CheckUndoStringInUndoList ( 10, "DrawGroup" )
263 '/// Format / Name object
264 printlog "- name objects"
266 Kontext "NameDlgObject"
267 NameField.Settext "MyGroup"
269 '/// string in Undo-list has to be: "Rename 2 Rectangles")
270 Call CheckUndoStringInUndoList ( 10, "RenameGroup" )
272 '/// Select Format / Group / Ungroup ///
273 printlog "- ungroup objects"
275 '/// string in Undo-list has to be: "Ungroup group object")
276 Call CheckUndoStringInUndoList ( 10, "DrawUnGroup" )
278 '/// Select 1 object and delete it
279 Call gMouseClick ( 40, 52 )
280 printlog "- delete object"
281 Call wTypeKeys "<Delete>"
282 '/// string in Undo-list has to be: "Delete 2 Rectangles")
283 Call CheckUndoStringInUndoList ( 10, "DeleteGroup" )
285 Warnlog "Unable to execute 'Format / Group / Group' -> disabled!"
293 testcase tUndoSpellcheck
294 Dim sReplace as string
296 '/// <B>Spellcheck(Autocheck/Spellcheck)</B>
297 printlog "- Spellcheck: Autocheck"
298 '/// new document ///
299 hfileOpen (gTesttoolpath + "writer\optional\input\undo\spellcheck_undo.odt")
300 Call sMakeReadOnlyDocumentEditable
301 '/// Type "This is a testp<End>"
302 Call wTypeKeys ( "<End>" ) 'This is a testp
303 '/// Select word' testp'
304 Call wTypeKeys ( "<Mod1 Shift Left>" )
305 '/// Tools / Spellcheck
306 ToolsSpellcheckWriter
309 sReplace = Suggestions.GetSelText
310 '///Replace with 1st word in suggestion list
311 printlog "-> Replace with word: " & sReplace
314 if Active.Exists then
315 if Active.GetRT = 304 then
320 if Spellcheck.Exists then Spellcheck.Close
321 '/// string in Undo-list has to be: "Replace: 'Testp' -> 'Test'")
322 Call CheckUndoStringInUndoList ( 10, "Autocheck/Spellcheck" )
324 '/// Uncheck 'Autospellcheck' in Toolbar ///
325 ToolsSpellcheckAutoSpellcheck
327 printlog "- Spellcheck"
328 Call wTypeKeys ( "<End><Return>", 2 )
330 Call wTypeKeys ( "testp<Shift Home>" )
331 ToolsSpellcheckWriter
333 ' Workaround: For some reasons sometimes dialog is disabled here
334 ' Only reproducable by testtool
339 ToolsSpellcheckWriter
345 if Active.Exists then
346 if Active.GetRT = 304 then
355 if Spellcheck.Exists then Spellcheck.Close
357 '/// string in Undo-list has to be: "Replace: 'Testp' -> 'Test'")
358 Call CheckUndoStringInUndoList ( 10, "Autocheck/Spellcheck" )
365 testcase tUndoFormControl
367 '/// <B>Form Control (Insert/resize/move/replace/change property/delete)</B>
368 printlog "- Form control (insert)"
371 '/// Open 'Form' Toolbox ///
372 Call hToolbarSelect ("FormControls", true)
373 'Formsbar.Move 20, 30
374 '/// Insert a pushbutton from toolbox ///
376 Kontext "DocumentWriter"
377 DocumentWriter.MouseDown ( 40, 50 )
378 DocumentWriter.MouseMove ( 50, 55 )
379 DocumentWriter.MouseUp ( 50, 55 )
382 '/// string in Undo-list has to be: "Insert control")
383 Call CheckUndoStringInUndoList ( 10, "ControlInsert" )
385 printlog "- Form control (move)"
386 '/// Press '<Up>' to move control
387 Call wTypeKeys ( "<Up>" )
388 '/// string in Undo-list has to be: "Move control")
389 Call CheckUndoStringInUndoList ( 10, "ControlMove" )
391 printlog "- Form control (resize)"
392 '/// Press '<Ctrl+Tab>' to enter handle selection mode
393 Call wTypeKeys ( "<Mod1 Tab>" )
394 '/// Press '<Up>' to resize control
395 Call wTypeKeys ( "<Up>" )
396 '/// string in Undo-list has to be: "Resize control")
397 Call CheckUndoStringInUndoList ( 10, "ControlResize" )
399 printlog "- Form control (replace)"
400 '/// Select 'Format->Replace with-> Text box'
401 FormatReplaceWithTextBox
403 '/// string in Undo-list has to be: "Replace control")
404 Call CheckUndoStringInUndoList ( 10, "ControlReplace" )
406 printlog "- Form control (change property)"
407 '/// Select 'Format->Control' and change name of control
409 Kontext "ControlPropertiesTabControl"
410 ControlPropertiesTabControl.setPage TabGeneralControl
411 Kontext "TabGeneralControl"
412 NameText.Settext "MyControl"
414 '/// string in Undo-list has to be: "Set property 'Name'")
415 Call CheckUndoStringInUndoList ( 10, "ControlChange" )
417 printlog "- Form control (delete)"
418 '/// Press '<Delete>' to delete control
419 Call wTypeKeys ( "<Delete>" )
420 '/// string in Undo-list has to be: "Delete control")
421 Call CheckUndoStringInUndoList ( 10, "ControlDelete" )
428 testcase tUndoHeaderFooter
430 QAErrorlog "#i56552#footer deletion cannot be undone"
433 printlog "- Insert header"
436 '/// Insert / Header / Default
437 DocumentWriter.UseMenu
438 MenuSelect(Menugetitemid(4))
440 MenuSelect(Menugetitemid(9))
442 MenuSelect(Menugetitemid(1))
444 '/// string in Undo-list has to be: "Header/footer changed")
445 Call CheckUndoStringInUndoList ( 10, "Header/Footer" )
448 printlog "- Delete header"
449 Kontext "DocumentWriter"
450 DocumentWriter.UseMenu
451 MenuSelect(Menugetitemid(4))
453 MenuSelect(Menugetitemid(9))
455 MenuSelect(Menugetitemid(1))
458 if Active.Exists then
459 if Active.GetRT = 304 then
463 '/// string in Undo-list has to be: "Header/footer changed")
464 Call CheckUndoStringInUndoList ( 10, "Header/Footer" )
467 printlog "- Insert footer"
468 '/// Insert / Header / Default
469 Kontext "DocumentWriter"
470 DocumentWriter.UseMenu
471 MenuSelect(Menugetitemid(4))
473 MenuSelect(Menugetitemid(10))
475 MenuSelect(Menugetitemid(1))
477 '/// string in Undo-list has to be: "Header/footer changed")
478 Call CheckUndoStringInUndoList ( 10, "Header/Footer" )
481 printlog "- Delete footer"
482 Kontext "DocumentWriter"
483 DocumentWriter.UseMenu
484 MenuSelect(Menugetitemid(4))
486 MenuSelect(Menugetitemid(10))
488 MenuSelect(Menugetitemid(1))
491 if Active.Exists then
492 if Active.GetRT = 304 then
496 '/// string in Undo-list has to be: "Header/footer changed")
497 Call CheckUndoStringInUndoList ( 10, "Header/Footer" )