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_206_.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-09-04 09:19:40 $
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 : Testing Number and Bullets
38 '\***********************************************************************
51 Call tToolsNumbering10
52 Call tToolsNumbering11
56 testcase tToolsNumbering1
57 printlog "Create a simple numbering without selection"
58 '/// Create a simple numbering without selection
61 '/// Open a new text document
64 '/// Activate Numbering/Bullets via Objectbar
65 Call hToolbarSelect("BulletsAndNumbering", true)
67 '/// Create a numbering
68 Kontext "NumObjectbar"
69 if Not NumObjectbar.Exists then
70 Warnlog "Numbering/Bullets objectbar not accessible"
77 call wTypeKeys ( "Numbering Level " & i )
78 call wTypeKeys ( "<RETURN>" )
81 '/// Check if numbering has been created
83 call wTypeKeys ( "<UP>" )
84 if hIsNumberingBullets() = false then
85 Warnlog "Seems numbering has not been completely created"
94 testcase tToolsNumbering2
95 printlog "Create simple bullets without selection"
96 '/// Create simple bullets without selection
99 '/// Open a new text document
102 '/// Activate Numbering/Bullets via Objectbar
103 Call hToolbarSelect("BulletsAndNumbering", true)
106 Kontext "NumObjectbar"
107 if Not NumObjectbar.Exists then
108 Warnlog "Numbering/Bullets objectbar not accessible"
115 call wTypeKeys ( "Numbering Level " & i )
116 call wTypeKeys ( "<RETURN>" )
119 '/// Check if numbering has been created
121 call wTypeKeys ( "<UP>" )
122 if hIsNumberingBullets() = false then
123 Warnlog "Seems numbering has not been completely created"
133 testcase tToolsNumbering3
134 printlog "Turn several selected paragraphs into numbering"
135 '/// Turn several selected paragraphs into numbering
138 '/// Open a new text document
141 '/// Insert autotext 'Dummy text' 3 times
143 Call wBlindtextEinfuegen
146 '/// Point cursor to beginning of document
147 call wTypeKeys ( "<Mod1 Home>" )
148 '/// Select all text inserted
149 call wTypeKeys ( "<Mod1 A>" )
151 '/// Activate Numbering/Bullets via Objectbar
152 Call hToolbarSelect("BulletsAndNumbering", true)
154 Kontext "NumObjectbar"
155 if Not NumObjectbar.Exists then
156 Warnlog "Numbering/Bullets objectbar not accessible"
162 '/// Check if numbering has been created
163 call wTypeKeys ( "<Mod1 Home>" )
166 if hIsNumberingBullets() = false then
167 Warnlog "Seems numbering has not been completely created"
169 call wTypeKeys ( "<Mod1 Down>" )
178 testcase tToolsNumbering4
179 printlog "Turn several selected paragraphs into bullets"
180 '/// Turn several selected paragraphs into bullets
183 '/// Open a new text document
186 '/// Insert autotext 'Dummy text' 3 times
188 Call wBlindtextEinfuegen
191 '/// Point cursor to beginning of document
192 call wTypeKeys ( "<Mod1 Home>" )
193 '/// Select all text inserted
194 call wTypeKeys ( "<Mod1 A>" )
196 '/// Activate Numbering/Bullets via Objectbar
197 Call hToolbarSelect("BulletsAndNumbering", true)
199 Kontext "NumObjectbar"
200 if Not NumObjectbar.Exists then
201 Warnlog "Numbering/Bullets objectbar not accessible"
207 '/// Check if numbering has been created
208 call wTypeKeys ( "<Mod1 Home>" )
211 if hIsNumberingBullets() = false then
212 Warnlog "Seems bullets have not been completely created"
214 call wTypeKeys ( "<Mod1 Down>" )
223 testcase tToolsNumbering5
224 printlog "create numbering via autoformat"
225 '/// create numbering via autoformat
226 Dim i as integer, sClipBrd() as string
229 '/// Open a new text document
232 '/// Insert '1.' // 'I.' // 'a.' followed by text
235 printlog "- Enter numbering starting with 1)"
236 call wTypeKeys ( "1) " )
238 call wTypeKeys ( "1. " )
239 printlog "- Enter numbering starting with 1."
241 call wTypeKeys ( "(1) " )
242 printlog "- Enter numbering starting with (1)"
244 call wTypeKeys ( "I. " )
245 printlog "- Enter numbering starting with I."
247 call wTypeKeys ( "i. " )
248 printlog "- Enter numbering starting with i."
250 call wTypeKeys ( "A) " )
251 printlog "- Enter numbering starting with A)"
253 call wTypeKeys ( "a) " )
254 printlog "- Enter numbering starting with a)"
256 call wTypeKeys ( "(a) " )
257 printlog "- Enter numbering starting with (a)"
260 '/// + 'my new numbering'
261 '/// + followed by return (creats the numbering)
262 '/// + followed by text 'my newer numbering'
263 call wTypeKeys "my new numbering<Return>"
264 call wTypeKeys "my newer numbering"
266 '/// check if numbering has been created
267 call wTypeKeys ( "<MOD1 A>" )
269 Select Case gPlatGroup
271 sClipBrd() = Split (GetClipboardText, CHR$(10))
273 sClipBrd() = Split (GetClipboardText, CHR$(13) & CHR$(10))
275 if Ubound(sClipBrd()) = 1 then
278 if Left$(sClipBrd(1), 2) <> "2)" then
279 Warnlog "Seems numbering 1) has not been correctly created"
282 if Left$(sClipBrd(1), 2) <> "2." then
283 Warnlog "Seems numbering 1. has not been correctly created"
286 if Left$(sClipBrd(1), 3) <> "(2)" then
287 Warnlog "Seems numbering (1) has not been correctly created"
290 if Left$(sClipBrd(1), 3) <> "II." then
291 Warnlog "Seems numbering I. has not been correctly created"
294 if Left$(sClipBrd(1), 3) <> "ii." then
295 QaErrorLog "#i78524#Auto-capitalisation of letter i hinders Automatic numbering" 'Warnlog "Seems numbering i. has not been correctly created"
298 if Left$(sClipBrd(1), 2) <> "B)" then
299 QaErrorLog "#i71136# - Autocorrect won't start numbering by 'A)'" 'warnlog "Seems numbering A) has not been correctly created"
302 if Left$(sClipBrd(1), 2) <> "b)" then
303 QaErrorLog "#i71136# - Autocorrect won't start numbering by 'a)'" 'warnlog "Seems numbering a) has not been correctly created"
306 if Left$(sClipBrd(1), 2) <> "(b)" then
307 QaErrorLog "#i71136# - Autocorrect won't start numbering by '(a)'" 'warnlog "Seems numbering (a) has not been correctly created"
311 Warnlog "Error in clipboard content! " & Ubound(sClipBrd())
321 testcase tToolsNumbering6
322 printlog "Remove numbering from paragraph by pressing <DEL> key (normal numbering)"
324 Dim i as integer, sClipBrd() as string
326 '/// Remove numbering from paragraph by pressing "DEL" key (normal numbering)
327 '/// Open a new text document
329 '/// Insert some text '1. This is the first' followed by a return
330 call wTypeKeys ( "1. This is the first<Return>" )
331 '/// Insert some text 'This is the second' followed by a return
332 call wTypeKeys ( "This is the second<Return>" )
333 '/// Insert some text 'This is the third'
334 call wTypeKeys ( "This is the third" )
336 '/// Press key <STRG HOME> to go to first
337 call wTypeKeys ( "<MOD1 Home>" )
338 '/// Press <HOME> to highlight numbering
339 call wTypeKeys ( "<Home>" )
340 '/// Press <DELETE> to remove first paragraph numbering
341 call wTypeKeys ( "<DELETE>" )
342 '/// Check if numbering of the following paragraphs has been adapted even after save and reload
346 Call hFileSaveAsKill ( gOfficepath & "user\work\tToolsNumbering6.odt" )
347 '/// Close and reload document
349 Call hFileOpen ( gOfficepath & "user\work\tToolsNumbering6.odt" )
351 call wTypeKeys ( "<MOD1 A>" )
353 Select Case gPlatGroup
355 sClipBrd() = Split (GetClipboardText, CHR$(10))
357 sClipBrd() = Split (GetClipboardText, CHR$(13) & CHR$(10))
363 if sClipBrd(0) <> "This is the first" then
364 Warnlog "First paragraph not 'This is the first' but: " & sClipBrd(0)
367 if sClipBrd(1) <> "1.This is the second" then
368 Warnlog "First paragraph not '1.This is the second' but: " & sClipBrd(1)
371 if sClipBrd(2) <> "2.This is the third" then
372 Warnlog "First paragraph not '2.This is the third' but: " & sClipBrd(2)
383 testcase tToolsNumbering7
384 printlog "Remove numbering from paragraph by pressing <DEL> key (outlined numbering)"
385 Dim j as integer, sVorlage as string
386 Dim i as integer, sClipBrd() as string
387 '/// Remove numbering from paragraph by pressing "DEL" key (outlined numbering)
388 '/// Open a new text document
390 '/// Tools / Outline Numbering
391 ToolsOutlineNumbering
393 Active.SetPage TabKapitelnumerierung
394 Kontext "TabKapitelnumerierung"
395 sVorlage = Absatzvorlage.GetSelText
396 '/// Select as Numbering Number 1 in list
398 '/// Set as Seperator (After) a `.`
400 '/// Close 'Outline Numbering' dialog
401 TabKapitelnumerierung.Ok
403 ' Numbering of outlines will not be copied to clipboard
404 ' so we use the Field 'Chapter' which does
408 Active.Setpage TabDokumentFeldbefehle
409 Kontext "TabDokumentFeldbefehle"
411 Feldtyp.Select fGetType("Chapter")
414 Case 7 :Formatliste.Select 3 'Chapternumber
415 Case 34 :Formatliste.Select 3 'Chapternumber
416 Case else :Formatliste.Select 2 'Chapternumber
419 Warnlog "Unable to select field 'chapter'"
420 TabDokumentFeldbefehle.Close
425 TabDokumentFeldbefehle.Close
429 '/// Insert some text 'My first number' followed by a return
430 call wTypeKeys ( "My first number<RETURN>" )
432 '/// Insert some text 'My second number' followed by a return
433 call wTypeKeys ( "My second number<RETURN>" )
435 '/// Insert some text 'My third number'
436 call wTypeKeys ( "My third number" )
440 call wTypeKeys ( "<MOD1 A>" )
441 '/// Set Style 'Heading 1'
442 Call wStyleSet ( sVorlage )
444 '/// Press key <STRG HOME> to go to first
445 call wTypeKeys ( "<MOD1 Home>" )
446 '/// Press <HOME> to highlight numbering
447 call wTypeKeys ( "<Home>" )
448 '/// Press <DELETE> to remove first paragraph numbering
449 call wTypeKeys ( "<DELETE>" )
450 '/// Check if numbering of the following paragraphs has been adapted even after save and reload
454 Call hFileSaveAsKill ( gOfficepath & "user\work\tToolsNumbering7.odt" )
455 '/// Close and reload document
457 Call hFileOpen ( gOfficepath & "user\work\tToolsNumbering7.odt" )
460 call wTypeKeys ( "<MOD1 A>" )
462 Select Case gPlatGroup
464 sClipBrd() = Split (GetClipboardText, CHR$(10))
466 sClipBrd() = Split (GetClipboardText, CHR$(13) & CHR$(10))
472 if sClipBrd(0) <> "My first number" then
473 if Left$(sClipBrd(0), 2) = "1." then
474 Warnlog "Outline Numbering cannot be deleted pressing '<DELETE>' key"
477 Warnlog "First paragraph not 'My first number' but: " & sClipBrd(0)
481 if sClipBrd(1) <> "1.My second number" then
482 Warnlog "#128041#First paragraph not '1.My second number' but: " & sClipBrd(1)
485 if sClipBrd(2) <> "2.My third number" then
486 Warnlog "#128041#First paragraph not '2.My third number' but: " & sClipBrd(2)
497 testcase tToolsNumbering8
498 printlog "Take care that numbering can be activated within tables"
500 '/// Take care that numbering can be activated within tables
501 '/// Open a new text document
503 '/// Insert a table with 6 rows and 3 columns
505 Kontext "TabelleEinfuegenWriter"
508 TabelleEinfuegenWriter.Ok
510 '/// Select 2nd to 6th row in first column
511 call wTypeKeys ( "<Mod1 Home>" )
512 call wTypeKeys ( "<Down>" )
513 call wTypeKeys ( "<Shift Down>", 4 )
515 '/// Activate Numbering/Bullets via Objectbar
516 Call hToolbarSelect("BulletsAndNumbering", true)
517 Kontext "NumObjectbar"
518 if Not NumObjectbar.Exists then
519 Warnlog "Numbering/Bullets objectbar not accessible"
524 '/// Enable numbering
526 '/// Check if numbering has been created in table
527 call wTypeKeys ( "<Mod1 Home>" )
530 if hIsNumberingBullets() = true then
531 Warnlog "Seems numbering has been created in first row"
534 if hIsNumberingBullets() = false then
535 Warnlog "Seems numbering has not been created correctly"
539 call wTypeKeys ( "<Down>" )
547 testcase tToolsNumbering9
549 printlog "Turn off a numbered list"
550 '/// Turn off a numbered list via toolbar
551 '/// Open a new text docoument
553 '/// Create a numbering
554 '/// Write in document '1. This numbering' followed by a return
555 call wTypeKeys "1. This numbering<Return>"
556 '/// + write 'that will be automatically created' followed by a return
557 call wTypeKeys "that will be automatically created<RETURN>"
558 '/// + write 'and be turned off via toolbar'
559 call wTypeKeys ( "and turned off via toolbar" )
561 call wTypeKeys ( "<Mod1 A>" )
562 '/// Activate Numbering/Bullets via Objectbar
563 Call hToolbarSelect("BulletsAndNumbering", true)
564 Kontext "NumObjectbar"
565 if Not NumObjectbar.Exists then
566 Warnlog "Numbering/Bullets objectbar not accessible"
570 '/// Turn numbering off by clicking 'Numbering' symbol
573 '/// Check if numbering has been turned off
574 call wTypeKeys ( "<Mod1 Home>" )
576 call wTypeKeys ( "<Shift End>" )
580 if GetClipboardtext <> "This numbering" then
581 Warnlog "It seems numbering isn't turned off"
585 if GetClipboardtext <> "that will be automatically created" then
586 Warnlog "It seems numbering isn't turned off"
590 if GetClipboardtext <> "and turned off via toolbar" then
591 Warnlog "It seems numbering isn't turned off"
594 call wTypeKeys ( "<Down><Home>" )
601 testcase tToolsNumbering10
603 printlog "Pressing <ENTER> key in an empty paragraph turns off numbering"
604 '/// Press <ENTER> key in an empty paragraph turns off numbering
605 '/// Open a new text docoument
607 '/// Create a numbering
608 '/// Write in document '1. This numbering' followed by a return
609 call wTypeKeys "1. This numbering<Return>"
610 '/// + write 'that will be automatically created' followed by a return
611 call wTypeKeys "that will be automatically created<RETURN>"
612 '/// + write 'and be turned off via return' followed by a return
613 call wTypeKeys ( "and turned off via return<RETURN>" )
614 '/// + enter <Return> to create an empty paragraph
615 call wTypeKeys ( "<Return>" )
616 '/// Hit <Return> again should leave a numbering with 3 paragraphs
617 call wTypeKeys ( "No numbering anymore" )
618 call wTypeKeys ( "<Shift Home>" )
620 if GetClipboardtext <> "No numbering anymore" then
621 Warnlog "Seems numbering wasn't turned off !"
623 call wTypeKeys ( "<Mod1 Home>" )
625 if hIsNumberingBullets() = false then
626 Warnlog "Seems numbering has been completely turned off"
629 call wTypeKeys ( "<Down>" )
638 testcase tToolsNumbering11
639 Dim i as integer, sVorlage as string
640 Dim sClipBrd() as string
641 printlog "Create an empty heading (Ouline numbering)"
642 '/// Create an empty heading (Ouline numbering)
643 '/// Open a new text document
645 ' Get name of 'Heading' (language dependent)
646 ToolsOutlineNumbering
648 Active.SetPage TabKapitelnumerierung
649 Kontext "TabKapitelnumerierung"
650 sVorlage = Absatzvorlage.GetSelText
651 TabKapitelnumerierung.Cancel
653 '/// Create a outline numbering
654 ' Numbering of outlines will not be copied to clipboard
655 ' so we use the Field 'Chapter' which does
659 Active.Setpage TabDokumentFeldbefehle
660 Kontext "TabDokumentFeldbefehle"
662 Feldtyp.Select fGetType("Chapter")
665 Case 7 :Formatliste.Select 3 'Chapternumber
666 Case else :Formatliste.Select 2 'Chapternumber
669 Warnlog "Unable to select field 'chapter'"
670 TabDokumentFeldbefehle.Close
675 TabDokumentFeldbefehle.Close
679 '/// Insert some text 'A new first paragraph' followed by a return
680 call wTypeKeys ( "A new first paragraph<RETURN>" )
682 '/// Insert an empty paragraph
683 call wTypeKeys ( "<RETURN>" )
685 '/// Insert some text 'A new third paragraph'
686 call wTypeKeys ( "A new third paragraph" )
690 call wTypeKeys ( "<MOD1 A>" )
691 '/// Set Style 'Heading 1'
692 Call wStyleSet ( sVorlage )
693 '/// Activate Numbering/Bullets via Objectbar
694 Call hToolbarSelect("BulletsAndNumbering", true)
695 '/// Create a numbering
696 Kontext "NumObjectbar"
697 if Not NumObjectbar.Exists then
698 Warnlog "Numbering/Bullets objectbar not accessible"
703 '/// Check if second paragraph is empty but numbered
706 Select Case gPlatGroup
708 sClipBrd() = Split (GetClipboardText, CHR$(10))
710 sClipBrd() = Split (GetClipboardText, CHR$(13) & CHR$(10))
716 if sClipBrd(0) <> "1A new first paragraph" then
717 Warnlog "First Heading not: '1A new first paragraph' but: " & sClipBrd(0)
720 if sClipBrd(1) <> "2" then
721 Warnlog "First paragraph not empty but: " & sClipBrd(1)
724 if sClipBrd(2) <> "3A new third paragraph" then
725 Warnlog "First paragraph not '3A new third paragraph' but: " & sClipBrd(2)