summaryrefslogtreecommitdiff
path: root/testautomation/writer/required/includes/w_003_.inc
blob: 1e9f5a7b65ce9aea5b43ab22b8cc6369d1358bb6 (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
'encoding UTF-8  Do not remove or change this line!
'**************************************************************************
' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'
' Copyright 2000, 2010 Oracle and/or its affiliates.
'
' OpenOffice.org - a multi-platform office productivity suite
'
' 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 : helge.delfs@oracle.com
'*
'* short description :  Testscripts connected to the View-Menu.
'*
'\******************************************************************

sub w_003_

    printLog Chr(13) + "--------- View Menu (w_003_.inc) ----------"
    gApplication = "WRITER"

    Call tViewPrintLayout
    Call tViewWebLayout
    Call tViewHTMLSource

    Call tViewToolbars

    Call tViewStatusBar
    Call tViewInputMethodStatus
    Call tViewRuler

    Call tViewTextBoundaries
    Call tViewFieldShadings
    Call tViewFields
    Call tViewNonprintingCharacters
    Call tViewHiddenParagraphs

    Call tViewDataSources

    Call tViewFullScreen
    Call tViewZoom

    'Writer Web
    gApplication = "HTML"
    Call tHtmlDocViewZoom
    Call tHtmlDocViewHTMLSource
    gApplication = "WRITER"

end sub

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

testcase tViewZoom
    printlog " open application"
    Call hNewDocument
    printlog " type something into the document"
    hTypekeys "<RETURN>", 3
    UseBindings
    printlog " View -> Zoom"
    ViewZoom
    Kontext "Massstab"
    if ( Massstab.exists( 1 ) ) then
        DialogTest ( Massstab )
        select case uCASE(gApplication)
        case "HTML" :
            printlog " check checkbox '100%'"
            Vergroesserung100.check
            printlog " check checkbox 'Variable'"
            VergroesserungStufenlos.check
        case else :
            printlog " check checkbox 'Optimal'"
            Optimal.check
            printlog " check checkbox 'Fit height and width'"
            GanzeSeite.check
            printlog " check checkbox 'Fit Width'"
            Seitenbreite.check
            printlog " check checkbox '100%'"
            Vergroesserung100.check
            printlog " check checkbox 'Variable'"
            VergroesserungStufenlos.check
            printlog " click button MORE on 'Variable'"
            Stufenlos.more
            printlog " click button 'Automatic'"
            Automatic.check
            printlog " click button 'Single Page'"
            Singlepage.check
            printlog " click button 'Columns'"
            Columns.check
            printlog " click button MORE on 'Columns'"
            Columnsfield.more
            printlog " click button LESS on 'Columns'"
            Columnsfield.less
            printlog " Check checkbox 'Book mode'"
            Bookmode.check
            printlog " cancel dialog 'Zoom'"
        end select
        Massstab.Cancel
    else
        warnlog( "Dialog <Massstab> is not available" )
    endif
    printlog " close application"
    Call  hCloseDocument
endcase

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

testcase tViewDataSources
    PrintLog "- View / Data Sources"
    printlog " Open new document"
    Call hNewDocument
    printlog " View / Data Sources"
    ViewCurrentDatabaseWriter

    Kontext "DatabaseBeamer"
    if ( DatabaseBeamer.Exists( 5 ) ) then
        printlog " Close database beamer with : View Data Sources"
        ViewCurrentDatabaseWriter
        
        Kontext "DatabaseBeamer"
        if ( DatabaseBeamer.Exists() ) then
            Warnlog "Could not close Databasebeamer with same slot!"
            ViewBeamer
            
            Kontext "DatabaseBeamer"
            if DatabaseBeamer.Exists then 
                Warnlog "Could not close Databasebeamer with Slot->View Beamer!"
            endif
        else
            printlog( "Closed Database Beamer dialog" )
        endif
    else
        Warnlog "Database Beamer has not been opened!"
    endif

    printlog " Close active document"
    Call hCloseDocument
endcase

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

testcase tViewToolbars
    PrintLog "- View / Toolbars"
    Dim i as integer

    printlog " Close all documents until only backing window is opened"
    Do Until GetDocumentCount = 0
        Call hCloseDocument
    Loop

    printlog " Open a new writer document"
    Call hNewDocument

    printlog "- Toolbar 'Align'"
    printlog "-  open"
    Call hToolbarSelect("Align", true)
    printlog "-  close"
    Call hToolbarSelect("Align", false)
    printlog "-  reset"
    Call hToolbarSelect("Align", true, true)

    printlog "- Toolbar 'Bullets And Numbering'"
    printlog "-  open"
    Call hToolbarSelect("BulletsAndNumbering", true)
    printlog "-  close"
    Call hToolbarSelect("BulletsAndNumbering", false)
    printlog "-  reset"
    Call hToolbarSelect("BulletsAndNumbering", true, true)

    printlog "- Toolbar 'Drawing'"
    printlog "-  open"
    Call hToolbarSelect("Drawing", true)
    printlog "-  close"
    Call hToolbarSelect("Drawing", false)
    printlog "-  reset"
    Call hToolbarSelect("Drawing", true, true)

    printlog "- Toolbar 'Drawing Object Properties'"
    printlog "-  open"
    Call hToolbarSelect("DrawingObjectProperties", true)
    printlog "-  close"
    Call hToolbarSelect("DrawingObjectProperties", false)
    printlog "-  reset"
    Call hToolbarSelect("DrawingObjectProperties", true, true)

    printlog "- Toolbar 'Form Controls'"
    printlog "-  open"
    Call hToolbarSelect("FormControls", true)
    printlog "-  close"
    Call hToolbarSelect("FormControls", false)
    printlog "-  reset"
    Call hToolbarSelect("FormControls", true, true)

    printlog "- Toolbar 'Form Design'"
    printlog "-  open"
    Call hToolbarSelect("FormDesign", true)
    printlog "-  close"
    Call hToolbarSelect("FormDesign", false)
    printlog "-  reset"
    Call hToolbarSelect("FormDesign", true, true)

    printlog "- Toolbar 'Form Navigation'"
    printlog "-  open"
    Call hToolbarSelect("FormNavigation", true)
    printlog "-  close"
    Call hToolbarSelect("FormNavigation", false)
    printlog "-  reset"
    Call hToolbarSelect("FormNavigation", true, true)

    ' The following toolbar is disabled because it will be found in all documents
    ' therefore they can't be reactivated once deactivated
    printlog "- Toolbar 'Formatting'"
    printlog "-  open"
    Call hToolbarSelect("Formatting", true)
    printlog "-  close"
    Call hToolbarSelect("Formatting", false)
    printlog "-  reset"
    Call hToolbarSelect("Formatting", true, true)

    printlog "- Toolbar 'Frame'"
    printlog "-  open"
    Call hToolbarSelect("Frame", true)
    printlog "-  close"
    Call hToolbarSelect("Frame", false)
    printlog "-  reset"
    Call hToolbarSelect("Frame", true, true)

    printlog "- Toolbar 'Insert'"
    printlog "-  open"
    Call hToolbarSelect("Insert", true)
    printlog "-  close"
    Call hToolbarSelect("Insert", false)
    printlog "-  reset"
    Call hToolbarSelect("Insert", true, true)

    printlog "- Toolbar 'Insert Object'"
    printlog "-  open"
    Call hToolbarSelect("InsertObject", true)
    printlog "-  close"
    Call hToolbarSelect("InsertObject", false)
    printlog "-  reset"
    Call hToolbarSelect("InsertObject", true, true)

    printlog "- Toolbar 'Media Playback'"
    printlog "-  open"
    Call hToolbarSelect("MediaPlayback", true)
    printlog "-  close"
    Call hToolbarSelect("MediaPlayback", false)
    printlog "-  reset"
    Call hToolbarSelect("MediaPlayback", true, true)

    printlog "- Toolbar 'OLE Object'"
    printlog "-  open"
    Call hToolbarSelect("OLEObject", true)
    printlog "-  close"
    Call hToolbarSelect("OLEObject", false)
    printlog "-  reset"
    Call hToolbarSelect("OLEObject", true, true)

    printlog "- Toolbar 'Page Preview'"
    printlog "-  open"
    Call hToolbarSelect("PagePreview", true)
    printlog "-  close"
    Call hToolbarSelect("PagePreview", false)
    printlog "-  reset"
    Call hToolbarSelect("PagePreview", true, true)

    printlog "- Toolbar 'Picture'"
    printlog "-  open"
    Call hToolbarSelect("Picture", true)
    printlog "-  close"
    Call hToolbarSelect("Picture", false)
    printlog "-  reset"
    Call hToolbarSelect("Picture", true, true)

    ' The following toolbar is disabled because it will be found in all documents
    ' therefore they can't be reactivated once deactivated
    printlog "- Toolbar 'Standard'"
    printlog "-  open"
    Call hToolbarSelect("Standard", true)
    printlog "-  close"
    Call hToolbarSelect("Standard", false)
    printlog "-  reset"
    Call hToolbarSelect("Standard", true, true)

    printlog "- Toolbar 'Standard (Viewing Mode)'"
    printlog "-  open"
    Call hToolbarSelect("StandardViewingMode", true)
    printlog "-  close"
    Call hToolbarSelect("StandardViewingMode", false)
    printlog "-  reset"
    Call hToolbarSelect("StandardViewingMode", true, true)

    printlog "- Toolbar 'Table'"
    printlog "-  open"
    Call hToolbarSelect("Table", true)
    printlog "-  close"
    Call hToolbarSelect("Table", false)
    printlog "-  reset"
    Call hToolbarSelect("Table", true, true)

    printlog "- Toolbar 'Text Object'"
    printlog "-  open"
    Call hToolbarSelect("TextObject", true)
    printlog "-  close"
    Call hToolbarSelect("TextObject", false)
    printlog "-  reset"
    Call hToolbarSelect("TextObject", true, true)

    printlog "- Toolbar 'Tools'"
    printlog "-  open"
    Call hToolbarSelect("Tools", true)
    printlog "-  close"
    Call hToolbarSelect("Tools", false)
    printlog "-  reset"
    Call hToolbarSelect("Tools", true, true)

    printlog "- Toolbar 'Hyperlink Bar'"
    printlog "-  open"
    Call hToolbarSelect("HyperlinkBar", true)
    printlog "-  close"
    Call hToolbarSelect("HyperlinkBar", false)
    printlog "-  reset"
    Call hToolbarSelect("HyperlinkBar", true, true)

    printlog "- Toolbar 'Formula'"
    printlog "-  open"
    Call hToolbarSelect("MATH", true)
    OL_SW_Rechenleiste.TypeKeys "<Enter>"

    printlog " Close active document"
    Call hCloseDocument
endcase

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

testcase tViewTextBoundaries
    PrintLog "- View / Text Boundaries"
    printlog " Open new document"
    Call hNewDocument
    printlog " View / Text Boundaries"
    ViewTextBoundaries
    WaitSlot (2000)
    printlog " View / Text Boundaries"
    ViewTextBoundaries
    printlog " Close active document"
    Call hCloseDocument
endcase

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

testcase tViewFieldShadings
    PrintLog "- View / Field Shadings"
    printlog " Open new document"
    Call hNewDocument
    printlog " View / Field Shadings"
    ViewFieldShadings
    WaitSlot (2000)
    printlog " View / Field Shadings"
    ViewFieldShadings
    printlog " Close active document"
    Call hCloseDocument
endcase

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

testcase tViewFields
    PrintLog "- View / Fields"
    printlog " Open new document"
    Call hNewDocument
    printlog " View / Fields"
    ViewFields
    WaitSlot (2000)
    printlog " View / Fields"
    ViewFields
    printlog " Close active document"
    Call hCloseDocument
endcase

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

testcase tViewNonprintingCharacters
    PrintLog "- View / Nonprinting Characters"
    printlog " Open new document"
    Call hNewDocument
    printlog " View / Nonprinting characters"
    ViewNonprintingCharacters
    WaitSlot (2000)
    printlog " View / Nonprinting characters"
    ViewNonprintingCharacters
    printlog " Close active document"
    Call hCloseDocument
endcase

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

testcase tViewHiddenParagraphs
    printLog "- View / Hidden Paragraphs"
    printlog " Open new document"
    Call hNewDocument
    printlog " View / Hidden paragraphs "
    ViewHiddenParagraphs
    WaitSlot(2000)
    printlog " View / Hidden paragraphs "
    ViewHiddenParagraphs
    printlog " Close active document"
    Call hCloseDocument
endcase

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

testcase tViewWebLayout
    PrintLog "- View / WebLayout"
    printlog " Open new document"
    Call hNewDocument
    printlog " View / Web Layout "
    ViewOnlineLayout
    WaitSlot (2000)
    printlog " View / Online Layout "
    ViewOnlineLayout
    printlog " Close active document"
    Call hCloseDocument
endcase

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

testcase tViewFullScreen
    PrintLog "- View / Full Screen"
    printlog " Open new document"
    Call hNewDocument
    printlog " View / Full Screen "
    ViewFullScreen
    WaitSlot (2000)
    printlog " View / Full Screen "
    ViewFullScreen
    WaitSlot (2000)
    printlog " Close active document"
    Call hCloseDocument
endcase

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

testcase tViewPrintLayout
    PrintLog "- View / Print Layout"
    printlog " ONLY HTML-Document"
    printlog " Open new document"
    Call hNewDocument
    WaitSlot (2000)
    printlog " View / Print Layout "
    ViewPrintLayout
    WaitSlot (2000)
    printlog " View / Print Layout "
    ViewPrintLayout
    printlog " Close active document"
    Call hCloseDocument
endcase

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

testcase tViewStatusBar
    PrintLog "- View / Status Bar"
    printlog " Open new document"
    Call hNewDocument
    printlog " View / Statusbar "
    ViewToolbarsStatusbar
    WaitSlot (2000)
    printlog " View / Print Layout "
    ViewToolbarsStatusbar
    printlog " Close active document"
    Call hCloseDocument
endcase

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

testcase tViewRuler
    PrintLog "- View / Ruler"

    printlog " Open new document"
    Call hNewDocument
    printlog " View / Ruler "
    ViewRuler
    WaitSlot (2000)
    printlog " View / Ruler "
    ViewRuler
    WaitSlot (2000)
    printlog " Close active document"
    Call hCloseDocument
endcase

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

testcase tViewInputMethodStatus
    PrintLog "- View / Input Method Status (only Solaris)"
    if ( Ucase(gPlatform) <> "SOLARIS" ) then 
        printlog( "No testing for IME status for OS <> Solaris" )
        goto endsub
    endif

    PrintLog " Open new document"
    Call hNewDocument
    PrintLog " View / View / Input Method Status"
    try
        ViewInputMethodStatus
    catch
        Warnlog "Menuentry 'Input Method Status' is disabled!"
        Call hCloseDocument
        goto endsub
    endcatch
    WaitSlot (2000)
    PrintLog " View / View / Input Method Status"
    ViewInputMethodStatus
    PrintLog " Close active document"
    Call hCloseDocument
endcase

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

testcase tViewHTMLSource
    PrintLog "- View / HTML Source (only in HTML-Document)"
    if ( gApplication <> "HTML" ) then
        goto endsub
    endif
    
    printlog "Open new document"
    Call hNewDocument
    printlog "View / HTML-Source"
    AnsichtHTMLQuelltext

    printlog "Save-As dialog has to come up"
    Kontext "SpeichernDlg"
    if ( SpeichernDlg.exists( 1 ) ) then
        Dateiname.Settext Convertpath(gofficepath + "user\work\sourcecode.html")
        printlog "Save sourcecode"
        Speichern.Click()
        Kontext "Active"
        If Active.Exists then
            if Active.GetRT = 304 then
                try
                    Active.Yes
                catch
                    Warnlog Active.Gettext
                    Active.Ok
                endcatch
            end if
        end if
    else
        warnlog( "Dialog <SpeichernDlg> is not available" )
    endif

    Kontext "DocumentHTMLSourceView"
    DocumentHTMLSourceView.TypeKeys "Check for bug: #116402"
    wait 500
    printlog "View / HTML-Source"
    AnsichtHTMLQuelltext
    WaitSlot (1000)
    printlog "Close active document"
    Call hCloseDocument
endcase

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

testcase tHtmlDocViewZoom
    gApplication = "HTML"
    printlog " open application"
    Call hNewDocument
    printlog " type something into the document"
    hTypekeys "<RETURN>", 3

    printlog " View -> Zoom"
    ViewZoom
    Kontext "Massstab"
    if ( Massstab.exists( 1 ) ) then
        DialogTest ( Massstab )
        printlog " check checkbox '100%'"
        Vergroesserung100.check
        printlog " check checkbox 'Variable'"
        VergroesserungStufenlos.check
        Massstab.Cancel
    else
        warnlog( "Dialog <Massstab> is not available" )
    endif
    printlog " close application"
    Call  hCloseDocument
    gApplication = "WRITER"
endcase

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

testcase tHtmlDocViewHTMLSource
    PrintLog "- View / HTML Source (only in HTML-Document)"
    gApplication = "HTML"
    printlog "Open new document"
    Call hNewDocument
    printlog "View / HTML-Source"
    AnsichtHTMLQuelltext
    WaitSlot (1000)
    printlog "Save-As dialog has to come up"
    printlog "Save sourcecode"
    Kontext "SpeichernDlg"
    Dateiname.Settext Convertpath(gofficepath + "user\work\sourcecode.html")
    Speichern.Click
    Kontext "Active"
    If Active.Exists then
        if Active.GetRT = 304 then
            try
                Active.Yes
            catch
                Warnlog Active.Gettext
                Active.Ok
            endcatch
        end if
    end if
    wait 500
    Kontext "DocumentHTMLSourceView"
    DocumentHTMLSourceView.TypeKeys "Check for bug: #116402"
    wait 500
    printlog "View / HTML-Source"
    AnsichtHTMLQuelltext
    WaitSlot (1000)
    printlog "Close active document"
    Call hCloseDocument
    gApplication = "WRITER"
endcase

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