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: options_so_4.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $
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 : thorsten.bosbach@sun.com
36 '* short description : options test (General/Memory/View)
38 '\******************************************************************************
40 testcase func_StarOfficeGeneral_1
41 gApplication = "WRITER"
43 Dim ClipText as String
45 '///StarOffice / General => 'Years ( two digits )' - functionality test
48 printlog " - years two digits => 1899"
49 '///+open tools/option/StarOffice/general
50 '///+save the default settings
52 hToolsOptions ( "StarOffice", "General" )
53 sSave = Zweistellig.GetText
54 '///+insert 1899 in 'Interpret as years between' and click OK for the options dialog
55 Zweistellig.SetText "1899"
56 Kontext "ExtrasOptionenDlg"
60 '///+open a calc-doc and insert 04.03.00 <Return>
63 DocumentCalc.TypeKeys "04.03.00<return>"
64 DocumentCalc.TypeKeys "<up>"
65 DocumentCalc.TypeKeys "<F2><Home><Shift End>"
68 DocumentCalc.TypeKeys "<Escape>"
69 '///+select the cell and press F2 => now the correct date in the cell must be 04/03/1900
71 ClipText = GetClipboardText
72 if ClipText <> "04.03.1900" AND ClipText <> "04/03/1900" then Warnlog "Wrong date not 04.03.1900 or 04/03/1900 : => '" + ClipText + "'"
74 '///+close the calc doc
77 printlog " - years two digits => 2050"
78 '///open tools/option/StarOffice/general
80 hToolsOptions ( "StarOffice", "General" )
81 '///+insert 2050 in 'Interpret as years between' and click OK for the options dialog
82 Zweistellig.SetText "2050"
83 Kontext "ExtrasOptionenDlg"
87 '///+open a calc-doc and insert 04.03.00 <Return>
90 DocumentCalc.TypeKeys "05.03.68<return>"
91 DocumentCalc.TypeKeys "<up>"
92 DocumentCalc.TypeKeys "<F2><Home><Shift End>"
95 DocumentCalc.TypeKeys "<Escape>"
97 '///+select the cell and press F2 => now the correct date in the cell must be 04/03/1900
98 ClipText = GetClipboardText
99 if ClipText <> "05.03.2068" AND ClipText <> "05/03/2068" then Warnlog "Wrong date not 05.03.2068 or 05/03/2068 : => '" + ClipText + "'"
101 '///+close the calc doc
104 '///open tools/option/StarOffice/general and reset all to the default data ( 1930 )
105 printlog " - reset to default"
107 hToolsOptions ( "StarOffice", "General" )
108 Zweistellig.SetText sSave
109 Kontext "ExtrasOptionenDlg"
113 gApplication = "WRITER"
116 ' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
117 ' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
118 testcase func_StarOfficeGeneral_2
121 Dim i as Integer, iTime as Integer
123 gApplication = "WRITER"
125 '///StarOffice / General => 'Help Agent'
126 '///check the maximum and the minimum of display duration ( 60sec and 5sec )
127 '///+save the data for help agent
128 '///+tools / options / staroffice / general -> help agent
129 printlog "tools / options / staroffice / general -> help agent"
130 printlog "- check the minimum and the maximum of display duration for help agent ( 60sec and 5sec )"
131 printlog " activate the help agent options-dialog -> OK"
133 hToolsOptions ( "StarOffice", "General" )
134 bSave = Aktivieren.IsChecked
136 Kontext "ExtrasOptionenDlg"
140 '///working with activated HelpAgent
141 '///+open a new writer-doc
142 printlog "- working with activated HelpAgent"
143 printlog " - check display duration of 10sec"
144 printlog " new writer-doc"
145 gApplication = "WRITER"
148 '///+tools / options / staroffice / general -> help agent
149 '///+activate the help agent for 10 seconds ( click reset to delete the ignore-list for helpagent )
150 printlog " tools / options / staroffice / general -> help agent -> duration to 10 -> "
151 printlog " click also reset to delete the ignore-list for help-agent -> options-dialog OK"
153 hToolsOptions ( "StarOffice", "General" )
155 Kontext "ExtrasOptionenDlg"
159 '///+open Format/Character - Font-Tabpage => help-agent must be activated ( 10seconds )
160 '///+check if agent closed after ~10sec
161 printlog " Format/Character - Font-Tabpage => help-agent must be activated"
162 printlog " check if agent closed after ~10sec"
165 active.SetPage TabFont
168 if HelpAgent.Exists(1) <> TRUE then
169 Warnlog "The help agent wasn't activated for autocorrection!"
172 if HelpAgent.Exists then
179 if iTime < 9 then Warnlog "The help agent is closed faster than 9 seconds!"
180 if iTime > 12 then Warnlog "The help agent isn't closed after 12 seconds!"
181 if HelpAgent.Exists then
182 Warnlog "The help agent isn't closed after 20 seconds, the test close it!"
189 '///+close the options-dialog and close the writer-doc
190 printlog " close options-dialog and close the writer-doc"
193 '///check display duration of 40sec
195 '///+tools / options / staroffice / general -> help agent
196 '///+activate the help agent for 40 seconds
197 printlog " - check another display duration of 40sec"
198 printlog " new writer-doc"
200 printlog " tools / options / staroffice / general -> help agent -> duration to 40 -> options-dialog OK"
202 hToolsOptions ( "StarOffice", "General" )
204 Kontext "ExtrasOptionenDlg"
207 '///+open Format/Character - Font-Tabpage => help-agent must be activated ( 40seconds )
208 '///+check if agent closed after ~40sec
209 printlog " Format/Character - Font-Tabpage => help-agent must be activated"
210 printlog " check if agent closed after ~40sec"
213 active.SetPage TabFont
216 if HelpAgent.Exists(1) <> TRUE then
217 Warnlog "The help agent wasn't activated for autocorrection!"
220 if HelpAgent.Exists then
227 if iTime < 35 then Warnlog "The help agent is closed faster than 35 seconds!"
228 if iTime > 45 then Warnlog "The help agent isn't closed after 45 seconds!"
229 if HelpAgent.Exists then
230 Warnlog "The help agent isn't closed after 40 seconds, the test close it!"
237 '///+close the options-dialog and close the writer-doc
238 printlog " close options-dialog and close the writer-doc"
241 '///check another display duration of 60sec
243 '///+tools / options / staroffice / general -> help agent
244 '///+activate the help agent for 60 seconds
245 printlog " - check another display duration of 60sec"
246 printlog " new writer-doc"
248 printlog " tools / options / staroffice / general -> help agent -> duration to 60 -> options-dialog OK"
250 hToolsOptions ( "StarOffice", "General" )
252 Kontext "ExtrasOptionenDlg"
255 '///+open Format/Character - Font-Tabpage => help-agent must be activated ( 60seconds )
256 '///+check if agent closed after ~60sec
257 printlog " Format/Character - Font-Tabpage => help-agent must be activated"
260 active.SetPage TabFont
263 if HelpAgent.Exists(1) <> TRUE then
264 Warnlog "The help agent wasn't activated for autocorrection!"
267 if HelpAgent.Exists then
274 if iTime < 55 then Warnlog "The help agent is closed faster than 55 seconds!"
275 if iTime > 65 then Warnlog "The help agent isn't closed after 65 seconds!"
276 if HelpAgent.Exists then
277 Warnlog "The help agent isn't closed after 60 seconds, the test close it!"
285 '///+close the options-dialog and close the writer-doc
286 printlog " close options-dialog and close the writer-doc"
289 '///check if the help agent isn't active, when you ignore it 3 times ( inserted in the ignore-list )
291 '///+tools / options / staroffice / general -> help agent
292 '///+activate the help agent for 10 seconds
293 printlog " - check if the help agent isn't active, when you ignore it 3 times ( inserted in the ignore-list )"
294 printlog " new writer-doc"
296 printlog " tools / options / staroffice / general -> help agent -> duration to 10 -> options-dialog OK"
298 hToolsOptions ( "StarOffice", "General" )
300 Kontext "ExtrasOptionenDlg"
303 '///+open Format/Character - Font-Tabpage => help-agent should not be activated
304 printlog " Format/Character - Font-Tabpage => help-agent should not be activated"
307 active.SetPage TabFont
310 if HelpAgent.Exists then
311 Warnlog "Ignore HelpAgent 3 time for the same slot does not work, HelpAgent is active!"
317 '///+close the options-dialog and close the writer-doc
318 printlog " close options-dialog and close the writer-doc"
321 '///check if ignore-list can be deleted
323 '///+tools / options / staroffice / general -> help agent
324 '///+activate the help agent for 10 seconds and reset the ignore-list
325 printlog " - check if ignore-list can be deleted"
326 printlog " new writer-doc"
328 printlog " tools / options / staroffice / general -> help agent -> click on reset -> options-dialog OK"
330 hToolsOptions ( "StarOffice", "General" )
333 Kontext "ExtrasOptionenDlg"
336 '///+open Format/Character - Font-Tabpage => help-agent should not be activated
337 printlog " Format/Character - Font-Tabpage => help-agent should not be activated"
340 active.SetPage TabFont
343 if HelpAgent.Exists(2) <> TRUE then
344 Warnlog "Ignore-list isn't reset, the HelpAgent is not active"
351 '///+close the options-dialog and close the writer-doc
352 printlog " close options-dialog and close the writer-doc"
355 '///working with deactivated HelpAgent
356 '///+create a new writer-doc
357 '///+tools / options / staroffice / general -> help agent
358 '///+deactivate the help agent
359 printlog " - working with deactivated the help agent"
360 printlog " new writer-doc"
362 printlog " tools / options / staroffice / general -> deactivate help agent -> options-dialog OK"
364 hToolsOptions ( "StarOffice", "General" )
366 Kontext "ExtrasOptionenDlg"
370 '///+open Format/Character - Font-Tabpage => help-agent ust be activated ( 10seconds )
371 printlog " Format/Character - Font-Tabpage => help-agent ust be activated"
374 active.SetPage TabFont
377 if HelpAgent.Exists(1) = TRUE then
378 Warnlog "The help agent was active!"
384 '///+close the options-dialog and close the writer-doc
385 printlog " close options-dialog and close the writer-doc"
388 '///reset help-agent-options
389 printlog " - reset help-agent-options"
391 hToolsOptions ( "StarOffice", "General" )
394 if bSave = TRUE then Aktivieren.Check else Aktivieren.UnCheck
396 Kontext "ExtrasOptionenDlg"
401 ' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
402 ' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
403 testcase func_StarOfficeGeneral_3
404 Dim bStatus as Boolean
406 gApplication = "WRITER"
408 '///StarOffice / General => 'printing sets 'document modified' status'
409 '///+open a new writer-doc and save it
411 printlog "StarOffice / General => 'printing sets 'document modified' status'"
412 printlog "save a writer-doc"
414 Kontext "DocumentWriter"
415 DocumentWriter.TypeKeys "This is a file, for options test: <return> Tools / Options / StarOffice / General -> 'Printing sets 'document modified' status'"
416 DocumentWriter.TypeKeys "<Return><Return>This file is created by an automated test. It can be trashed after one day!<Return>Today is " + Date
417 hFileSaveAsKill ( gOfficePath + "user\work\opt.sxw" )
419 printlog "- open tools/option/StarOffice/general and save the state of the checkbox"
420 printlog "- check it"
421 '///+ open tools/option/StarOffice/general
422 '///+'printing sets 'document modified' status' => checked
424 hToolsOptions ( "StarOffice", "General" )
425 bStatus = DruckenStatus.IsChecked
427 Kontext "ExtrasOptionenDlg"
430 '///+ close options dialog with OK
432 printlog "- file/print and click OK at the print-dialog"
433 '///+file / print and click OK at the print-dialog
437 if Active.Exists() then
438 warnlog( "Unexpected dialog, no default printer found (#108776?)" )
446 printlog "- file/close"
447 '///+file / close => a messagebox must warn about changes in the document
450 if Active.Exists(2) <> TRUE then
451 Warnlog "No warning, when this options is checked!"
453 '///+- cancel the messagebox
457 printlog "- file/save"
461 printlog "- uncheck the checkbox"
462 '///'printing sets 'document modified' status' => unchecked
464 hToolsOptions ( "StarOffice", "General" )
465 DruckenStatus.UnCheck
466 Kontext "ExtrasOptionenDlg"
470 printlog "- file/print"
477 printlog "- file/close"
478 '///+file / close => no modify of the document => no messagebox for warning
481 if Active.Exists(2) then
482 Warnlog "The document is modified, a messagebox came up at closing"
486 printlog "- reset this option"
487 '///set this option to default
489 hToolsOptions ( "StarOffice", "General" )
490 if bStatus = TRUE then DruckenStatus.Check else DruckenStatus.UnCheck
491 Kontext "ExtrasOptionenDlg"
497 ' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
498 ' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
499 testcase func_StarOfficeGeneral_4
500 Dim bStatus as Boolean
502 gApplication = "WRITER"
504 '///StarOffice / General => 'use StarOffice dialogs' ( only on windows systems )
506 '///check that system dialogs are used => state of the checkbox is unchecked
507 '///+open a new writer-doc
509 printlog "StarOffice / General => 'use StarOffice dialogs'"
510 if gPlatgroup = "unx" then
511 printlog "This feature is only available on windows systems"
513 '///+open tools/options/staroffice/general
514 printlog "- open tools/options/staroffice/general and uncheck 'use StarOffice dialogs'"
516 hToolsOptions ( "StarOffice", "General" )
517 '///+save state of 'use StarOffice dialogs' and uncheck it
518 bStatus = StarOfficeDialogeBenutzen.IsChecked
519 StarOfficeDialogeBenutzen.UnCheck
520 Kontext "ExtrasOptionenDlg"
524 '///+file/open and check if the file-dialog is a system-dialog
525 printlog "- file/open and check if the file-dialog is a system-dialog"
527 if ExistsSysDialog ( FilePicker ) = FALSE then
528 Warnlog "The file-open-dialog is no system dialog"
532 CloseSysDialog ( FilePicker )
535 '///check that StarOffice dialogs are used => state of the checkbox is checked
536 '///+open tools/options/staroffice/general
537 printlog Chr(13) + "check that StarOffice dialogs are used => state of the checkbox is checked"
538 printlog "- open tools/options/staroffice/general"
540 hToolsOptions ( "StarOffice", "General" )
541 '///+save state of 'use StarOffice dialogs' and uncheck it
542 StarOfficeDialogeBenutzen.Check
543 Kontext "ExtrasOptionenDlg"
547 '///+file/open and check if the file-dialog is a StarOffice-dialog
548 printlog "- open tools/options/staroffice/general and check 'use StarOffice dialogs'"
551 if OeffnenDlg.Exists (1) <> TRUE then
552 Warnlog "StarOffice dialogs are not used!"
553 if ExistsSysDialog ( FilePicker ) then CloseSysDialog ( FilePicker )
558 '///reset the state of 'use StarOffice dialogs' to default
559 '///+open tools/options/staroffice/general
560 printlog Chr(13) + "reset the state of 'use StarOffice dialogs' to default"
562 hToolsOptions ( "StarOffice", "General" )
563 '///+save state of 'use StarOffice dialogs' and uncheck it
564 if bStatus = TRUE then StarOfficeDialogeBenutzen.Check else StarOfficeDialogeBenutzen.UnCheck
565 Kontext "ExtrasOptionenDlg"
575 ' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
576 ' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
577 testcase func_StarOfficeMemory_1
579 Dim i, ilast as Integer
580 gApplication = "WRITER"
582 '///StarOffice / Memory => 'Undo steps'
586 printlog " - set number of steps => 1"
588 '///<b>undo-step = 1</b>
589 '///+open a new writer-doc and tools/options/staroffice/memory
592 hToolsOptions ( "StarOffice", "Memory" )
593 '///+save the default setting for 'Undo Steps' and set it to 1
594 sSave = UndoSteps.GetText
595 UndoSteps.SetText "1"
596 '///+click OK for the options dialog
597 Kontext "ExtrasOptionenDlg"
601 '///+write two words in the writer doc
602 Kontext "DocumentWriter"
603 DocumentWriter.TypeKeys "Hello "
604 DocumentWriter.TypeKeys "friends "
606 '///+try edit/undo more than 1 times, after the first click the menu-item must be inactiv and the undo-button in the function bar too
610 Warnlog "More than 1 undo was possible!"
614 '///<b>undo-step = 15</b>
615 '///+open tools/options/staroffice/memory
616 printlog " - set number of steps => 15"
618 hToolsOptions ( "StarOffice", "Memory" )
619 '///+set 'Undo Steps' to 15
620 UndoSteps.SetText "15"
621 '///+click OK for the options dialog
622 Kontext "ExtrasOptionenDlg"
626 '///+write a short text with more than 20 words
627 Kontext "DocumentWriter"
629 DocumentWriter.TypeKeys "Hello<return>"
633 '///+check if you can use 'edit/undo' more than 15 times
640 Warnlog "The 15th undo was impossible! The test can do only " + iLast + " undos! => BugID 83891"
645 Warnlog "More than 15 undo was possible!"
651 '///<b>undo-step = 99</b>
652 '///+open tools/options/staroffice/memory
653 printlog " - set number of steps => 99"
655 hToolsOptions ( "StarOffice", "Memory" )
656 '///+set 'Undo Steps' to 99
657 UndoSteps.SetText "99"
658 Kontext "ExtrasOptionenDlg"
662 '///+write a short text with more than 100 words
663 Kontext "DocumentWriter"
665 DocumentWriter.TypeKeys "Hello<return>"
668 '///+check if you can use 'edit/undo' more than 99 times
675 Warnlog "The 99th undo was impossible! The test can do only " + iLast + " undos! => BugID 83891"
681 Warnlog "More than 99 undo are possible!"
688 '///close the document
691 '///set this option to default
692 printlog " - reset the number of steps"
694 hToolsOptions ( "StarOffice", "Memory" )
695 UndoSteps.SetText sSave
696 Kontext "ExtrasOptionenDlg"
702 ' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
703 ' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
704 testcase func_StarOfficeView_1
709 '///StarOffice / View => 'Display : Look & Feel' and 'Scaling'
711 '///+open tools/options/staroffice/view
713 hToolsOptions ( "StarOffice", "View" )
715 printlog " - display"
717 printlog " - scaling"
718 '///+save the default setting for scaling
719 sSave = FontScale.GetText
720 '///+set Scaling to 50
721 FontScale.SetText "50"
724 printlog " - " + FontScale.GetText
725 '///+click OK for the options dialog
726 Kontext "ExtrasOptionenDlg"
730 '///+open some dialogs/tab dialogs and flyer to have a look at it ( testtool only can test, if this feature doesn't crash )
731 Call DialogTestForViewOptions
733 '///+open tools/options/staroffice/view
735 hToolsOptions ( "StarOffice", "View" )
736 '///+set Scaling to 150
737 FontScale.SetText "150"
740 printlog " - " + FontScale.GetText
741 '///+click OK for the options dialog
742 Kontext "ExtrasOptionenDlg"
746 '///+open some dialogs/tab dialogs and flyer to have a look at it ( testtool only can test, if this feature doesn't crash )
747 Call DialogTestForViewOptions
749 '///+open tools/options/staroffice/view
751 hToolsOptions ( "StarOffice", "View" )
752 '///+set Scaling to default setting
753 FontScale.SetText(sSave)
756 printlog " - " + FontScale.GetText
757 '///+click OK for the options dialog
758 Kontext "ExtrasOptionenDlg"
764 ' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
765 ' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
766 testcase func_StarOfficeView_2
770 printlog " - mouse positioning"
772 '///StarOffice / View => 'mouse positioning'
773 '///+open a new writer doc
776 '///+open tools/options/staroffice/view
778 hToolsOptions ( "StarOffice", "View" )
779 '///+save the default setting for 'mouse positioning'
780 iSave = MousePositioning.GetSelIndex
781 '///+select the 1st entry for 'mouse positioning'
782 MousePositioning.Select 1
783 printlog " - " + MousePositioning.GetSelText
784 '///+click OK for the options dialog
785 Kontext "ExtrasOptionenDlg"
789 '///+move the mouse to position 1,1 on the writer doc
790 Kontext "DocumentWriter"
791 DocumentWriter.MouseMove 1, 1
793 '///+open some dialogs/tab dialogs and flyer to have a look at the mouse position ( testtool only can test, if this feature doesn't crash )
794 DialogTestForViewOptions
796 '///+open tools/options/staroffice/view
798 hToolsOptions ( "StarOffice", "View" )
799 '///+select the 2nd entry for 'mouse positioning'
800 MousePositioning.Select 2
801 printlog " - " + MousePositioning.GetSelText
802 '///+click OK for the options dialog
803 Kontext "ExtrasOptionenDlg"
807 '///+move the mouse to position 1,1 on the writer doc
808 Kontext "DocumentWriter"
809 DocumentWriter.MouseMove 1, 1
811 '///+open some dialogs/tab dialogs and flyer to have a look at the mouse position ( testtool only can test, if this feature doesn't crash )
812 DialogTestForViewOptions
814 '///+open tools/options/staroffice/view
816 hToolsOptions ( "StarOffice", "View" )
817 '///+select the 3rd entry for 'mouse positioning'
818 MousePositioning.Select 3
819 printlog " - " + MousePositioning.GetSelText
820 '///+click OK for the options dialog
821 Kontext "ExtrasOptionenDlg"
825 '///+move the mouse to position 1,1 on the writer doc
826 Kontext "DocumentWriter"
827 DocumentWriter.MouseMove 1, 1
829 '///+open some dialogs/tab dialogs and flyer to have a look at the mouse position ( testtool only can test, if this feature doesn't crash )
830 DialogTestForViewOptions
832 '///+open tools/options/staroffice/view
834 hToolsOptions ( "StarOffice", "View" )
835 '///+select the default setting for 'mouse positioning'
836 MousePositioning.Select iSave
837 '///+click OK for the options dialog
838 Kontext "ExtrasOptionenDlg"
842 '///+close the writer doc