summaryrefslogtreecommitdiff
path: root/testautomation/graphics/optional/includes/global/g_area.inc
blob: db56e3252af1205f746ac69ac4e82c67dc9179e6 (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
'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_area.inc,v $
'*
'* $Revision: 1.1 $
'*
'* last change: $Author: jsi $ $Date: 2008-06-16 10:42:39 $
'*
'* 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 : wolfram.garten@sun.com
'*
'* short description :
'*
'**************************************************************************************
' #1 tiFormatArea
' #1 tdFormatArea1
'\*************************************************************************************

testcase tiFormatArea
    Dim i
    Dim Zaehler
    dim Entf$

    FormatArea
    Kontext
    active.SetPage TabArea
    Kontext "TabArea"
    Kontext
    active.SetPage TabSchatten
    kontext "TabSchatten"
    Sleep 3

    Printlog "  - Test various formats"
    Kontext
    active.SetPage TabArea
    Kontext "TabArea"
    if NOT FillOptions.GetSelIndex = 5 then
        Warnlog "Bitmap is not checked"
    else
        if BitmapList.GetSelIndex <> 3 then Warnlog "Wrong bitmap used. "+ BitmapAuswahl.GetSelIndex
            if NOT Tile.IsChecked then Warnlog "Tile is not checked"
                '      if Original.IsChecked then Warnlog "Original is not checked"
                '      if NOT Relativ.IsChecked then Warnlog "Relative is not checked"
                '      if Breite.GetText <> "90 %" then Warnlog "Width is not 90%, it is:  "+Breite.GetText
                '      if XOffset.GetText <> "30 %" then Warnlog "XOffset is not 30%, it is:  "+XOffset.GetText
                '      if NOT Zeile.IsChecked then Warnlog "Line is not checked"
                '      if Verschiebung.GetText <> "20 %" then Warnlog "Displace is not 20%, it is:  " + Verschiebung.GetText
                Kontext
                active.SetPage TabSchatten
                kontext "TabSchatten"
                if NOT Anzeigen.IsChecked then
                    Warnlog "Show shadows is not checked"
                else
                    if Entfernung.GetText <> Entf$ then Warnlog "Distance is not " + Entf$ + " it is: "+ Entfernung.GetText
                        if Farbe.GetSelIndex <> 15 then Warnlog "Wrong color for shadow. It is: "+ Farbe.GetSelIndex
                        end if
                    end if
                    TabSchatten.Cancel

endcase

testcase tdFormatArea1

    Dim i
    Dim j
    Dim k
    Dim m
    Dim n
    Dim Winkel_1 as string
    Dim ZaehlerFarbe
    Dim ZaehlerVerlauf
    Dim ZaehlerSchraffur
    Dim ZaehlerBitmap
    Dim ColorName$
    ColorName$ = "Bullshit"
    dim Zaehler as integer

    sleep 3
    sleep 2
    Kontext
    Active.SetPage TabArea
    Kontext "TabArea"
    sleep 2
    TabArea.OK
    sleep 1
    FormatArea
    Kontext
    Active.SetPage TabArea
    Kontext "TabArea"
    ZaehlerVerlauf = GradientList.GetItemCount
    for j = 1 To 2
        GradientList.Select j
        TabArea.OK
        FormatArea
        Kontext
        Active.SetPage TabArea
        Kontext "TabArea"
        PrintLog GradientList.GetSelText
    next j
    HatchingList.GetItemCount
    ZaehlerSchraffur = HatchingList.GetItemCount
    for k=1 to 2'ZaehlerSchraffur
        HatchingList.Select k
        TabArea.OK
        FormatArea
        Kontext
        Active.SetPage TabArea
        Kontext "TabArea"
        PrintLog HatchingList.GetSelText
    next k

    BitmapList.GetItemCount
    ZaehlerBitmap = BitmapList.GetItemCount
    for n=1 to ZaehlerBitmap
        BitmapList.Select n
        TabArea.OK
        FormatArea
        sleep 1
        Kontext
        Active.SetPage TabArea
        Kontext "TabArea"
        PrintLog BitmapList.GetSelText
    next n

    '  if Anpassen.IsEnabled = False Then PrintLog " Option Tile activated"
    '  if Anpassen.IsEnabled = True Then WarnLog " Option Tile not activated"
    '  if Relativ.IsChecked = False Then
    '     SetClipboard Breite.GetText
    '     Relativ.Check
    '   If Breite.GetText = GetClipboardText Then
    '   WarnLog "  Relative isnt working"
    '   else
    '   PrintLog "   Relative works"
    '   end if
    '  end if
    '
    '  if Kacheln.IsChecked = True Then Kacheln.UnCheck
    '  Anpassen.Check
    '  if Relativ.IsEnabled = True Then WarnLog "   Option Anpassen konnte nicht aktiviert werden"
    '  if not Relativ.IsEnabled Then PrintLog "   Option Anpassen funktioniert"
    '  Anpassen.Uncheck
    '  Original.Check
    '  if Breite.IsEnabled And Hoehe.IsEnabled = True Then WarnLog "   Button Original funktioniert nicht"
    '  if Breite.IsEnabled And Hoehe.IsEnabled = False Then PrintLog "   Button Original funktioniert"
    '  Kacheln.Check
    '  setClipboard XOffset.GetText
    '  XOffset.More 3
    '  if XOffset.GetText <> GetClipboardText Then PrintLog "   Position XOffset funktioniert"
    '  if XOffset.GetText = GetClipboardText Then WarnLog "    Position XOffset funktioniert nicht"
    '  SetClipboard YOffset.GetText
    '  YOffset.More 5
    '  if YOffset.GetText <> GetClipboardText Then PrintLog "   Position YOffset funktioniert"
    '  if YOffset.GetText = GetClipboardText Then WarnLog "    Position YOffset funktioniert nicht"
    '  PrintLog "        TabArea fertig"
    Kontext
    Active.SetPage TabSchatten
    Kontext "TabSchatten"
    sleep 1
    sleep 1
    PrintLog "   Show shadow works"
else
    WarnLog "   Show shadow does not work"
end if

Entfernung.More 4
if GetClipboardText = Entfernung.GetText Then
    WarnLog "   Distance does not work"
else
    PrintLog "   Distance does work"
end if

Kontext
Active.SetPage TabFarben
Kontext "TabFarben"
Farbe.Select 24
sleep 1
Farbe.Select 18
sleep 1
Farbe.Select 7
Aendern.Click
sleep 1
TabFarben.OK
FormatArea
Kontext
Active.SetPage TabArea
Kontext "TabArea"
FillOptions.Select 2
if ColourList.GetSelText = "Bullshit" Then
    PrintLog " Color selection changed "
else
    WarnLog " Color selection not changed"
end if
Kontext
Active.SetPage TabFarben
Kontext "TabFarben"
Farbmodell.Select 1

Kontext
Kontext "TabFarben"
printlog "   Selected colourmodel RGB?: "+Farbmodell.GetSelText
if left(Farbmodell.GetSelText,1) <> "R" then warnlog "not RGB selected ? :-("
    try
        R.SetText "50"
        G.SetText "10"
        B.SetText "90"
    catch
        warnlog "RGB text fields are not enabled :-("
    endcatch
    Aendern.Click
    TabFarben.OK
    Kontext "DocumentDraw"
    FormatArea
    Kontext
    Active.SetPage TabFarben
    Kontext "TabFarben"
    if (R.GetText = "50" And G.GetText = "10" And B.GetText = "90") Then
        PrintLog "Changes in RGB done"
    else
        WarnLog " Chancges in RGB values not recognized, instead of R=50 , G=10 und B=90  it is " +R.GetText + " " + G.GetText + " " + B.GetText
    end if
    Farbe.Select 10
    Hinzufuegen.Click
    Farbe.Select "Brighter"
    Kontext "Active"
    Active.Yes
    Kontext
    Active.SetPage TabFarben
    Kontext "TabFarben"
    Kontext  "FarbeDlg"
    FarbeDlg.OK
    sleep 2
    Kontext
    Active.SetPage TabFarben
    Kontext "TabFarben"
    TabFarben.OK
    FormatArea
    Kontext
    Active.SetPage TabFarben
    Kontext "TabFarben"
    TabFarben.OK

    FormatArea
    Kontext
    Active.SetPage TabFarbverlaeufe
    Kontext "TabFarbverlaeufe"
    TabFarbverlaeufe.OK
    sleep 2

    FormatArea
    sleep 2
    Kontext
    Active.SetPage TabTransparenz
    Kontext "TabTransparenz"
    Printlog "- No transparency is checked, all controls should be disabled."
    if MFLinTransparenz.IsEnabled Then Warnlog "- Transparency enabled"
        if TransparenzverlaufTyp.IsEnabled Then Warnlog "- Graidient enabled"
            if MFZentrumX.IsEnabled Then Warnlog "- Center X enabled"
                if MFZentrumY.IsEnabled Then Warnlog "- Center Y enabled"
                    if MFWinkel.IsEnabled Then Warnlog "- Angle enabled"
                        if MFRand.IsEnabled Then Warnlog "- Border enabled"
                            if MFStartwert.IsEnabled Then Warnlog "- Start value enabled"
                                if MFEndwert.IsEnabled Then Warnlog "- End value enabled"

                                    sleep 1
                                    if MFLinTransparenz.GetText <>"100%" Then Warnlog "- Maximum value not correct"
                                        MFLinTransparenz.ToMin
                                        if MFLinTransparenz.GetText <>"0%" Then Warnlog "- Minimum value not correct"
                                            if TransparenzverlaufTyp.IsEnabled Then Warnlog "- Gradient enabled"
                                                if MFZentrumX.IsEnabled Then Warnlog "- Centrum X enabled"
                                                    if MFZentrumY.IsEnabled Then Warnlog "- Centrum Y enabled"
                                                        if MFWinkel.IsEnabled Then Warnlog "- Angle enabled"
                                                            if MFRand.IsEnabled Then Warnlog "- Border enabled"
                                                                if MFStartwert.IsEnabled Then Warnlog "- Start value enabled"
                                                                    if MFEndwert.IsEnabled Then Warnlog "- End value enabled"

                                                                        Transparenzverlauf.Check
                                                                        Printlog "- Gradient for transprency enabled"
                                                                        if MFLinTransparenz.IsEnabled = "false" Then Warnlog "- Transparency disabled"
                                                                            if TransparenzverlaufTyp.IsEnabled = "false"  Then Warnlog "- Gradient disabled"
                                                                                if MFZentrumX.IsEnabled = "false" Then Warnlog "- Center X disabled"
                                                                                    if MFZentrumY.IsEnabled = "false" Then Warnlog "- Center Y disabled"
                                                                                        if MFWinkel.IsEnabled = "false" Then Warnlog "- Anlge disabled"
                                                                                            if MFRand.IsEnabled = "false" Then Warnlog "- Border disabled"
                                                                                                if MFStartwert.IsEnabled = "false" Then Warnlog "- Start value disabled"
                                                                                                    if MFEndwert.IsEnabled = "false" Then Warnlog "- End value disabled"

                                                                                                        Printlog "- Check if changed values are saved"

                                                                                                        Zaehler=TransparenzverlaufTyp.GetItemCount
                                                                                                        for i=1 to Zaehler
                                                                                                            TransparenzverlaufTyp.Select i
                                                                                                            SetClipboard Transparenzverlauftyp.GetSelText
                                                                                                            TabTransparenz.OK
                                                                                                            sleep 2
                                                                                                            FormatArea
                                                                                                            sleep 1
                                                                                                            Kontext
                                                                                                            Kontext "TabTransparenz"
                                                                                                            if not Transparenzverlauftyp.GetSelIndex = i Then Warnlog "- Values are not correct for gradient transparency"
                                                                                                            next i
                                                                                                            TransparenzverlaufTyp.Select 2
                                                                                                            if MFZentrumX.IsEnabled Then Warnlog "- Center X should not be enabled"
                                                                                                                if MFZentrumY.IsEnabled Then Warnlog "- Center Y should not be enabled"
                                                                                                                    MFWinkel.SetText "45"
                                                                                                                    Winkel_1 = MFWinkel.GetText
                                                                                                                    TabTransparenz.OK
                                                                                                                    sleep 2
                                                                                                                    FormatArea
                                                                                                                    sleep 2
                                                                                                                    Kontext
                                                                                                                    Active.SetPage TabTransparenz
                                                                                                                    Kontext "TabTransparenz"
                                                                                                                    if TransparenzverlaufTyp.GetSelIndex <>2 Then
                                                                                                                        Warnlog "- Second menu-item is not choosen"
                                                                                                                    end if
                                                                                                                    TransparenzverlaufTyp.Select 3
                                                                                                                    if MFWinkel.GetText <> Winkel_1 then Warnlog "- The inserted value is not accepted"
                                                                                                                        if MFWinkel.GetText <> Winkel_1 Then TransparenzverlaufTyp.Select 3
                                                                                                                            if MFWinkel.IsEnabled Then Warnlog " - Angle should not be active when Radial is choosen"
                                                                                                                                sleep 1
                                                                                                                                MFZentrumX.SetText "30"
                                                                                                                                MFZentrumY.SetText "30"
                                                                                                                                TabTransparenz.OK
                                                                                                                                sleep 2
                                                                                                                                FormatArea
                                                                                                                                sleep 2
                                                                                                                                Kontext
                                                                                                                                Active.SetPage TabTransparenz
                                                                                                                                Kontext "TabTransparenz"
                                                                                                                                if MFZentrumX.GetText <> "30%" Then Warnlog "- Setted value for Center X is not applied."
                                                                                                                                    if MFZentrumY.GetText <> "30%" Then Warnlog "- Setted value for Center Y is not applied."
                                                                                                                                        MFRand.SetText "10"
                                                                                                                                        MFStartwert.SetText "20"
                                                                                                                                        MFEndwert.SetText "30"
                                                                                                                                        TabTransparenz.OK
                                                                                                                                        sleep 2
                                                                                                                                        FormatArea
                                                                                                                                        sleep 2
                                                                                                                                        Kontext
                                                                                                                                        Active.SetPage TabTransparenz
                                                                                                                                        Kontext "TabTransparenz"
                                                                                                                                        if MFRand.GetText <> "10%" Then Warnlog "- Border-value was not set."
                                                                                                                                            if MFEndwert.GetText <> "30%" Then Warnlog "- End-value was not set."
                                                                                                                                                if MFStartwert.GetText <> "20%" Then Warnlog "- Start-value was not set."
                                                                                                                                                    TabTransparenz.OK


endcase