summaryrefslogtreecommitdiff
path: root/testautomation/global/required/includes/g_option.inc
blob: 88d6bb89a055fa81e3651aa3f173eb755c6070e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
'encoding UTF-8  Do not remove or change this line!
'**************************************************************************
'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'* 
'* Copyright 2008 by Sun Microsystems, Inc.
'*
'* OpenOffice.org - a multi-platform office productivity suite
'*
'* $RCSfile: g_option.inc,v $
'*
'* $Revision: 1.2 $
'*
'* last change: $Author: rt $ $Date: 2008-07-31 19:25:49 $
'*
'* This file is part of OpenOffice.org.
'*
'* OpenOffice.org is free software: you can redistribute it and/or modify
'* it under the terms of the GNU Lesser General Public License version 3
'* only, as published by the Free Software Foundation.
'*
'* OpenOffice.org is distributed in the hope that it will be useful,
'* but WITHOUT ANY WARRANTY; without even the implied warranty of
'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'* GNU Lesser General Public License version 3 for more details
'* (a copy is included in the LICENSE file that accompanied this code).
'*
'* You should have received a copy of the GNU Lesser General Public License
'* version 3 along with OpenOffice.org.  If not, see
'* <http://www.openoffice.org/license.html>
'* for a copy of the LGPLv3 License.
'*
'/************************************************************************
'*
'* owner : thorsten.bosbach@sun.com
'*
'* short description : update and resouce test for all option pages (at tools/options)
'*
'\***********************************************************************
global sErrMes as String
global iSectionNumber as Integer

sub ExtrasOptionenTest
    Call tToolsOptionsTest
end sub

sub tToolsOptionsTest
    dim sApplication as string
    
    sApplication = gApplication
    ' Document- and database related options are placed in the g_option2.inc library
    use "global\required\includes\g_option2.inc"
    ' subs and functions has been placed there
    use "global/tools/includes/required/t_option2.inc"

    ' To prevent users from running just a subsection from this file, without THIS 
    ' subroutine, in every subsection the value of 'iSectionNumber' is checked.
    ' The test will exist with warnlog, if iSectionNumber is 0
    sErrMes = ""
        select case uCase(gApplication)
            case "WRITER","MASTERDOC","HTMLDOKUMENT": iSectionNumber = 8
            case "IMPRESS","DRAW","MATH","CALC"     : iSectionNumber = 7
        end select
    ' common testcases are placed in this library
    ' these tab-sets are always available:
    Call tToolsOptionsStarOffice
    Call tToolsOptionsLoadSave
    Call tToolsOptionsLanguageSettings
    Call tToolsOptionsDataSources
    Call tToolsOptionsChart
    Call tToolsOptionsInternet
    Call tToolsOptionsImprovementProgram

    ' these tabpages only exist in the respective application
    gApplication = "WRITER"
    iSectionNumber = 8
    Call tToolsOptionsTextdocument
    
    gApplication = "HTMLDOKUMENT"
    Call tToolsOptionsHTMLDocument
    
    gApplication = "CALC"
    iSectionNumber = 7
    Call tToolsOptionsSpreadsheet
    
    gApplication = "IMPRESS"
    iSectionNumber = 7
    Call tToolsOptionsPresentation
    
    gApplication = "DRAW"
    iSectionNumber = 7
    Call tToolsOptionsDrawing
    
    gApplication = "MATH"
    iSectionNumber = 7
    Call tToolsOptionsFormula

    gApplication = sApplication
end sub

testcase tToolsOptionsStarOffice
    dim EchteAnzahl as Integer, i as Integer
    dim gefunden as Boolean, bSave as Boolean
    dim iMenuShould as integer
    '/// We have 12 tab pages in this category. If the <i>central configuration</i> feature is being used 13 (<i>Single SignOn</i>)
    '/// <i>Tools</i> / <i>Options</i> / <i>OpenOffice.org</i>
    PrintLog "- Tools/Options/StarOffice  ( Extras/Optionen/StarOffice )"
    if (0 = iSectionNumber) then 
        warnlog "You can't run this testcase seperated! Ending now! Please run it via: tToolsOptionsTest"
        goto endsub
    endif
    if gApplication <> "DESKTOP" then Call hNewDocument
    ToolsOptions
    ToPosInOptionlist ( 1 )
    Kontext "ExtrasOptionenDlg"
    EchteAnzahl = Optionsliste.GetItemCount - iSectionNumber
    iMenuShould = 14
    
    if EchteAnzahl <> iMenuShould then
        if ((gtplatform = "sol") OR (gtplatform = "x86") OR gOOO) AND EchteAnzahl = 12 then
            printLog "One Tabpage is missing. This is ok for a patched Solaris (sparc and x86) or OOo installation." 
        else
            Warnlog "The number of entries is not " + iMenuShould + "! => the current number is " + EchteAnzahl
        endif
    end if
    Kontext "Active"
    try
        if Active.Exists then Active.OK
    catch
        if Active.Exists then Active.No
    endcatch
    for i=1 to EchteAnzahl
        gefunden = FALSE
        Kontext "OptionenDlg"
        Optionsliste.TypeKeys "<Down>"
        select case i
        case 1 : Kontext "TabAllgemeines"
                '///+<ul><li>User data</li>
                printlog "  - Userdata / Benutzerdaten"
                if TabAllgemeines.IsVisible then
                   gefunden = TRUE
                   Call DialogTest ( TabAllgemeines )
                end if
        case 2 : Kontext "TabSonstigesAllgemein"
                '///+<li>General</li>
                printlog "  - General / Allgemein"
                if TabSonstigesAllgemein.IsVisible then
                   gefunden = TRUE
                   Call DialogTest ( TabSonstigesAllgemein )
                end if
        case 3 : Kontext "TabMemory"
                '///+<li>Memory</li>
                printlog "  - Memory / Arbeitsspeicher"
                if TabMemory.IsVisible then
                   gefunden = TRUE
                   Call DialogTest ( TabMemory )
                end if
        case 4 : Kontext "TabAnsichtAllgemein"
                '///+<li>View</li>
                printlog "  - View / Ansicht"
                if TabAnsichtAllgemein.IsVisible then
                   gefunden = TRUE
                   Call DialogTest ( TabAnsichtAllgemein )
                end if
        case 5 : Kontext "TabPrintStarOffice"
                '///+<li>Print</li>
                printlog "  - Print / Drucken"
                if TabPrintStarOffice.IsVisible then
                   gefunden = TRUE
                   Call DialogTest ( TabPrintStarOffice )
                end if
        case 6 : Kontext "TabPfade"
                '///+<li>Paths 
                '///+ <ul><li>Click <i>edit</i> to all list entries and then close the file dialog</li></ul></li>
                printlog "  - Paths / Pfade"
                if TabPfade.IsVisible then
                   gefunden = TRUE
                   Call DialogTest ( TabPfade )
                   Call DialogeFuerTypenKontrollieren
                end if
        case 7 : Kontext "TabFarben"
                '///+<li>Colors 
                '///+<ul><li>Click on <i>Add</i></li>
                '///+<li>Click <i>OK</i> on message box</li>
                '///+<li>Click <i>cancel> on <i>Name</i> dialog</li>
                '///+<li>Click on <i>Edit</i></li>
                '///+<li>Click on <i>Close</i> in <i>Colors</i> dialog</li></ul></li>
                printlog "  - Color / Farben"
                sleep(4)
                if TabFarben.IsVisible then
                   gefunden = TRUE
                   Call DialogTest (TabFarben)
                      Farbe.Select(1)
                      Hinzufuegen.Click
                        Kontext "Active"
                        Active.OK
                        Kontext "NameDlg"
                        Call DialogTest (NameDlg)
                        NameDlg.Cancel
                      Kontext "TabFarben"
                      Bearbeiten.Click
                        sleep(3)
                        Kontext "FarbeDlg"
                        FarbeDlg.Cancel
                end if
        case 8 : Kontext "TabSchriftErsetzung"
                '///+<li>Font replacement</li>
                printlog "  - Font Replacement / Schriftersetzung"
                if TabSchriftErsetzung.IsVisible then
                   gefunden = TRUE
                   Call DialogTest ( TabSchriftErsetzung )
                end if
        case 9: Kontext "TabSecurity"
                '///+<li>Security</li>
                printlog "  - Security / Sicherheit"
                if TabSecurity.IsVisible then
                   gefunden = TRUE
                   Call DialogTest ( TabSecurity )
                   MacroSecurity.click()
                   
                   kontext "TabSecurityLevel"
                   if ( TabSecurityLevel.exists( 2 ) ) then                            
                       call DialogTest( TabSecurityLevel )
                       kontext
                       active.setpage TabTrustedSources
                       kontext "TabTrustedSources"
                       call DialogTest( TabTrustedSources )
                       TabTrustedSources.cancel
                   else
                       warnlog( "Macro Security Options dialog is missing" )
                       qaerrorlog( "#i45295# or office built without mozilla support" )
                   endif
                   
                   Kontext "TabSecurity"
                   if Protect.isEnabled then
                       Protect.click()
                       Kontext "PasswordDLG"
                       call DialogTest( PasswordDLG )
                       PasswordDLG.cancel()
                   else
                       select case uCase(gApplication)
                           case "WRITER","MASTERDOC"                          :WarnLog "Protect-Button is disabled."
                           case "MATH","IMPRESS","DRAW","HTMLDOKUMENT","CALC" :PrintLog "Protect-Button is disabled."
                       end select
                   endif
                   sleep(1)
                   Kontext "TabSecurity"
                   Options.click
                       Kontext "TabSecurityOptionsAndWarnings"
                       Call DialogTest(TabSecurityOptionsAndWarnings)
                       TabSecurityOptionsAndWarnings.cancel
                   sleep(1)
                end if
        case 10: Kontext "TabAppearance"
                '///+<li>Appearance</li>
                printlog "  - Appearance / Aussehen"
                if TabAppearance.IsVisible then
                   gefunden = TRUE
                   Call DialogTest ( TabAppearance )
                end if
        case 11: Kontext "TabAccessibility"
                '///+<li>Accessibility</li>
                printlog "  - Accessibility"
                if TabAccessibility.IsVisible then
                   gefunden = TRUE
                   Call DialogTest ( TabAccessibility )
                end if
        case 12: Kontext "TabJava"
                '///+<li>Java</li></ul>
                printlog "  - Java"
                if TabJava.IsVisible then
                   gefunden = TRUE
                   Call DialogTest ( TabJava )
                end if
                if useJava.isChecked then
                    Add.click
                        Kontext "OeffnenDlg"
                        Sleep (1)
                        OeffnenDlg.Cancel
                    Kontext "TabJava"
                    Parameters.click
                        Kontext "JavaStartParameter"
                        Call DialogTest ( JavaStartParameter )
                        JavaStartParameter.cancel
                    Kontext "TabJava"
                    ClassPath.click
                        Kontext "JavaClassPath"
                        Call DialogTest ( JavaClassPath )
                        JavaClassPath.cancel
                else
                    printlog "Use Java is disabled."
                end if
        case 13: kontext "TabOnlineUpdate"
                '///+<li>Online update</li>
                printlog "  - Online update"
                if TabOnlineUpdate.isVisible then
                   gefunden = TRUE
                   Call DialogTest( TabOnlineUpdate )
                endif
                'CheckNow.click
        case 14: Kontext "TabOOoImprovement"
                 printlog( "  - OpenOffice.org Improvement Program" )
                 if ( TabOOoImprovement.isVisible() ) then
                     gefunden = TRUE
                     Call DialogTest( TabOOoImprovement )
                 endif
        end select
        if ( NOT gefunden ) then
            Warnlog "Error with the " & i & ".page, perhaps this page has been deleted or changed its position"
            EchteAnzahl = EchteAnzahl - 1
            if EchteAnzahl < 13 then
                i=10
            else
                i=1-1
            end if
        end if
    next i
'/// Close the options dialog
   Kontext "OptionenDlg"
   OptionenDlg.Cancel
'/// Close the document 
   if gApplication <> "DESKTOP" then 
    Call hCloseDocument
   end if
endcase

'-------------------------------------------------------------------------

testcase tToolsOptionsLoadSave
  dim EchteAnzahl as Integer, i as Integer
  dim gefunden as Boolean
   PrintLog "- Tools/Options/Load Save  ( Extras/Optionen/Laden Speichern )"
    if (0 = iSectionNumber) then 
        warnlog "You can't run this testcase seperated! Ending now! Please run it via: tToolsOptionsTest"
        goto endsub
    endif
   if gApplication <> "DESKTOP" then Call hNewDocument
'/// <i>Tools</i> / <i>Options</i> / <i>Load/Save</i>
   ToolsOptions
   ToPosInOptionlist (2)
   EchteAnzahl = OptionTabPageZaehler (4, FALSE)
   for i=1 to EchteAnzahl
      gefunden = FALSE
      Kontext "OptionenDlg"
      Optionsliste.TypeKeys "<Down>"
      select case i
       case 1 : Kontext "TabSpeichern"
                '///+<ul><li>General</li>
                printlog "  - General / Save"
                if TabSpeichern.IsVisible then
                   gefunden = TRUE
                   Call DialogTest ( TabSpeichern )
                end if
       case 2 : Kontext "TabMicrosoftOffice97"
                '///+<li>VBA settings</li>
                printlog "  - VBA Settings / VBA Eigenschaften"
                if TabMicrosoftOffice97.IsVisible then
                   gefunden = TRUE
                   Call DialogTest ( TabMicrosoftOffice97 )
                end if
       case 3 : Kontext "TabMicrosoftOffice2"
                '///+<li>Microsoft Office</li>
                printlog "  - Microsoft Office"
                if TabMicrosoftOffice2.IsVisible then
                   gefunden = TRUE
                   Call DialogTest ( TabMicrosoftOffice2 )
                end if
       case 4 : Kontext "TabHTML"
                '///+<li>HTML Compatibility</li></ul>
                printlog "  - HTML Compatibility / HTML Kompatibilitaet"
                if TabHTML.IsVisible then
                   gefunden = TRUE
                   Call DialogTest ( TabHTML )
                end if
      end select
      if gefunden=FALSE then
         Warnlog "Error with the " + i + ".page, perhaps this page is deleted or change the place!"
         EchteAnzahl = EchteAnzahl - 1
         if EchteAnzahl < 5 then
            i=11
         else
            i=1-1
         end if
      end if
   next i
'/// Close the options dialog
   Kontext "OptionenDlg"
   OptionenDlg.Cancel
'/// Close the document
   if gApplication <> "DESKTOP" then 
    Call hCloseDocument
   end if
endcase

'-------------------------------------------------------------------------

testcase tToolsOptionsLanguageSettings
  dim EchteAnzahl as Integer, i as Integer, j as Integer
  dim gefunden as Boolean
  dim bAsianSup as Boolean

   PrintLog "- Tools/Options/Language Settings  ( Extras/Optionen/Spracheinstellungen )"
    if (0 = iSectionNumber) then 
        warnlog "You can't run this testcase seperated! Ending now! Please run it via: tToolsOptionsTest"
        goto endsub
    endif
   if gApplication <> "DESKTOP" then Call hNewDocument
 '/// <i>Tools</i> / <i>Options</i> / <i>Language settings</i>
   ToolsOptions
    ToPosInOptionlist ( 3 )
   EchteAnzahl = Optionsliste.GetItemCount - iSectionNumber
   '/// We only have two tab pages in this section:
   '///+ <ul><li><i>Languages</i> and <i>Writing Aids</i></li>
   '///+<ol><li>In asian languages we have two additional tab pages: 
   '///+ <ul><li><i>Japanese Find</i> and <i>Asian Layout</i></li></ul></li>
   '///+<li>In languages with CTL (<i>Complex Text Layout</i>) there is also one more:
   '///+<ul><li><i>Complex Text Layout</i></li></ul></li></ol></li></ul>
   select case (EchteAnzahl)
      case 2: printlog "Asian or Complex Text Layout support is not activated (on languages-page)!"
      case 3: printlog "Complex Text Layout support is activated (on languages-page)!"
      case 4: printlog "Asian support is activated (on languages-page)!"
      case 5: if (gAsianSup AND gCTLSup) then
                  printlog "Asian and Complex Text Layout support is activated (on languages-page)!"
              else
                  Warnlog "There are more than 4 pages!"
              endif
      case else
         Warnlog "There are more than 5 pages!"
   end select
   Kontext "Active"
   try
      if Active.Exists then Active.OK
   catch
      if Active.Exists then Active.No
   endcatch
   for i=1 to EchteAnzahl
      gefunden = FALSE
      Kontext "OptionenDlg"
      Optionsliste.TypeKeys "<Down>"
      select case i
       case 1 : Kontext "TabSprachen"
                'Languages
                printlog "  - Languages / Sprachen"
                if TabSprachen.IsVisible then
                   gefunden = TRUE
                   Call DialogTest ( TabSprachen )
                end if
       case 2 : Kontext "TabLinguistik"
                printlog "  - Writing Aids / Linguistik"
                if TabLinguistik.IsVisible then
                   gefunden = TRUE
                   Call DialogTest ( TabLinguistik )
                '/// In <i>Writing aids</i>
                '///+<ul><li> On <i>modules<i> click <i>edit</i></li>
                   SprachmoduleBearbeiten.Click
                    Kontext "ModuleBearbeiten"
                    Call DialogTest ( ModuleBearbeiten )
                    ModuleBearbeiten.Close
                    '///+<li> close dialog</li></ul>
                   Kontext "TabLinguistik"
                '///+<ul><li>On <i>dictionaries</i> click <i>new</i></li>
                '///+<li>close dialog</li></ul>
                   Neu.Click
                    Kontext "BenutzerwoerterbuchAnlegen"
                    Call DialogTest ( BenutzerwoerterbuchAnlegen )
                    BenutzerwoerterbuchAnlegen.Cancel

                '///+<ul><li>On <i>dictionaries</i> click <i>edit</i></li>
                '///+<li>close dialog</li></ul>
                   Kontext "TabLinguistik"
                   for j=1 to 5
                      if Bearbeiten.IsEnabled then
                         Bearbeiten.Click
                         j=6
                      else
                         Benutzerwoerterbuch.TypeKeys "<Down>"
                      end if
                   next j
                   Kontext "BenutzerwoerterbuchBearbeiten"
                   if BenutzerwoerterbuchBearbeiten.Exists then
                      Call DialogTest ( BenutzerwoerterbuchBearbeiten )
                      BenutzerwoerterbuchBearbeiten.Close
                   else
                        warnlog "Edit the 'user-defined dictionary' is not possible => Bug?"
                   end if
                '/// <i>Options</i> 
                '///+<ul><li>On 9th, 10th and 11th entry click <i>edit</i></li>
                '///+<li>close dialog</li></ul>
                   Kontext "TabLinguistik"
                   Optionen.TypeKeys "<PageUp>", 3
                   Sleep 1
                   Optionen.TypeKeys "<Down>", 6
                   Sleep 1
                   OptionenBearbeiten.Click
                    Kontext "SilbentrennungOptionen"
                    Call DialogTest ( SilbentrennungOptionen )
                    SilbentrennungOptionen.Cancel
                   Kontext "TabLinguistik"
                   Optionen.TypeKeys "<Down>"
                   OptionenBearbeiten.Click
                    Kontext "SilbentrennungOptionen"
                    Call DialogTest ( SilbentrennungOptionen )
                    SilbentrennungOptionen.Cancel
                   Kontext "TabLinguistik"
                   Optionen.TypeKeys "<Down>"
                   OptionenBearbeiten.Click
                    Kontext "SilbentrennungOptionen"
                    Call DialogTest ( SilbentrennungOptionen )
                    SilbentrennungOptionen.Cancel
                end if
       case 3,5 : try
                   Kontext "TabJapaneseFind"
                   'Japanese find
                   if TabJapaneseFind.IsVisible then
                      printlog "  - Japanese Find / Japanische Suche"
                      gefunden = TRUE
                      Call DialogTest ( TabJapaneseFind )
                   end if
                catch
                endcatch
                try
                   Kontext "TabComplexTextLayout"
                   'Complex Text Layout
                   if TabComplexTextLayout.IsVisible then
                      printlog "  - Complex Text Layout"
                      gefunden = TRUE
                      Call DialogTest ( TabComplexTextLayout )
                   end if
                catch
                endcatch
       case 4 : Kontext "TabAsianLayoutOptions"
                'Asian layout
                printlog "  - Asian Layout / Asiatisches Layout"
                if TabAsianLayoutOptions.IsVisible then
                   gefunden = TRUE
                   Call DialogTest ( TabAsianLayoutOptions )
                end if
      end select
      if gefunden=FALSE then
         Warnlog "Error with the " + i + ".page, perhaps this page is deleted or change the place!"
         EchteAnzahl = EchteAnzahl - 1
         if EchteAnzahl < 5 then
            i=5
         else
            i=1-1
         end if
      end if
   next i
'/// Close the options dialog
   Kontext "OptionenDlg"
   OptionenDlg.Cancel
'/// Close the document   
   if gApplication <> "DESKTOP" then 
    Call hCloseDocument
   end if
endcase

'-------------------------------------------------------------------------

testcase tToolsOptionsInternet
  dim EchteAnzahl as Integer, i as Integer
  dim gefunden as Boolean

  PrintLog "- Tools/Options/Internet  ( Extras/Optionen/Internet )"
    if (0 = iSectionNumber) then 
        warnlog "You can't run this testcase seperated! Ending now! Please run it via: tToolsOptionsTest"
        goto endsub
    endif
   if gApplication <> "DESKTOP" then Call hNewDocument
 '/// <i>Tools</i> / <i>Options</i> / <i>Internet</i>
   ToolsOptions
   '/// (The last section in Tools / Options is <i>Internet</i>)
   ToPosInOptionlist ( iSectionNumber)

    if gPlatgroup = "w95" OR gPlatform = lcase("osx") then
        '/// On MacOS X systems this section includes the tab pages:
        '///+<ol><li>Proxy</li>
        '///+<li>Search</li>
        '///+<li>E-Mai</li></ol>
        '/// On Win32 systems this section includes the tab pages:
        '///+<ol><li>Proxy</li>
        '///+<li>Search</li>
        '///+<li>Mozilla Plugin</li></ol>
        EchteAnzahl = OptionTabPageZaehler ( 3 , FALSE )
    else
        '/// On Unix systems this section includes four tab pages.
        '///+<ol><li>Proxy</li>
        '///+<li>Search</li>
        '///+<li>E-Mail</li>
        '///+<li>Mozilla Plugin</li></ol>
        EchteAnzahl = OptionTabPageZaehler ( 4 , FALSE )
    end if

   for i=1 to EchteAnzahl
      gefunden = FALSE
      Kontext "OptionenDlg"
      Optionsliste.TypeKeys "<Down>"
      Kontext "ProxyWarnung"
      if ProxyWarnung.Exists(1) then
         NichtMehrAnzeigen.Check
         ProxyWarnung.OK
      end if

      select case i
       case 1 : Kontext "TabProxyServer"
                'Proxy
                printlog "  - Proxy / Proxy"
                if TabProxyServer.IsVisible then
                   gefunden = TRUE
                   Call DialogTest ( TabProxyServer )
                end if
       case 2 : Kontext "Active"
                'Search
                printlog "  - Search / Suche"
                if Active.Exists then
                   sErrMes = Active.GetText
                   Warnlog "A messagebox exists => BUG  : " + sErrMes
                   Active.OK
                end if
                Kontext "TabSuche"
                if TabSuche.IsVisible then
                   gefunden = TRUE
                   Call DialogTest ( TabSuche )
                end if
       case 3 :
                if gPlatgroup = "unx" then
                    Kontext "TabEmail"
                    'E-mail
                    printlog "  - E-mail"
                    if TabEmail.IsVisible then
                        gefunden = TRUE
                        Call DialogTest ( TabEmail )
                    end if
                end if
                if gPlatgroup = "w95" then
                    Kontext "TabMozillaPlugin"
                    'Mozilla Plug-in (On Win32)
                    printlog "  - Mozilla Plug-in"
                    if TabMozillaPlugin.IsVisible then
                        gefunden = TRUE
                        Call DialogTest ( TabMozillaPlugin )
                    end if
                end if
       case 4 :
                if gPlatgroup = "w95" then
                    warnlog "On Win32 platform there should be only 3 tab pages in section 'Internet'!?"
                else
                    Kontext "TabMozillaPlugin"                    
                    printlog "  - Mozilla Plug-in"
                    if TabMozillaPlugin.IsVisible then
                        gefunden = TRUE
                        Call DialogTest ( TabMozillaPlugin )
                    end if
                end if
      end select
      if gefunden=FALSE then
         Warnlog "Error with the " + i + ".page, perhaps this page is deleted or change the place!"
         EchteAnzahl = EchteAnzahl - 1
         if EchteAnzahl < 4 then
            i=11
         else
            i=1-1
         end if
      end if
   next i
'/// Close the options dialog
   Kontext "OptionenDlg"
   OptionenDlg.Cancel
'/// Close document
   if gApplication <> "DESKTOP" then 
    Call hCloseDocument
   end if
endcase

'-------------------------------------------------------------------------

testcase tToolsOptionsImprovementProgram

    printlog( "Update test for the tools/options dialog of the OOo Improvement Program" )
    
    dim cLogFile as string
        cLogFile = gOfficePath & "user\temp\feedback\Current.csv"
        cLogFile = convertpath( cLogFile )

    if ( hDeleteFile( cLogFile ) ) then
        printlog( "Test environment is clean, no logfile present (anymore)" )
    endif

    ToolsOptions
    hToolsOptions( "StarOffice", "Improvement" )
    printlog( "Improvement Program tabpage" )

    call DialogTest( TabOOoImprovement )

    ParticipateNo.check()
    ParticipateYes.check()
  
    if ( ShowData.isEnabled() ) then 

        ShowData.click()

        Kontext "TextImport"
        if ( TextImport.exists( 1 ) ) then
            printlog( "Text import dialog" )
                
            call DialogTest( TextImport )
            TextImport.cancel()
        else
            qaerrorlog( "#i97340# Show Data button enabled but no logged data found" )
        endif

        Kontext "Active"
        if ( Active.exists( 1 ) ) then
            printlog( "Messagebox: " & Active.getText() )
            Active.ok()
        else
            warnlog( "No warning for missing file: " & cLogFile )
        endif

        Kontext "Active"
        if ( Active.exists( 1 ) ) then
            warnlog( "#97342# Second message for missing " & cLogFile )
            Active.ok()
        endif
    else
        printlog( "Show data is disabled" )
    endif

    Kontext "OptionenDlg"
    OptionenDlg.cancel()

endcase