summaryrefslogtreecommitdiff
path: root/testautomation/graphics/optional/includes/impress/i_view.inc
blob: e82ec2ec38a32ca45a1fba99788077de886bb5e8 (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
'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 tAnsichtHintergrundNotizen
' #1 tViewWorkspaceHandoutView
' #1 tViewWorkspaceOutlineView
' #1 tViewWorkspaceDrawingView
' #1 tAnsichtEbene
'\********************************************************************

'Datei$ = ConvertPath (gOfficePath + "user\work\test.sxi")

testcase tAnsichtHintergrundNotizen
    Printlog "- View background notes"
    Call hNewDocument						'/// new document ///'
    try
        ViewNotes					'/// view background notes ///'
        sleep 3
    catch
        Warnlog  "View-Notes could not be accessed"
    endcatch
    ViewWorkspaceDrawingView
    sleep 1
    Call hCloseDocument						'/// close document ///'
    sleep 1
endcase

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

testcase tViewWorkspaceHandoutView
    Printlog "- View background handout"
    Call hNewDocument						'/// new document ///'
    sleep 2
    Kontext "DocumentImpress"
    DocumentImpress.UseMenu
    hMenuSelectNr (5)
    hMenuSelectNr (13)
    Printlog "  ViewWorkspaceHandoutView"
    ViewWorkspaceHandoutView						'/// view background handout ///'
    sleep 2
    Kontext "Tasks"
    sleep 2
    if LayoutsPreview.GetItemCount <> 6 Then
        Warnlog "  this doesn't seem to be a handout ?: should be: 6 layouts in the Preview window, but are: " + LayoutsPreview.GetItemCount
    else
        Printlog "  ViewWorkspaceHandoutView works"
    end if
    Printlog "ViewWorkspaceHandoutView closed"
    ViewWorkspaceDrawingView						'/// back to view background drawing ///'
    Call hCloseDocument						'/// close document ///'
endcase

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

testcase tViewWorkspaceOutlineView
    qaerrorlog "Outcommenting tViewWorkspaceOutlineView due to unreability. - FHA"
    goto endsub
   dim sFile as string
   dim i as integer

   '/// load a document with heading styles in writer and use the function 'writer:'File->Send->Outline to presentation' to get it into the presentation ///'
   ' all 'heading 1' are new slides

   '/// document used : "graphics\\required\\input\\outlinefromwriter.sxw" -> you get into writer ///'
   sFile = ConvertPath (gTesttoolPath + "graphics\required\input\outlinefromwriter.sxw")
   hDateiOeffnen (sFile)
   sleep 10
   '///+ with 'File->Send->Outline to presentation' you get into impress ///'
   FileSendOutlineToPresentation
   sleep 10
   Printlog "'/// View->Workspace->Outline View ///'"
   ViewWorkspaceOutlineView
   sleep 1
   '/// go to the line with the 'I' (via 'search & replace' function) ///'
   hTypeKeys "<STRG HOME>"
   EditSelectAll
   hFindeImDokument ("I")

   '///<b> expected level/style: 'Outline 8' </b>///'
   '/// get last character from selected style in stylist (expect a number of the outline(heading level) ///'
   fGetPresentationStyle ("8")

   '/// type keys [home] [tab] to go one level down ///'
   Kontext "DocumentImpressOutlineView"
   DocumentImpressOutlineView.TypeKeys "<Home><Tab>"

   '///<b> expected level/style: 'Outline 9' </b>///'
   fGetPresentationStyle ("9")

   Kontext "DocumentImpressOutlineView"
   '/// Edit - "Select All" to go select the whole text ///'
   EditSelectAll
   '/// type keys [shift]+[tab] eight times, to get all lines to the highest, except the one with the 'I' ///'
   DocumentImpressOutlineView.TypeKeys ("<Shift Tab>", 8)
    
hPrepareSearchBUG
    hTypeKeys "<STRG HOME>"
    EditSelectAll
    hFindeImDokument ("I")
    '///<b> expected level/style: 'Outline 1' </b>///'
    fGetPresentationStyle ("1")
    
    '/// type keys [shift]+[tab] to get the last line to the highest level, too ///'
    Kontext "DocumentImpressOutlineView"
    DocumentImpressOutlineView.TypeKeys ("<Shift Tab>", 1)
    '///<b> expected level/style: 'Title' </b>///'
    fGetPresentationStyle (0)
    
    Kontext "DocumentImpressOutlineView"
    DocumentImpressOutlineView.TypeKeys ("<escape>", 1)
    Printlog "'///<b> call 'Edit->Undo' nine times </b>///'"
    for i = 1 to 9
      editundo
    next i

hPrepareSearchBUG
    hFindeImDokument ("I")
    '///<b> expected level/style: 'Outline 9' </b>///'
    fGetPresentationStyle (9)
    
    Printlog "'///<b> call 'Edit->Redo' nine times </b>///'"
    for i = 1 to 9
      editredo
    next i
    try
      editredo
      Warnlog "NOT OK :-("
    catch
      Printlog "OK"
    endcatch

hPrepareSearchBUG
    hTypeKeys "<STRG HOME>"
    EditSelectAll
    hFindeImDokument ("I")
    '///<b> expected level/style: 'Title' </b>///'
    fGetPresentationStyle (0)

    Printlog "'///<b> call 'Edit->Undo' nine times </b>///'"
    for i = 1 to 9
        editundo
    next i

hPrepareSearchBUG
    hTypeKeys "<STRG HOME>"
    EditSelectAll
    hFindeImDokument ("I")
    '///<b> expected level/style: 'Outline 9' </b>///'
    fGetPresentationStyle (9)

    '/// type keys [strg]+[A] ///'
    Kontext "DocumentImpressOutlineView"
    EditSelectAll
    '/// type keys [strg]+[X] ///'
    DocumentImpressOutlineView.TypeKeys "<mod1 X>"

    kontext
    if messagebox.exists (5) then
        Printlog "active about deleting pages with graphic objects: '" + messagebox.GetText + "'"
        Messagebox.ok
    else
        Warnlog "messagebox missing ! (about deleting pages with graphic objects:)"
    endif

   '/// 'Edit->Undo' ///'
    editundo
   '/// 'Edit->Redo' ///'
    editredo
   '/// 'Edit->Undo' ///'
    editundo

   '/// type keys [strg]+[A] ///'
   Kontext "DocumentImpressOutlineView"
   EditSelectAll
   '/// type keys [strg]+[X] ///'
   DocumentImpressOutlineView.TypeKeys "<mod1 X>"

    kontext
    if messagebox.exists (5) then
        Printlog "active about deleting pages with graphic objects: '" + messagebox.GetText + "'"
        Messagebox.ok
    else
        Warnlog "messagebox missing ! (about deleting pages with graphic objects:)"
    endif

    '/// type keys [strg]+[V] ///'
    Kontext "DocumentImpressOutlineView"
    DocumentImpressOutlineView.TypeKeys "<mod1 V>"

    '/// 'Edit->Undo' ///'
    editundo
    '/// 'Edit->Redo' ///'
    editredo

    '/// type keys [strg]+[End] ///'
    Kontext "DocumentImpressOutlineView"
    DocumentImpressOutlineView.TypeKeys "<mod1 End>"
    '/// type keys [strg]+[V] ///'
    DocumentImpressOutlineView.TypeKeys "<mod1 V>"
    '/// type keys [strg]+[A] ///'
    EditSelectAll
    '/// type keys [delete] ///'
    DocumentImpressOutlineView.TypeKeys "<delete>"

    kontext
    if messagebox.exists (5) then
        Printlog "active-box about deleting pages with graphic objects: '" + messagebox.GetText + "'"
        Printlog "SAY CANCEL TO DIALOG!"
        Messagebox.Cancel
    else
        Warnlog "messagebox missing ! (about deleting pages with graphic objects:)"
        endif

    '/// type keys [strg]+[A] ///'
    Kontext "DocumentImpressOutlineView"
    EditSelectAll
    try
        editcopy
        Printlog "OK"
    catch
        Warnlog "error 4711 TBO :-("
    endcatch
    
    '/// type keys [delete] ///'
    Kontext "DocumentImpressOutlineView"
    DocumentImpressOutlineView.TypeKeys "<delete>"

    kontext
    if messagebox.exists (5) then
      Printlog "Active-box about deleting pages with graphic objects: '" + messagebox.GetText + "'"
      Messagebox.ok
    else
      Warnlog "Messagebox missing ! (about deleting pages with graphic objects:)"
    endif
    
    Kontext "DocumentImpressOutlineView"
    EditSelectAll
    try
      editcopy
      Warnlog "Didn't work!"
      Printlog "'" + getclipboard() + "'"
    catch
      Printlog "OK"
    endcatch
    
    ViewWorkspaceDrawingView
    Call  hCloseDocument						'/// close document ///'
    Call  hCloseDocument						'/// close document ///'
endcase

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

testcase tViewWorkspaceDrawingView
    Printlog "- View/Background-drawing"
    Call hNewDocument						'/// new document ///'
    sleep 2
    ViewDrawing						'/// view background drawing ///'
    try
        hRechteckErstellen ( 20,20,40,40 )			'/// create rectangle ///'
        sleep 1
        Printlog "  - rectangle created"
    catch
        Warnlog "  Rectangle could not be created"
    endcatch
    Call hCloseDocument						'/// close document ///'
endcase

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

testcase tAnsichtEbene
    printLog "- View/Layer"							'/// view layer ///'
    
    
    FileAutopilotPresentation					'/// new document-autopilot ///'
    Kontext "AutopilotPraesentation1"
    sleep 5
    AutopilotPraesentation1.Ok
    sleep 2
    sleep 2
    ViewSlide							'/// back to view slide ///'
    Sleep 2
    
    Call  hCloseDocument						'/// close document ///'

endcase

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