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
43 sub tToolsOptionsTestFirst
44 dim sPreviousApplication as string
46 sPreviousApplication = gApplication
48 ' To prevent users from running just a subsection from this file, without THIS
49 ' subroutine, in every subsection the value of 'iSectionNumber' is checked.
50 ' The test will exit with warnlog, if iSectionNumber is 0
52 select case gApplication
53 case "WRITER","MASTERDOCUMENT","HTML" : iSectionNumber = 8
54 case "IMPRESS","DRAW","MATH","CALC" : iSectionNumber = 7
57 ' these tabpages only exist in the respective application
58 gApplication = "WRITER"
60 Call tToolsOptionsTextDocument
64 Call tToolsOptionsHTMLDocument
68 Call tToolsOptionsSpreadsheet
70 gApplication = "IMPRESS"
72 Call tToolsOptionsPresentation
76 Call tToolsOptionsDrawing
80 Call tToolsOptionsFormula
82 gApplication = sPreviousApplication
85 '-------------------------------------------------------------------------
87 testcase tToolsOptionsTextdocument
88 dim EchteAnzahl as Integer, i as Integer
89 dim gefunden as Boolean
91 PrintLog "- Tools/Options/Text document ( Extras/Optionen/Textdokument )"
92 if (0 = iSectionNumber) then
93 warnlog "You can't run this testcase seperated! Ending now! Please run it via: tToolsOptionsTest"
96 '/// Create a new document
97 if gApplication <> "BACKGROUND" then
100 '/// <i>Tools</i> / <i>Options</i> / <i>Text document</i>
103 if Active.Exists (3) then
104 if Active.GetText <> sErrMes then Warnlog "A messagebox exists => BUG : " + Active.GetText
107 ToPosInOptionlist ( 4 )
108 EchteAnzahl = Optionsliste.GetItemCount - iSectionNumber
109 if EchteAnzahl = 10 AND ( gAsianSup = TRUE OR gCTLSup = TRUE ) then
110 Warnlog "There are only 10 pages in 'text document'-section, but asian support or CTL support are activated! => a section is missing?"
112 printlog "Asian support and CTL support are not activated ( on languages-page )!"
114 if bDebugVersion = TRUE then EchteAnzahl = EchteAnzahl - 1
115 if gAsianSup = FALSE then EchteAnzahl = EchteAnzahl + 1
116 if gCTLSup = FALSE then EchteAnzahl = EchteAnzahl + 1
117 for i=1 to EchteAnzahl
119 Kontext "OptionenDlg"
120 Optionsliste.TypeKeys "<Down>"
121 if gAsianSup = FALSE AND gCTLSup = FALSE AND i=6 then i=i+2
122 if gAsianSup = FALSE AND gCTLSup = TRUE AND i=6 then i=i+1
123 if gAsianSup = TRUE AND gCTLSup = FALSE AND i=7 then i=i+1
125 case 1 : Kontext "TabLaden"
126 '///+<ul><li>General</li>
127 printlog " - General / Allgemein"
128 if TabLaden.IsVisible then
130 Call DialogTest ( TabLaden )
132 case 2 : Kontext "TabInhalteWriter"
134 printlog " - View / Ansicht"
135 if TabInhalteWriter.IsVisible then
137 Call DialogTest ( TabInhalteWriter )
139 case 3 : Kontext "TabDirektCursor"
140 '///+<li>Formating aids</li>
141 printlog " - Formating aids / Formatierungshilfen"
142 if TabDirektCursor.IsVisible then
144 Call DialogTest ( TabDirektCursor )
146 case 4 : Kontext "TabRaster"
148 printlog " - Grid / Raster"
149 if TabRaster.IsVisible then
151 Call DialogTest ( TabRaster )
153 case 5 : Kontext "TabGrundschriften"
154 '///+<li>Default fonts</li>
155 printlog " - Default Fonts / Grundschriften"
156 if TabGrundschriften.IsVisible then
158 Call DialogTest ( TabGrundschriften )
160 case 6 : Kontext "TabGrundschriftenAsian"
161 '///+<li>Default fonts asian</li>
162 printlog " - Default Fonts Asian / Grundschriften Asiatisch"
163 if TabGrundschriftenAsian.IsVisible then
165 Call DialogTest ( TabGrundschriftenAsian )
167 case 7 : Kontext "TabGrundschriftenCTL"
168 '///+<li>Default fonts CTL</li>
169 printlog " - Default Fonts CTL / Grundschriften CTL"
170 if TabGrundschriftenCTL.IsVisible then
172 Call DialogTest ( TabGrundschriftenCTL )
174 case 8 : Kontext "TabDruckenWriter"
176 printlog " - Print / Drucken"
177 if TabDruckenWriter.IsVisible then
179 Call DialogTest ( TabDruckenWriter )
181 case 9 : Kontext "TabTabelleOptionen"
183 printlog " - Table / Tabellen"
184 if TabTabelleOptionen.IsVisible then
186 Call DialogTest ( TabTabelleOptionen )
188 case 10: Kontext "TabAenderungenWriter"
189 '///+<li>Changes</li>
190 printlog " - Changes / Aenderungen"
191 if TabAenderungenWriter.IsVisible then
193 Call DialogTest ( TabAenderungenWriter )
195 case 11: Kontext "TabCompatibility"
196 '///+<li>Compatibility</li>
197 printlog " - Compatibility"
198 if TabCompatibility.IsVisible then
200 Call DialogTest ( TabCompatibility )
202 case 12: Kontext "TabAutoCaption"
203 '///+<li>AutoCaption</li>
204 printlog " - AutoCaption"
205 if TabAutoCaption.IsVisible then
207 Call DialogTest ( TabAutoCaption )
209 case 13: Kontext "TabMailMergeEMail"
210 '///+<li>Mail Merge E-mail</li></ul>
211 printlog " - Mail Merge E-mail"
212 if TabMailMergeEMail.IsVisible then
214 Call DialogTest ( TabMailMergeEMail )
215 ServerAuthentication.click
216 kontext "ServerAuthentication"
217 Call DialogTest ( ServerAuthentication )
218 ServerAuthentication.cancel
219 Kontext "TabMailMergeEMail"
222 ' in case java is not enabled
226 if ( MessageBox.exists()) then
228 warnlog(Messagebox.GetText())
233 Messagebox.OK() ' if "OK" works, we are in an undefined state
238 warnlog( "A messagebox was displayed but coul not be closed." )
241 Kontext "TestaccountSettings"
242 Call DialogTest ( TestaccountSettings )
243 TestaccountSettings.cancel
246 if gefunden=FALSE then
247 Warnlog "Error with the " + i + ".page, perhaps this page is deleted or change the place!"
248 EchteAnzahl = EchteAnzahl - 1
249 if EchteAnzahl < 12 then
256 '/// Close the options dialog
257 Kontext "OptionenDlg"
259 '/// Close the document
260 if gApplication <> "BACKGROUND" then
265 '-------------------------------------------------------------------------
267 testcase tToolsOptionsHTMLDocument
268 dim EchteAnzahl as Integer, i as Integer
269 dim gefunden as Boolean
271 PrintLog "- Tools/Options/HTML-Document ( Extras/Optionen/HTML-Dokument )"
272 if (0 = iSectionNumber) then
273 warnlog "You can't run this testcase seperated! Ending now! Please run it via: tToolsOptionsTest"
276 '/// Create a new document
277 if gApplication <> "BACKGROUND" then
280 '/// <i>Tools</i> / <i>options</i> / <i>HTML Document</i>
282 ToPosInOptionlist ( 5 )
284 if bDebugVersion = TRUE then i = i + 1 ' here exists the special debug-tabpage, too
285 EchteAnzahl = OptionTabPageZaehler (i)
286 if bDebugVersion = TRUE then EchteAnzahl = EchteAnzahl - 1
287 for i=1 to EchteAnzahl
289 Kontext "OptionenDlg"
290 Optionsliste.TypeKeys "<Down>"
292 case 1 : Kontext "TabInhalteHTML"
294 printlog " - View / Ansicht"
295 if TabInhalteHTML.IsVisible then
297 Call DialogTest ( TabInhalteHTML )
299 case 2 : Kontext "TabDirektCursor"
301 printlog " - Formatting aids / Formatierungshilfen"
302 if TabDirektCursor.IsVisible then
304 Call DialogTest ( TabDirektCursor )
306 case 3 : Kontext "TabRaster"
308 printlog " - Grid / Raster"
309 if TabRaster.IsVisible then
311 Call DialogTest ( TabRaster )
313 case 4 : Kontext "TabDruckenHTML"
315 printlog " - Print / Drucken"
316 if TabDruckenHTML.IsVisible then
318 Call DialogTest ( TabDruckenHTML )
320 case 5 : Kontext "TabTabelleOptionen"
322 printlog " - Table / Tabelle"
323 if TabTabelleOptionen.IsVisible then
325 Call DialogTest ( TabTabelleOptionen )
327 case 6 : Kontext "TabHintergrund"
329 printlog " - Background / Hintergrund"
331 if TabHintergrund.IsVisible then
333 Call DialogTest ( TabHintergrund )
336 if gefunden=FALSE then
337 Warnlog "Error with the " + i + ".page, perhaps this page is deleted or change the place!"
338 EchteAnzahl = EchteAnzahl - 1
339 if EchteAnzahl < 6 then
346 '/// Close the options dialog
347 Kontext "OptionenDlg"
349 '/// Close the document
350 if gApplication <> "BACKGROUND" then
355 '-------------------------------------------------------------------------
357 testcase tToolsOptionsSpreadsheet
358 dim EchteAnzahl as Integer, i as Integer
359 dim gefunden as Boolean
361 PrintLog "- Tools/Options/Spreadsheet ( Extras/Optionen/Tabellendokument )"
362 if (0 = iSectionNumber) then
363 warnlog "You can't run this testcase seperated! Ending now! Please run it via: tToolsOptionsTest"
366 '/// Create a new document
367 if gApplication <> "BACKGROUND" then
370 '/// <i>Tools</i> / <i>Options</i> / <i>Spreadsheet</i>
372 ToPosInOptionlist ( 4 )
373 EchteAnzahl = OptionTabPageZaehler ( 7, FALSE )
374 for i=1 to EchteAnzahl
376 Kontext "OptionenDlg"
377 Optionsliste.TypeKeys "<Down>"
379 case 1 : Kontext "TabLayoutCalc"
381 printlog " - General / Allgemein"
382 if TabLayoutCalc.IsVisible then
384 Call DialogTest ( TabLayoutCalc )
386 case 2 : Kontext "TabInhaltCalc"
388 printlog " - View / Ansicht"
389 if TabInhaltCalc.IsVisible then
391 Call DialogTest ( TabInhaltCalc )
393 case 3 : Kontext "TabBerechnen"
395 printlog " - Calculate / Berechnen"
396 if TabBerechnen.IsVisible then
398 Call DialogTest ( TabBerechnen )
400 case 4 : Kontext "TabSortierlisten"
402 printlog " - Sort Lists / Sortierliste"
403 if TabSortierlisten.IsVisible then
405 Call DialogTest ( TabSortierlisten )
407 case 5 : Kontext "TabAenderungenCalc"
409 printlog " - Changes / Aenderungen"
410 if TabAenderungenCalc.IsVisible then
412 Call DialogTest ( TabAenderungenCalc )
414 case 6 : Kontext "TabRaster"
416 printlog " - Grid / Raster"
417 if TabRaster.IsVisible then
419 Call DialogTest ( TabRaster )
421 case 7 : Kontext "TabPrintCalcOptions"
423 printlog " - Print / Drucken"
424 if TabPrintCalcOptions.IsVisible then
426 Call DialogTest ( TabPrintCalcOptions )
429 if gefunden=FALSE then
430 Warnlog "Error with the " + i + ".page, perhaps this page is deleted or change the place!"
431 EchteAnzahl = EchteAnzahl - 1
432 if EchteAnzahl < 7 then
439 '/// Close the options dialog
440 Kontext "OptionenDlg"
442 '/// Close the document
443 if gApplication <> "BACKGROUND" then
448 '-------------------------------------------------------------------------
450 testcase tToolsOptionsPresentation
451 dim EchteAnzahl as Integer, i as Integer
452 dim gefunden as Boolean
455 PrintLog "- Tools/Options/Presentation ( Extras/Optionen/Praesentation )"
456 if (0 = iSectionNumber) then
457 warnlog "You can't run this testcase seperated! Ending now! Please run it via: tToolsOptionsTest"
460 '/// Create a new document
461 if gApplication <> "BACKGROUND" then
464 kontext "DocumentImpress"
465 if DocumentImpress.exists(5) then
466 printlog " - An application of type Presentation is available."
467 '--- workaround #i48383#
468 DocumentImpress.MouseDown (10,10)
469 DocumentImpress.MouseUp (10,10)
471 qaErrorLog " - No application of type Presentation is available"
473 '/// <i>Tools</i> / <i>Options</i> / <i>Presentation</i>
475 ToPosInOptionlist ( 4 )
476 EchteAnzahl = OptionTabPageZaehler ( 4, FALSE )
477 for i=1 to EchteAnzahl
479 Kontext "OptionenDlg"
480 Optionsliste.TypeKeys "<Down>"
482 case 1 : Kontext "TabSonstigesDraw"
484 printlog " - General / Allgemein"
485 if TabSonstigesDraw.exists then
486 if TabSonstigesDraw.IsVisible then
488 Call DialogTest ( TabSonstigesDraw )
491 ' Trying to get root cause on some systems it seems the backing window is used. #i48383#
492 Kontext "OptionenDlg"
493 OptionenDlg.SnapShot convertPath(gOfficePath + "user/work/"+gApplication+".bmp")
494 qaErrorLog "#i48383# Trying to get root cause for wrong window; check picture: " + convertPath(gOfficePath + "user/work/"+gApplication+".bmp")
495 for iTemp = 1 to Optionsliste.getItemCount
496 qaErrorLog "" + iTemp + ": '" + Optionsliste.getItemText(iTemp) + "'"
500 case 2 : Kontext "TabInhalteDraw"
502 printlog " - View / Ansicht"
503 if TabInhalteDraw.IsVisible then
505 Call DialogTest ( TabInhalteDraw )
507 case 3 : Kontext "TabRaster"
509 printlog " - Grid / Raster"
510 if TabRaster.IsVisible then
512 Call DialogTest ( TabRaster )
514 case 4 : Kontext "TabDruckenDraw"
516 printlog " - Print / Drucken"
517 if TabDruckenDraw.IsVisible then
519 Call DialogTest ( TabDruckenDraw )
522 if gefunden=FALSE then
523 Warnlog "Error with the " + i + ".page, perhaps this page is deleted or change the place!"
524 EchteAnzahl = EchteAnzahl - 1
525 if EchteAnzahl < 4 then
532 '/// Close the options dialog
533 Kontext "OptionenDlg"
535 '/// Close the document
536 if gApplication <> "BACKGROUND" then
541 '-------------------------------------------------------------------------
543 testcase tToolsOptionsDrawing
544 Dim EchteAnzahl as Integer, i as Integer
545 Dim gefunden as Boolean
547 PrintLog "- Tools/Options/Drawing ( Extras/Optionen/Zeichnung )"
548 if (0 = iSectionNumber) then
549 warnlog "You can't run this testcase seperated! Ending now! Please run it via: tToolsOptionsTest"
552 '/// Create a new document
553 if gApplication <> "BACKGROUND" then
556 Kontext "DocumentDraw"
557 if DocumentDraw.exists(5) then
558 printlog " - An application of type Draw is available."
559 '--- workaround #i48383#
560 DocumentDraw.MouseDown (10,10)
561 DocumentDraw.MouseUp (10,10)
563 qaErrorLog " - No application of type Draw is available"
565 '/// <i>Tools</i> / <i>Options</i> / <i>Drawing</i>
567 ToPosInOptionlist ( 4 )
568 EchteAnzahl = OptionTabPageZaehler ( 4, FALSE )
569 for i=1 to EchteAnzahl
571 Kontext "OptionenDlg"
572 Optionsliste.TypeKeys "<Down>"
574 case 1 : Kontext "TabSonstigesDraw"
576 printlog " - General / Allgemein"
577 if TabSonstigesDraw.exists then
578 if TabSonstigesDraw.IsVisible then
580 Call DialogTest ( TabSonstigesDraw )
583 ' Trying to get root cause on some systems it seems the backing window is used. #i48383#
584 Kontext "OptionenDlg"
585 qaErrorLog "#i48383# wrong focus on opening options"
588 case 2 : Kontext "TabInhalteDraw"
590 printlog " - View / Ansicht"
591 if TabInhalteDraw.IsVisible then
593 Call DialogTest ( TabInhalteDraw )
595 case 3 : Kontext "Active"
596 if Active.Exists then
597 Warnlog "A messagebox exists => BUG : " + Active.GetText
606 printlog " - Grid / Raster"
607 if TabRaster.IsVisible then
609 Call DialogTest ( TabRaster )
611 case 4 : Kontext "TabDruckenDraw"
613 printlog " - Print / Drucken"
614 if TabDruckenDraw.IsVisible then
616 Call DialogTest ( TabDruckenDraw )
619 if gefunden=FALSE then
620 Warnlog "Error with the " + i + ".page, perhaps this page is deleted or change the place!"
621 EchteAnzahl = EchteAnzahl - 1
622 if EchteAnzahl < 4 then
629 '/// Close the options dialog
630 Kontext "OptionenDlg"
632 '/// Close the document
633 if gApplication <> "BACKGROUND" then
638 '-------------------------------------------------------------------------
640 testcase tToolsOptionsFormula
641 dim EchteAnzahl as Integer, i as Integer
643 PrintLog "- Tools/Options/Formula ( Extras/Optionen/Formel )"
644 if (0 = iSectionNumber) then
645 warnlog "You can't run this testcase seperated! Ending now! Please run it via: tToolsOptionsTest"
648 '/// Create a new document
649 if gApplication <> "BACKGROUND" then
652 '/// <i>Tools</i> / <i>Options</i> / <i>Formula</i>
654 ToPosInOptionlist ( 4 )
655 EchteAnzahl = OptionTabPageZaehler ( 1, FALSE )
656 Kontext "OptionenDlg"
658 Optionsliste.TypeKeys "<Down>"
659 printlog " - Print / Drucken"
660 Kontext "TabDruckenMath"
661 Call DialogTest ( TabDruckenMath )
662 '/// Close the options dialog
663 Kontext "OptionenDlg"
665 '/// Close the document
666 if gApplication <> "BACKGROUND" then