summaryrefslogtreecommitdiff
path: root/testautomation/graphics/optional/includes/global/g_navigator.inc
blob: 4b9ef8948ab83172a27a465041e16b8f1ce30d22 (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
'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 : wolfram.garten@oracle.com
'*
'* short description :
'*
'**************************************************************************************
' #1 tdViewNavigator
' #1 tViewNavigatorZOrder
' #1 tViewNavigatorNameActivated
' #1 tViewNavigatorGroupedObjects
'\*************************************************************************************

testcase tdViewNavigator
    dim position1 as integer
    dim zaehler as integer
    dim Ueber_Text_1 as string
    dim Ueber_Text_2 as string
    dim Ueber_Text_3 as string
    dim Ueber_Text_4 as string
    dim Ueber_Text_5 as string
    dim Ueber_Text_6 as string

    Call hNewDocument

    For Zaehler = 1 to 3
        Select Case Zaehler
        Case 1:  Position1 = 20
        Case 2:  Position1 = 30
        Case 3:  Position1 = 40

            ContextPositionAndSize
            kontext
            active.SetPage TabPositionAndSize
            kontext "TabPositionAndSize"
            Select Case Zaehler
            Case 1:   Ueber_Text_4 = PositionX.GetText
            Case 2:   Ueber_Text_5 = PositionX.GetText
            Case 3:   Ueber_Text_6 = PositionX.GetText
            End Select
            printlog "  CHECK: Xposition i: "+Zaehler+": "+PositionX.GetText
            TabPositionAndSize.OK
            Select Case Zaehler
            Case 1,2: InsertSlide
                WaitSlot (2000)
                hTypekeys "<Pagedown>"
                WaitSlot (2000)
            End Select
        Next Zaehler

        WaitSlot (1000)
        Kontext "NavigatorDraw"
        if NavigatorDraw.exists (5) then printlog "OK"
            Ueber_Text_2 = "OK   First"
            Ueber_Text_3 = "First doesnt work"
            Call Position_Vergleichen (Ueber_Text_1,Ueber_Text_2,Ueber_Text_3)
            WaitSlot (1000)
            Kontext "NavigatorDraw"
            Ueber_Text_2 = "OK   Next"
            Ueber_Text_3 = "Next doesnt work"
            Call Position_Vergleichen (Ueber_Text_1,Ueber_Text_2,Ueber_Text_3)
            Kontext "NavigatorDraw"
            WaitSlot (1000)
            Ueber_Text_2 = "OK   Last"
            Ueber_Text_3 = "Last doesnt work"
            Call Position_Vergleichen (Ueber_Text_1,Ueber_Text_2,Ueber_Text_3)
            WaitSlot (1000)
            Kontext "NavigatorDraw"
            Vorherige.Click
            Ueber_Text_1 = Ueber_Text_5
            Ueber_Text_2 = "OK   Before this"
            Ueber_Text_3 = "Before this doesnt work"
            Call Position_Vergleichen (Ueber_Text_1,Ueber_Text_2,Ueber_Text_3)

            WaitSlot (1000)
            Kontext "NavigatorDraw"
            try
                Kontext "Navigator"
            catch
                hTypeKeys "<SHIFT MOD1 F5>"
                Warnlog "- Unable to reach the Navigator, tried to use the keyboard Shortcut (MOD1 F5) to close it."
            endcatch

            Kontext "Navigator"
            if Navigator.exists then
                Navigator.Close
                Warnlog "Navigator: should be closed at this point, but was not."
            else
                printlog "Navigator: Not available - Good."
            end if

            WaitSlot (1000)
            Call hCloseDocument
endcase   'tdViewNavigator

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

testcase tViewNavigatorZOrder
    qaerrorlog "Not yet ready."
    goto endsub

    dim zPosition(4)
    dim Counter as integer
    dim MaxCounter as integer
    dim PositionName as string
    dim CheckingValue as string

    Call hNewDocument

    zPosition(1) = "10"
    zPosition(2) = "15"
    zPosition(3) = "20"
    zPosition(4) = "25"

    For Counter = 1 to 4
        Call hRechteckErstellen ((zPosition(Counter)), (zPosition(Counter)), 60, 60)
        WaitSlot (1000)
        printlog "Name the Objects according to their Z-Order. (" +Counter + ")"
        hOpenContextMenu
        WaitSlot (1000)
        'Choose rename.
        if hMenuFindSelect(27027, true, 16) = false then
            Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends."
            Call hCloseDocument
            Goto Endsub
        end if
        kontext "NameDlgObject"
        NameField.SetText "Object" + Counter
        NameDlgObject.OK
        hTypeKeys "<ESCAPE>"
    Next Counter

    printlog "check"

    Kontext "NavigatorDraw"
    if (gApplication = "IMPRESS") then
        try
            warnlog "- the Navigator was open, check earlier ran tests for inconsistency."
            hTypeKeys "<SHIFT MOD1 F5>"
        catch
            hTypeKeys "<SHIFT MOD1 F5>"
        endcatch
    else
        Kontext "NavigatorDraw"
        try
            Warnlog "- the Navigator was open, check earlier ran tests for inconsistency."
            hTypeKeys "<F5>"
        catch
            hTypeKeys "<F5>"
        endcatch
    end if

    '    * Check if the Navigator contains the 'Show Shapes' drop down menu.

    kontext "NavigatorDraw"
    Dragmodus.OpenMenu

    MaxCounter = MenuGetItemCount
    if MaxCounter <> 0 then
        For Counter = 1 to MaxCounter
            printlog "Entry (Dragmode): '" + (MenuGetItemText(MenuGetItemID (Counter))) + "' Found."
        Next Counter
    end if

    hMenuSelectNr (0)


    Shapesfilter.OpenMenu
    MaxCounter = MenuGetItemCount
    For Counter = 1 to MaxCounter
        printlog "Entry (Shapesfilter): '" + (MenuGetItemText(MenuGetItemID (Counter))) + "' Found."
    Next Counter
    hMenuSelectNr (0)

    Printlog " "

    'Dokumentliste.Click

    kontext "NavigatorDraw"

    'Main part of the Navigator: the list with it's contents.

    Liste.TypeKeys "<PAGEDOWN>"
    CheckingValue = Liste.GetSelText
    printlog CheckingValue

    Liste.TypeKeys "<RIGHT>"
    Liste.TypeKeys "<DOWN>"
    CheckingValue = Liste.GetSelText
    printlog CheckingValue
    Liste.TypeKeys "<DOWN>"
    CheckingValue = Liste.GetSelText
    printlog CheckingValue
    Liste.TypeKeys "<DOWN>"
    CheckingValue = Liste.GetSelText
    printlog CheckingValue
    Liste.TypeKeys "<DOWN>"
    CheckingValue = Liste.GetSelText
    printlog CheckingValue
    printlog "ok?"


    '*NavigatorDraw         HID_SD_NAVIGATOR
    'NavigatorToolboxDraw   HID_SD_NAVIGATOR_TBX
    'Stift                  HID_SD_NAVIGATOR_TBI_PEN
    'Erste                  HID_SD_NAVIGATOR_TBI_FIRST
    'Vorherige              HID_SD_NAVIGATOR_TBI_PREV
    'Naechste               HID_SD_NAVIGATOR_TBI_NEXT
    'Letzte                 HID_SD_NAVIGATOR_TBI_LAST

    'Context-menu framställbar?
    'Dragmodus              HID_SD_NAVIGATOR_TBI_DRAGTYPE

    'Liste                  HID_SD_NAVIGATOR_TLB

    'Den undre scroll-delen.
    'Dokumentliste          HID_SD_NAVIGATOR_LB

    '    * the drop  down menu must contain the entries 'Named shapes' and 'All Shapes'

    Kontext "Navigator"
    try
        Navigator.Close
    catch
        printlog "Nope"
    endcatch

    '    * check if 'Named shapes' is selected by default

    '    * insert 5 shapes in the Document. the shapes should overlap slightly.
    '    * there must be no entry in the navigator
    '    * name 1 shape (context menu of the shape / name...)
    '    * there must appear 1 entry 'under' the corresponding slide in the navigator
    '    * Select All shapes in the Show shapes drop down menu
    '    * there must be 5 shapes in the navigator
    '    * change the order of the shapes in the navigator
    '    * the z-order of the shapes must stay
    '    * delete 1 shape from the slide
    '    * the automatic generated names of the shapes must change and no shape name must be duplicate. The changed shape name must stay

    '    * select 2 shapes and group them
    '    * an entry with a small plus in front must appear in the navigator
    '    * click on the plus
    '    * there must be an additional tree with the 2 shapes of the group

    Call hCloseDocument
endcase 'tViewNavigatorZOrder

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

testcase tViewNavigatorNameActivated
    qaerrorlog "Not yet ready."
    goto endsub
    dim zPosition1 as integer
    dim zPosition2 as integer
    dim zPosition3 as integer
    dim zPosition4 as integer
    dim counter as integer

    Call hNewDocument

    Call hRechteckErstellen ( Position1, Position1, 60, 60)

endcase 'tViewNavigatorNameActivated

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

testcase tViewNavigatorGroupedObjects
    qaerrorlog "Not yet ready."
    goto endsub
    dim zPosition1 as integer
    dim zPosition2 as integer
    dim zPosition3 as integer
    dim zPosition4 as integer
    dim counter as integer

    Call hNewDocument

    Call hRechteckErstellen ( Position1, Position1, 60, 60)


endcase 'tViewNavigatorGroupedObjects

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