summaryrefslogtreecommitdiff
path: root/testautomation/writer/required/includes/w_001a_.inc
blob: cbfd5de23047ffc2063ad65d25bc4a91d6905aa8 (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
'**************************************************************************
'* 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: w_001a_.inc,v $
'*
'* $Revision: 1.2 $
'*
'* last change: $Author: vg $ $Date: 2008-08-18 12:40:41 $
'*
'* 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@sun.com
'*
'* short description:  Testcases for the Writer Required-test.
'*
'\***********************************************************************

sub w_001a_

    printLog Chr(13) + "--------- File Menu (w_001a_.inc) ----------"
    gApplication = "WRITER"

    Call tFileProperties

    Call tFileTemplatesOrganize
    Call tFileTemplatesAddressbookSource
    Call tFileTemplatesSave
    Call tFileTemplatesEdit

    Call tFilePagePreview
    Call tFilePrint
    Call tFilePrinterSetup

    'Writer Master Document
    gApplication = "MASTERDOCUMENT"
    Call tMasterDocFilePagePreview
    gApplication = "WRITER"

end sub

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

testcase tFileProperties
    PrintLog "- File / Properties"

    printlog " Open new document"
    Call hNewDocument

    printlog " File / Properties"
    FileProperties

    WaitSlot(5000)
    Kontext
    try
        active.SetPage TabDokument
    catch
        Warnlog "Dialog 'FileProperties' not up! (Bug#99828)"
        goto endsub
    endcatch

    printlog " Switch to Tabpage 'General'"
    Kontext "TabDokument"
    Call DialogTest (TabDokument)

    printlog " Switch to Tabpage 'Description'"
    Kontext
    active.SetPage TabDokumentinfo
    Kontext "TabDokumentinfo"
    Call DialogTest (TabDokumentinfo)


    QAErrorlog "#i95523# - FileProperties - Tabpage 'User Defined' has changed. - Adaption of testcases needed."
    '    printlog " Switch to Tabpage 'User defined'"
    '    Kontext
    '    active.SetPage TabBenutzer
    '    Kontext "TabBenutzer"
    '    Call DialogTest ( TabBenutzer )

    '    Wait 500

    '    Infofelder.Click
    '    printlog " Click 'Infofields'"
    '    Kontext "InfonamenBearbeiten"
    '    printlog " Close upcoming dialog with 'Cancel'"
    '    Call DialogTest (InfonamenBearbeiten)
    '    InfonamenBearbeiten.Cancel

    printlog " Switch to Tabpage 'Internet'"
    Kontext
    active.SetPage TabInternet
    Kontext "TabInternet"
    Call DialogTest (TabInternet)

    printlog " Switch to Tabpage 'Statistics' and close dialog"
    Kontext
    active.SetPage TabStatistik
    Kontext "TabStatistik"
    Call DialogTest (TabStatistik)
    TabStatistik.Close

    Sleep 1
    printlog " Close active document"
    Call hCloseDocument
endcase

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

testcase tFileTemplatesOrganize
    Dim i as integer

    PrintLog " Open new document."
    Call hNewDocument
    PrintLog " File / Templates / Organize"
    FileTemplatesOrganize
    Kontext "DVVerwalten"
    For i = 1 to 50
        if DVVerwalten.Exists then
            i = 51
        else
            Sleep 5
        end if
    next i
    if Not DVVerwalten.Exists then
        Warnlog "Dialog 'Template Management' not up !"
        Call hCloseDocument
        goto endsub
    end if
    wait 500
    PrintLog " Select first entry in left list of dialog 'Template Management' (should be 'My Templates')"
    ListeLinks.Select 1
    ListeLinks.TypeKeys "<Home>"
    Sleep 1
    Befehle.Click
    wait 500
    PrintLog " Select 'Commands -> Import Template'"
    Call hMenuSelectNr(3)
    Wait 500
    PrintLog " Close Filedialog."
    if gUseSysDlg = False then
        Kontext "OeffnenDlg"
        if OeffnenDlg.Exists then
            OeffnenDlg.Cancel
        else
            Warnlog "FileOpen dialog not up!"
        end if
    end if

    PrintLog " Select 'Commands -> Printer Settings"
    Kontext "DVVerwalten"
    Sleep 1
    Befehle.Click
    wait 500
    Call hMenuSelectNr(4)

    PrintLog " Cancel 'Printer-Setup' dialog"
    Kontext "DruckerEinrichten"
    if DruckerEinrichten.Exists then
        DruckerEinrichten.Cancel
    else
        Warnlog "Printersettings dialog is not up!"
    end if

    PrintLog " Select first entry in right list"
    Kontext "DVVerwalten"
    ListeRechts.Select 1

    PrintLog " Select pushbutton 'File..'"
    if WelcheDatei.IsEnabled then
        WelcheDatei.Click
        if gUseSysDlg = False then
            PrintLog " Cancel Filedialog"
            Kontext "OeffnenDlg"
            OeffnenDlg.Cancel
        end if
    end if

    PrintLog " Select pushbutton 'Address Book'"
    Kontext "DVVerwalten"
    AddressBook.Click
    Kontext "AddressbookSource"
    PrintLog " Cancel Dialog 'Address Book-Assignment'"
    if AddressbookSource.Exists then
        AddressbookSource.Cancel
    else
        Warnlog "the Dialog ' Address Book Source' wasnt up!"
    end if

    PrintLog " Close dialog"
    Kontext "DVVerwalten"
    DVVerwalten.Close

    PrintLog " Close active document."
    Call hCloseDocument
endcase

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

testcase tFileTemplatesAddressbookSource

    PrintLog " Open new document"
    Call hNewDocument

    PrintLog " File / Templates /Address Book Source..."
    UseBindings
    FileTemplatesAddressbookSource

    WaitSlot(2000)
    PrintLog " In 'Address Book Assignement' dialog click pushbutton 'Administrate'"
    Kontext "AddressbookSource"
    if AddressbookSource.Exists then
        Call DialogTest (AddressbookSource)
        Administrate.Click
        Sleep 2
        PrintLog " Close 'Data Source Administration' with 'Cancel'"
        Kontext "DatabaseProperties"
        if Not DatabaseProperties.Exists then
            Kontext "AddressSourceAutopilot"
            if AddressSourceAutopilot.Exists then
                AddressSourceAutopilot.Cancel
            end if
            Kontext "AddressbookSource"
            AddressbookSource.Cancel
        else
            PrintLog " DatabaseProperties.SetPage TabConnection"
            Kontext "TabConnection"
            Call DialogTest ( TabConnection )
            Kontext "DatabaseProperties"
            DatabaseProperties.Close
            Kontext "AddressbookSource"
            PrintLog " Close dialog"
            AddressbookSource.Cancel
        end if
    end if

    printlog " Close active document"
    Call hCloseDocument
endcase

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

testcase tFileTemplatesSave
    if gApplication = "MASTERDOCUMENT" then
        qaErrorLog "    tFileTemplatesSave has been disabled in Masterdocument."
        goto endsub
    end if
    printlog "- File / Templates / Save"
    Call hNewDocument
    printlog " Open new document"
    FileTemplatesSave
    printlog " File / Templates / Save"

    Kontext "DokumentVorlagen"
    Call DialogTest ( DokumentVorlagen )
    printlog " On 'Templates' dialog click 'Organizer'"

    Verwalten.Click
    Kontext "DVVerwalten"
    DVVerwalten.Close
    printlog " Close dialog 'Template Management'"

    Kontext "DokumentVorlagen"
    DokumentVorlagen.Cancel
    printlog " Close 'Templates' dialog"

    printlog " Close active document"
    Call hCloseDocument
    gApplication = "WRITER"
endcase

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

testcase tFileTemplatesEdit
    printlog "- File / Templates / Edit"

    printlog " Open new document"
    Call hNewDocument
    printlog " File / Templates / Edit"
    FileTemplatesEdit

    if gUseSysDlg = False then
        printlog " Cancel Filedialog"
        Kontext "OeffnenDlg"
        OeffnenDlg.Cancel
    end if

    printlog " Close active document"
    Call hCloseDocument
endcase

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

testcase tFilePagePreview
    PrintLog "- File / Page Preview"
    Dim gehtnicht as boolean
    gehtnicht = FALSE
    printlog " Open new document"
    Select Case gApplication
    Case "WRITER"
        Call hNewDocument

    Case "MASTERDOCUMENT"
        Call hNewDocument

    Case "HTML"
        printlog "Not in Writer/Web!"
        goto endsub
    end select

    printlog " Enter some text in document"
    Call wTypeKeys("Just a small change!")
    printlog " File / Page Preview"
    FilePageView
    WaitSlot (1000)
    Kontext "DocPageViewWriter"
    if DocPageViewWriter.NotExists then
        Warnlog "Page Preview is not coming up!"
        Kontext "Active"
        if Active.Exists then
            if Active.GetRT = 304 then
                Active.No
            end if
        end if
    else
        if gehtnicht=FALSE then
            Kontext "PreviewObjectbar"
            if PreviewObjectbar.Exists = False then Call hToolbarSelect("PagePreview", true)
            printlog " Select 'Zoom 100%' in toolbar"
            try
                Massstab.Select 4
            catch
                Warnlog "Unable to change Zoom factor in toolbar! (Bug#110498)"
            endcatch

            printlog " Click 'Print Page Preview' in toolbar"
            Kontext "PreviewObjectbar"
            DruckenSeitenansicht.Click
            Kontext "Active"
            if Active.Exists then
                QAErrorlog "No default printer!"
                Active.ok
                Sleep 1
                Kontext "DruckenDlg"
                if DruckenDlg.Exists then DruckenDlg.Cancel
            else
                printlog " Close 'Print' dialog with cancel"
                Kontext "DruckenDlg"
                DruckenDlg.Cancel
            end if

            printlog " Click 'Print options page preview' in toolbar"
            Kontext "PreviewObjectbar"
            Skalierung.Click
            printlog " Close 'Print Options' dialog with cancel"
            Kontext "DruckOptionen"
            Call DialogTest ( DruckOptionen )
            DruckOptionen.Cancel

            printlog " Close Page Preview with button 'Close Preview' in toolbar"
            Kontext "PreviewObjectbar"
            SeitenansichtSchliessen.Click
        else
            Warnlog "Objectbar not addressable!"
        end if
    end if
    printlog " Close active document"
    Call hCloseDocument
endcase

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

testcase tFilePrint
    PrintLog " Open new document"
    Call hNewDocument

    PrintLog " File / Print"
    FilePrint

    Kontext "Active"
    WaitSlot(1000)
    if Active.Exists then
        if Active.GetRT = 304 then
            QAErrorlog "No Default Printer!"
            Active.Ok
            Kontext "DruckenDlg"
            if DruckenDlg.Exists then DruckenDlg.Cancel
            Call hCloseDocument
            goto endsub
        end if
    end if
    Kontext "DruckenDlg"
    if DruckenDlg.Exists then
        PrintLog " In printer dialog click 'Options'"
        Zusaetze.Click
        Sleep 1

        Kontext "DruckerZusaetzeWriter"
        PrintLog " Close 'Print options' with 'Cancel'"
        DruckerZusaetzeWriter.Cancel
        Kontext "DruckenDlg"

        if gPlatGroup = "unx" then
            if NOT Eigenschaften.IsEnabled AND gPlatform = "osx" then
                QAErrorlog "#i81545#-macport File -> Print|Printer Settings: Properties button disabled"
                Kontext "DruckenDlg"
                DruckenDlg.Cancel
                Call hCloseDocument
                goto endsub
            end if
            PrintLog " On Unix-Platforms select 'Properties"
            Eigenschaften.Click
            sleep (3)
            Kontext "TabSPAPaper"
            if NOT TabSPAPaper.Exists then
                Kontext "TabSPADevice"
                if NOT TabSPADevice.Exists then
                    Warnlog "#i88799# - Non functional options-button in Print-dialog."
                else
                    Kontext
                    Active.Setpage TabSPAPaper
                    Kontext "TabSPAPaper"
                    Call DialogTest ( TabSPAPaper )

                    printlog( "ALLES WIRD GUT!" )
                    Kontext
                    Active.Setpage TabSPADevice
                    Kontext "TabSPADevice"
                    Call DialogTest ( TabSPADevice )

                    PrintLog " Cancel Printer Properties' (only unix)"
                    TabSPADevice.Cancel
                end if
            else
                Kontext
                Active.Setpage TabSPAPaper
                Kontext "TabSPAPaper"
                Call DialogTest ( TabSPAPaper )

                printlog( "ALLES WIRD GUT!" )
                Kontext
                Active.Setpage TabSPADevice
                Kontext "TabSPADevice"
                Call DialogTest ( TabSPADevice )

                PrintLog " Cancel Printer Properties' (only unix)"
                TabSPADevice.Cancel
            end if
        end if
        Kontext "DruckenDlg"
        Call DialogTest ( DruckenDlg )
        PrintLog " Close 'Print' dialog"
        DruckenDlg.Cancel
    else
        Warnlog "Print dialog is not up !"
    end if

    PrintLog " Close active document"
    Call hCloseDocument
endcase

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

testcase tFilePrinterSetup
    PrintLog " Open new document"
    Call hNewDocument

    PrintLog " File / Printer Settings"
    FilePrintersettings
    Kontext "Active"
    WaitSlot(1000)
    if Active.Exists then
        if Active.GetRT = 304 then
            QAErrorLog "No Default Printer!"
            Active.Ok
            Sleep 2
            Kontext "DruckerEinrichten"
            if DruckerEinrichten.Exists then
                Call DialogTest ( DruckerEinrichten )
                DruckerEinrichten.Cancel
            end if
        end if
    else
        Kontext "DruckerEinrichten"
        Call DialogTest ( DruckerEinrichten )
        DruckerEinrichten.Cancel
        PrintLog " Cancel 'Printer Setup' dialog"
    end if
    PrintLog " Close active document"
    Call hCloseDocument
endcase

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

testcase tMasterDocFilePagePreview
    PrintLog "- File / Page Preview"
    Dim gehtnicht as boolean
    gehtnicht = FALSE
    gApplication   = "MASTERDOCUMENT"
    printlog " Open new document"
    Call hNewDocument

    printlog " Enter some text in document"
    Call wTypeKeys("Just a small change!")
    printlog " File / Page Preview"
    FilePageView
    WaitSlot (1000)
    Kontext "DocPageViewWriter"
    if DocPageViewWriter.NotExists then
        Warnlog "Page Preview is not coming up!"
        Kontext "Active"
        if Active.Exists then
            if Active.GetRT = 304 then
                Active.No
            end if
        end if
    else
        if gehtnicht=FALSE then
            Kontext "PreviewObjectbar"
            if PreviewObjectbar.Exists = False then Call hToolbarSelect("PagePreview", true)
            printlog " Select 'Zoom 100%' in toolbar"
            try
                Massstab.Select 4
            catch
                Warnlog "Unable to change Zoom factor in toolbar! (Bug#110498)"
            endcatch

            printlog " Click 'Print Page Preview' in toolbar"
            Kontext "PreviewObjectbar"
            DruckenSeitenansicht.Click
            Kontext "Active"
            if Active.Exists then
                QAErrorlog "No default printer!"
                Active.ok
                Sleep 1
                Kontext "DruckenDlg"
                if DruckenDlg.Exists then DruckenDlg.Cancel
            else
                printlog " Close 'Print' dialog with cancel"
                Kontext "DruckenDlg"
                DruckenDlg.Cancel
            end if

            printlog " Click 'Print options page preview' in toolbar"
            Kontext "PreviewObjectbar"
            Skalierung.Click
            printlog " Close 'Print Options' dialog with cancel"
            Kontext "DruckOptionen"
            Call DialogTest ( DruckOptionen )
            DruckOptionen.Cancel

            printlog " Close Page Preview with button 'Close Preview' in toolbar"
            Kontext "PreviewObjectbar"
            SeitenansichtSchliessen.Click
        else
            Warnlog "Objectbar not addressable!"
        end if
    end if

    printlog " Close active document"
    Call hCloseDocument
    gApplication = "WRITER"
endcase