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: g_option.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-07-31 19:25:49 $
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 : update and resouce test for all option pages (at tools/options)
38 '\***********************************************************************
40 global sErrMes as String
41 global iSectionNumber as Integer
44 ' To prevent users from running just a subsection from this file, without THIS
45 ' subroutine, in every subsection the value of 'iSectionNumber' is checked.
46 ' The test will exit with warnlog, if iSectionNumber is 0
48 select case uCase(gApplication)
49 case "WRITER","MASTERDOCUMENT","HTML" : iSectionNumber = 8
50 case "IMPRESS","DRAW","MATH","CALC" : iSectionNumber = 7
52 ' common testcases are placed in this library
53 ' these tab-sets are always available:
54 Call tToolsOptionsStarOffice
55 Call tToolsOptionsLoadSave
56 Call tToolsOptionsLanguageSettings
57 Call tToolsOptionsDataSources
58 Call tToolsOptionsChart
59 Call tToolsOptionsInternet
60 Call tToolsOptionsImprovementProgram
63 '-------------------------------------------------------------------------
65 testcase tToolsOptionsStarOffice
67 dim EchteAnzahl as Integer, i as Integer
68 dim gefunden as Boolean, bSave as Boolean
69 dim iMenuShould as integer
70 '/// We have 12 tab pages in this category. If the <i>central configuration</i> feature is being used 13 (<i>Single SignOn</i>)
71 '/// <i>Tools</i> / <i>Options</i> / <i>OpenOffice.org</i>
72 PrintLog "- Tools/Options/StarOffice ( Extras/Optionen/StarOffice )"
73 if (0 = iSectionNumber) then
74 warnlog "You can't run this testcase seperated! Ending now! Please run it via: tToolsOptionsTest"
78 if ( gApplication = "BACKGROUND" ) then
79 ' Do not open any document
85 ToPosInOptionlist ( 1 )
86 Kontext "ExtrasOptionenDlg"
87 EchteAnzahl = Optionsliste.GetItemCount - iSectionNumber
90 if EchteAnzahl <> iMenuShould then
91 if ((gtplatform = "sol") OR (gtplatform = "x86") OR gOOO) AND EchteAnzahl = 12 then
92 printLog "One Tabpage is missing. This is ok for a patched Solaris (sparc and x86) or OOo installation."
94 Warnlog "The number of entries is not " + iMenuShould + "! => the current number is " + EchteAnzahl
100 if Active.Exists then Active.OK
102 if Active.Exists then Active.No
105 for i=1 to EchteAnzahl
107 Kontext "OptionenDlg"
108 Optionsliste.TypeKeys "<Down>"
111 Kontext "TabAllgemeines"
112 '///+<ul><li>User data</li>
113 printlog " - Userdata / Benutzerdaten"
114 if TabAllgemeines.IsVisible then
116 Call DialogTest ( TabAllgemeines )
119 Kontext "TabSonstigesAllgemein"
120 '///+<li>General</li>
121 printlog " - General / Allgemein"
122 if TabSonstigesAllgemein.IsVisible then
124 Call DialogTest ( TabSonstigesAllgemein )
129 printlog " - Memory / Arbeitsspeicher"
130 if TabMemory.IsVisible then
132 Call DialogTest ( TabMemory )
135 Kontext "TabAnsichtAllgemein"
137 printlog " - View / Ansicht"
138 if TabAnsichtAllgemein.IsVisible then
140 Call DialogTest ( TabAnsichtAllgemein )
143 Kontext "TabPrintStarOffice"
145 printlog " - Print / Drucken"
146 if TabPrintStarOffice.IsVisible then
148 Call DialogTest ( TabPrintStarOffice )
153 '///+ <ul><li>Click <i>edit</i> to all list entries and then close the file dialog</li></ul></li>
154 printlog " - Paths / Pfade"
155 if TabPfade.IsVisible then
157 Call DialogTest ( TabPfade )
158 Call DialogeFuerTypenKontrollieren
163 '///+<ul><li>Click on <i>Add</i></li>
164 '///+<li>Click <i>OK</i> on message box</li>
165 '///+<li>Click <i>cancel> on <i>Name</i> dialog</li>
166 '///+<li>Click on <i>Edit</i></li>
167 '///+<li>Click on <i>Close</i> in <i>Colors</i> dialog</li></ul></li>
168 printlog " - Color / Farben"
169 if ( TabFarben.exists( 4 ) ) then
170 if TabFarben.IsVisible then
172 Call DialogTest (TabFarben)
178 Call DialogTest (NameDlg)
188 Kontext "TabSchriftErsetzung"
189 '///+<li>Font replacement</li>
190 printlog " - Font Replacement / Schriftersetzung"
191 if TabSchriftErsetzung.IsVisible then
193 Call DialogTest ( TabSchriftErsetzung )
196 Kontext "TabSecurity"
197 '///+<li>Security</li>
198 printlog " - Security / Sicherheit"
199 if TabSecurity.IsVisible then
201 Call DialogTest ( TabSecurity )
202 MacroSecurity.click()
204 kontext "TabSecurityLevel"
205 if ( TabSecurityLevel.exists( 2 ) ) then
206 call DialogTest( TabSecurityLevel )
208 active.setpage TabTrustedSources
209 kontext "TabTrustedSources"
210 call DialogTest( TabTrustedSources )
211 TabTrustedSources.cancel
213 warnlog( "Macro Security Options dialog is missing" )
214 qaerrorlog( "#i45295# or office built without mozilla support" )
217 Kontext "TabSecurity"
218 if Protect.isEnabled then
220 Kontext "PasswordDLG"
221 call DialogTest( PasswordDLG )
224 select case uCase(gApplication)
225 case "WRITER","MASTERDOCUMENT"
226 WarnLog "Protect-Button is disabled."
227 case "MATH","IMPRESS","DRAW","HTML","CALC"
228 PrintLog "Protect-Button is disabled."
232 Kontext "TabSecurity"
233 if ( TabSecurity.exists( 1 ) ) then
235 Kontext "TabSecurityOptionsAndWarnings"
236 Call DialogTest(TabSecurityOptionsAndWarnings)
237 TabSecurityOptionsAndWarnings.cancel
239 warnlog( "Tabsecurity did not open" )
244 Kontext "TabAppearance"
245 '///+<li>Appearance</li>
246 printlog " - Appearance / Aussehen"
247 if TabAppearance.IsVisible then
249 Call DialogTest ( TabAppearance )
252 Kontext "TabAccessibility"
253 '///+<li>Accessibility</li>
254 printlog " - Accessibility"
255 if TabAccessibility.IsVisible then
257 Call DialogTest ( TabAccessibility )
261 '///+<li>Java</li></ul>
263 if TabJava.IsVisible then
265 Call DialogTest ( TabJava )
267 if useJava.isChecked then
270 if ( OeffnenDlg.exists( 1 ) ) then
273 warnlog( "OeffnenDlg is missing" )
277 Kontext "JavaStartParameter"
278 Call DialogTest ( JavaStartParameter )
279 JavaStartParameter.cancel
282 Kontext "JavaClassPath"
283 Call DialogTest ( JavaClassPath )
286 printlog "Use Java is disabled."
289 kontext "TabOnlineUpdate"
290 '///+<li>Online update</li>
291 printlog " - Online update"
292 if TabOnlineUpdate.isVisible then
294 Call DialogTest( TabOnlineUpdate )
298 Kontext "TabOOoImprovement"
299 printlog( " - OpenOffice.org Improvement Program" )
300 if ( TabOOoImprovement.isVisible() ) then
302 Call DialogTest( TabOOoImprovement )
305 if ( NOT gefunden ) then
306 Warnlog "Error with the " & i & ".page, perhaps this page has been deleted or changed its position"
307 EchteAnzahl = EchteAnzahl - 1
308 if EchteAnzahl < 13 then
315 '/// Close the options dialog
316 Kontext "OptionenDlg"
317 if ( OptionenDlg.exists( 1 ) ) then
320 warnlog( "Options Dialog not ready" )
322 '/// Close the document
323 if ( gApplication = "BACKGROUND" ) then
324 ' We should be on the backing window
326 Call hCloseDocument()
331 '-------------------------------------------------------------------------
333 testcase tToolsOptionsLoadSave
335 dim EchteAnzahl as Integer, i as Integer
336 dim gefunden as Boolean
337 PrintLog "- Tools/Options/Load Save ( Extras/Optionen/Laden Speichern )"
338 if (0 = iSectionNumber) then
339 warnlog "You can't run this testcase seperated! Ending now! Please run it via: tToolsOptionsTest"
342 if gApplication <> "BACKGROUND" then Call hNewDocument
343 '/// <i>Tools</i> / <i>Options</i> / <i>Load/Save</i>
345 ToPosInOptionlist (2)
346 EchteAnzahl = OptionTabPageZaehler (4, FALSE)
347 for i=1 to EchteAnzahl
349 Kontext "OptionenDlg"
350 Optionsliste.TypeKeys "<Down>"
353 Kontext "TabSpeichern"
354 '///+<ul><li>General</li>
355 printlog " - General / Save"
356 if TabSpeichern.IsVisible then
358 Call DialogTest ( TabSpeichern )
361 Kontext "TabMicrosoftOffice97"
362 '///+<li>VBA settings</li>
363 printlog " - VBA Settings / VBA Eigenschaften"
364 if TabMicrosoftOffice97.IsVisible then
366 Call DialogTest ( TabMicrosoftOffice97 )
369 Kontext "TabMicrosoftOffice2"
370 '///+<li>Microsoft Office</li>
371 printlog " - Microsoft Office"
372 if TabMicrosoftOffice2.IsVisible then
374 Call DialogTest ( TabMicrosoftOffice2 )
378 '///+<li>HTML Compatibility</li></ul>
379 printlog " - HTML Compatibility / HTML Kompatibilitaet"
380 if TabHTML.IsVisible then
382 Call DialogTest ( TabHTML )
385 if gefunden=FALSE then
386 Warnlog "Error with the " + i + ".page, perhaps this page is deleted or change the place!"
387 EchteAnzahl = EchteAnzahl - 1
388 if EchteAnzahl < 5 then
395 '/// Close the options dialog
396 Kontext "OptionenDlg"
398 '/// Close the document
399 if gApplication <> "BACKGROUND" then
404 '-------------------------------------------------------------------------
406 testcase tToolsOptionsLanguageSettings
408 dim EchteAnzahl as Integer, i as Integer, j as Integer
409 dim gefunden as Boolean
410 dim bAsianSup as Boolean
412 PrintLog "- Tools/Options/Language Settings ( Extras/Optionen/Spracheinstellungen )"
413 if (0 = iSectionNumber) then
414 warnlog "You can't run this testcase seperated! Ending now! Please run it via: tToolsOptionsTest"
417 if gApplication <> "BACKGROUND" then Call hNewDocument
418 '/// <i>Tools</i> / <i>Options</i> / <i>Language settings</i>
420 ToPosInOptionlist ( 3 )
421 EchteAnzahl = Optionsliste.GetItemCount - iSectionNumber
422 '/// We only have two tab pages in this section:
423 '///+ <ul><li><i>Languages</i> and <i>Writing Aids</i></li>
424 '///+<ol><li>In asian languages we have two additional tab pages:
425 '///+ <ul><li><i>Japanese Find</i> and <i>Asian Layout</i></li></ul></li>
426 '///+<li>In languages with CTL (<i>Complex Text Layout</i>) there is also one more:
427 '///+<ul><li><i>Complex Text Layout</i></li></ul></li></ol></li></ul>
428 select case (EchteAnzahl)
430 printlog "Asian or Complex Text Layout support is not activated (on languages-page)!"
432 printlog "Complex Text Layout support is activated (on languages-page)!"
434 printlog "Asian support is activated (on languages-page)!"
436 if (gAsianSup AND gCTLSup) then
437 printlog "Asian and Complex Text Layout support is activated (on languages-page)!"
439 Warnlog "There are more than 4 pages!"
442 Warnlog "There are more than 5 pages!"
446 if Active.Exists then Active.OK
448 if Active.Exists then Active.No
450 for i=1 to EchteAnzahl
452 Kontext "OptionenDlg"
453 Optionsliste.TypeKeys "<Down>"
456 Kontext "TabSprachen"
458 printlog " - Languages / Sprachen"
459 if TabSprachen.IsVisible then
461 Call DialogTest ( TabSprachen )
464 Kontext "TabLinguistik"
465 printlog " - Writing Aids / Linguistik"
466 if TabLinguistik.IsVisible then
468 Call DialogTest ( TabLinguistik )
469 '/// In <i>Writing aids</i>
470 '///+<ul><li> On <i>modules<i> click <i>edit</i></li>
471 SprachmoduleBearbeiten.Click
472 Kontext "ModuleBearbeiten"
473 Call DialogTest ( ModuleBearbeiten )
474 ModuleBearbeiten.Close
475 '///+<li> close dialog</li></ul>
476 Kontext "TabLinguistik"
477 '///+<ul><li>On <i>dictionaries</i> click <i>new</i></li>
478 '///+<li>close dialog</li></ul>
480 Kontext "BenutzerwoerterbuchAnlegen"
481 Call DialogTest ( BenutzerwoerterbuchAnlegen )
482 BenutzerwoerterbuchAnlegen.Cancel
484 '///+<ul><li>On <i>dictionaries</i> click <i>edit</i></li>
485 '///+<li>close dialog</li></ul>
486 Kontext "TabLinguistik"
488 if Bearbeiten.IsEnabled then
492 Benutzerwoerterbuch.TypeKeys "<Down>"
495 Kontext "BenutzerwoerterbuchBearbeiten"
496 if BenutzerwoerterbuchBearbeiten.Exists then
497 Call DialogTest ( BenutzerwoerterbuchBearbeiten )
498 BenutzerwoerterbuchBearbeiten.Close
500 warnlog "Edit the 'user-defined dictionary' is not possible => Bug?"
503 '///+<ul><li>On 9th, 10th and 11th entry click <i>edit</i></li>
504 '///+<li>close dialog</li></ul>
505 Kontext "TabLinguistik"
506 Optionen.TypeKeys "<PageUp>", 3
507 WaitSlot() ' similar effect as a NOOP
508 Optionen.TypeKeys "<Down>", 6
509 WaitSlot() ' similar effect as a NOOP
510 OptionenBearbeiten.Click
511 Kontext "SilbentrennungOptionen"
512 Call DialogTest ( SilbentrennungOptionen )
513 SilbentrennungOptionen.Cancel
514 Kontext "TabLinguistik"
515 Optionen.TypeKeys "<Down>"
516 OptionenBearbeiten.Click
517 Kontext "SilbentrennungOptionen"
518 Call DialogTest ( SilbentrennungOptionen )
519 SilbentrennungOptionen.Cancel
520 Kontext "TabLinguistik"
521 Optionen.TypeKeys "<Down>"
522 OptionenBearbeiten.Click
523 Kontext "SilbentrennungOptionen"
524 Call DialogTest ( SilbentrennungOptionen )
525 SilbentrennungOptionen.Cancel
529 Kontext "TabJapaneseFind"
531 if TabJapaneseFind.IsVisible then
532 printlog " - Japanese Find / Japanische Suche"
534 Call DialogTest ( TabJapaneseFind )
539 Kontext "TabComplexTextLayout"
541 if TabComplexTextLayout.IsVisible then
542 printlog " - Complex Text Layout"
544 Call DialogTest ( TabComplexTextLayout )
549 Kontext "TabAsianLayoutOptions"
551 printlog " - Asian Layout / Asiatisches Layout"
552 if TabAsianLayoutOptions.IsVisible then
554 Call DialogTest ( TabAsianLayoutOptions )
557 if gefunden=FALSE then
558 Warnlog "Error with the " + i + ".page, perhaps this page is deleted or change the place!"
559 EchteAnzahl = EchteAnzahl - 1
560 if EchteAnzahl < 5 then
567 '/// Close the options dialog
568 Kontext "OptionenDlg"
570 '/// Close the document
571 if gApplication <> "BACKGROUND" then
576 '-------------------------------------------------------------------------
578 testcase tToolsOptionsInternet
580 dim EchteAnzahl as Integer, i as Integer
581 dim gefunden as Boolean
583 PrintLog "- Tools/Options/Internet ( Extras/Optionen/Internet )"
584 if (0 = iSectionNumber) then
585 warnlog "You can't run this testcase seperated! Ending now! Please run it via: tToolsOptionsTest"
588 if gApplication <> "BACKGROUND" then Call hNewDocument
589 '/// <i>Tools</i> / <i>Options</i> / <i>Internet</i>
591 '/// (The last section in Tools / Options is <i>Internet</i>)
592 ToPosInOptionlist ( iSectionNumber)
594 if gPlatgroup = "w95" OR gPlatform = lcase("osx") then
595 '/// On MacOS X systems this section includes the tab pages:
596 '///+<ol><li>Proxy</li>
598 '///+<li>E-Mai</li></ol>
599 '/// On Win32 systems this section includes the tab pages:
600 '///+<ol><li>Proxy</li>
602 '///+<li>Mozilla Plugin</li></ol>
603 EchteAnzahl = OptionTabPageZaehler ( 3 , FALSE )
605 '/// On Unix systems this section includes four tab pages.
606 '///+<ol><li>Proxy</li>
609 '///+<li>Mozilla Plugin</li></ol>
610 EchteAnzahl = OptionTabPageZaehler ( 4 , FALSE )
613 for i=1 to EchteAnzahl
615 Kontext "OptionenDlg"
616 Optionsliste.TypeKeys "<Down>"
617 Kontext "ProxyWarnung"
618 if ProxyWarnung.Exists(1) then
619 NichtMehrAnzeigen.Check
625 Kontext "TabProxyServer"
627 printlog " - Proxy / Proxy"
628 if TabProxyServer.IsVisible then
630 Call DialogTest ( TabProxyServer )
635 printlog " - Search / Suche"
636 if Active.Exists then
637 sErrMes = Active.GetText
638 Warnlog "A messagebox exists => BUG : " + sErrMes
642 if TabSuche.IsVisible then
644 Call DialogTest ( TabSuche )
647 if gPlatgroup = "unx" then
651 if TabEmail.IsVisible then
653 Call DialogTest ( TabEmail )
656 if gPlatgroup = "w95" then
657 Kontext "TabMozillaPlugin"
658 'Mozilla Plug-in (On Win32)
659 printlog " - Mozilla Plug-in"
660 if TabMozillaPlugin.IsVisible then
662 Call DialogTest ( TabMozillaPlugin )
666 if gPlatgroup = "w95" then
667 warnlog "On Win32 platform there should be only 3 tab pages in section 'Internet'!?"
669 Kontext "TabMozillaPlugin"
670 printlog " - Mozilla Plug-in"
671 if TabMozillaPlugin.IsVisible then
673 Call DialogTest ( TabMozillaPlugin )
677 if gefunden=FALSE then
678 Warnlog "Error with the " + i + ".page, perhaps this page is deleted or change the place!"
679 EchteAnzahl = EchteAnzahl - 1
680 if EchteAnzahl < 4 then
687 '/// Close the options dialog
688 Kontext "OptionenDlg"
691 if gApplication <> "BACKGROUND" then
696 '-------------------------------------------------------------------------
698 testcase tToolsOptionsImprovementProgram
700 printlog( "Update test for the tools/options dialog of the OOo Improvement Program" )
702 dim cLogFile as string
703 cLogFile = gOfficePath & "user\temp\feedback\Current.csv"
704 cLogFile = convertpath( cLogFile )
706 if ( hDeleteFile( cLogFile ) ) then
708 printlog( "Test environment is clean, no logfile present (anymore)" )
711 hToolsOptions( "StarOffice", "Improvement" )
712 printlog( "Improvement Program tabpage" )
714 call DialogTest( TabOOoImprovement )
716 ParticipateNo.check()
717 ParticipateYes.check()
719 if ( ShowData.isEnabled() ) then
723 Kontext "FilterAuswahl"
724 if ( FilterAuswahl.exists( 1 ) ) then
725 printlog( "Text import dialog/FilterAuswahl" )
727 call DialogTest( FilterAuswahl )
728 FilterAuswahl.cancel()
730 qaerrorlog( "#i97340# Show Data button enabled but no logged data found" )
734 if ( Active.exists( 1 ) ) then
735 printlog( "Messagebox: " & Active.getText() )
738 warnlog( "No warning for missing file: " & cLogFile )
742 if ( Active.exists( 1 ) ) then
743 warnlog( "#97342# Second message for missing " & cLogFile )
747 printlog( "Show data is disabled" )
750 Kontext "OptionenDlg"
754 ' hDeleteFile() returns FALSE if the file is still present for some weird reason
755 ' We should warn about this because the test breaks at a later point then.
756 warnlog( "Logfile present, it could not be deleted. Please check path and accessrights" )
757 printlog( "Path: " & cLogFile )
762 '-------------------------------------------------------------------------
764 testcase tToolsOptionsChart
765 Dim EchteAnzahl as Integer, i as Integer
767 PrintLog "- Tools/Options/Chart ( Extras/Optionen/Diagramme )"
768 if (0 = iSectionNumber) then
769 warnlog "You can't run this testcase seperated! Ending now! Please run it via: tToolsOptionsTest"
772 '/// Create a new document
773 if gApplication <> "BACKGROUND" then
776 '/// <i>Tools</i> / <i>Options</i> / <i>Chart</i>
778 ToPosInOptionlist ( iSectionNumber -1 )
779 EchteAnzahl = OptionTabPageZaehler ( 1, FALSE )
780 Kontext "OptionenDlg"
781 Optionsliste.TypeKeys "<Down>"
783 printlog " - Default Colors / Grundfarben"
784 Kontext "TabGrundfarben"
785 Call DialogTest ( TabGrundfarben )
786 '/// Close the options dialog
787 Kontext "OptionenDlg"
789 if gApplication <> "BACKGROUND" then
790 '/// Close bthe document
795 '-------------------------------------------------------------------------
797 testcase tToolsOptionsDataSources
798 qaerrorlog "#i104508# crashes on quit or reload if this is run."
801 Dim EchteAnzahl as Integer, i as Integer
803 PrintLog "- Tools/Options/Data Sources ( Extras/Optionen/Datenbank )"
804 if (0 = iSectionNumber) then
805 warnlog "You can't run this testcase seperated! Ending now! Please run it via: tToolsOptionsTest"
808 '/// Create a new document
809 if gApplication <> "BACKGROUND" then
812 '/// <i>Tools</i> / <i>Options</i> / <i>Data source</i>
814 ToPosInOptionlist ( iSectionNumber -2)
815 EchteAnzahl = OptionTabPageZaehler ( 2 , FALSE )
816 Kontext "OptionenDlg"
817 Optionsliste.TypeKeys "<Down>"
818 printlog " - Connections / Verbindungen"
819 Kontext "TabConnections"
821 Call DialogTest ( TabConnections )
822 Kontext "OptionenDlg"
823 Optionsliste.TypeKeys "<Down>"
824 printlog " - Databases / Datenbanken"
825 Kontext "TabRegisteredDatabase"
827 Call DialogTest ( TabRegisteredDatabase )
829 Kontext "CreateDatabaseLink"
830 call DialogTest( CreateDatabaseLink )
834 Kontext "CreateDatabaseLink"
835 CreateDatabaseLink.cancel
836 Kontext "OptionenDlg"
837 '/// Close the options dialog
839 '/// Close the document
840 if gApplication <> "BACKGROUND" then