summaryrefslogtreecommitdiff
path: root/testautomation/graphics/required/includes/impress/im_003_.inc
blob: 0eec59322e25d8baf345280838b55718b5058b65 (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
'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 : Impress Resource Test: View Menu
'*
'\******************************************************************************

sub im_003_

    call tiViewPanes()
    call tiViewMasterView()
    call tiViewSlideMaster()
    call tiViewToolbar_1()

end sub

'*******************************************************************************

testcase tiViewPanes

    qaerrorlog( "This test is disabled, it needs rewriting" )
    goto endsub 'TODO WG, tiViewPanes outcommented due to reconstruction of test
    dim bState as boolean
    printlog "open application "
    Call hCloseDocument
    Call hNewDocument

    kontext "Tasks"
    if ( not Tasks.exists( 2 ) ) then
        warnlog "Tasks Panel not visible on opening application. Opening now."
        ViewTaskPane
    endif
    kontext "Slides"
    if (NOT Slides.exists) then
        warnlog "Slides Panel not visible on opening application. Opening now."
        ViewTaskSlide
    endif
    kontext "Tasks"
    printlog "Deactivate all but masterpages "
    View.OpenMenu
    hMenuSelectNr (2)
    View.OpenMenu
    hMenuSelectNr (3)
    View.OpenMenu
    hMenuSelectNr (4)

    sleep 1

    Tasks.TypeKeys ("<RIGHT><RIGHT><RIGHT>")

    try
        kontext "recentlyUsed"
        printlog "Toggeling Master Pages now with <space>"
        kontext "MasterPages"
        MasterPages.typeKeys "<space>"
        kontext "recentlyUsed"
        if (recentlyUsed.IsVisible = FALSE) then   'exists = FALSE) then
            warnlog "View-menu didn't work"
        endif
        kontext "Tasks"
        sleep 1
        printlog "View->Task Pane "
        ViewTaskPane
        sleep 1
        if (Tasks.exists) then
            warnlog "View->Task Panel failed"
            ViewTaskPane
        endif
        printlog "View->Task Pane "
        ViewTaskPane
        sleep 1
        if (NOT Tasks.exists) then
            warnlog "View->Task Panel failed"
            ViewTaskPane
        endif
    catch
        warnlog "View->Task Pane couldn't get executed"
    endcatch
    kontext "Slides"
    try
        ViewTaskSlide
        if (Slides.exists) then
            warnlog "View->Slide Panel failed."
            ViewTaskSlide
        endif
        printlog "View->Slide Pane "
        ViewTaskSlide
        sleep 1
        if (NOT Slides.exists) then
            warnlog "View->Slide Panel failed."
            ViewTaskSlide
        endif
    catch
        warnlog "View->Slide Pane couldn't get executed"
    endcatch

    printlog "Reactivate all pages in the Task-panel "
    kontext "Tasks"
    View.OpenMenu
    hMenuSelectNr (2)
    View.OpenMenu
    hMenuSelectNr (3)
    View.OpenMenu
    hMenuSelectNr (4)

endcase 'tiViewPanes
'---------------------------------------------------------
testcase tiViewMasterView
    printlog "open application"
    Call hNewDocument
    printlog "View->Master View->Drawing View"
    hUseAsyncSlot( "ViewWorkspaceDrawingView" )
    printlog "View->Master View->Outline View "
    hUseAsyncSlot( "ViewWorkspaceOutlineView" )
    printlog "View->Master View->Slides View "
    ViewWorkspaceSlidesView
    sleep 1
    printlog "View->Master View->Notes View "
    hUseAsyncSlot( "ViewWorkspaceNotesView" )
    printlog "View->Master View->Handout View "
    hUseAsyncSlot( "ViewWorkspaceHandoutView" )
    printlog "View->Master View->Drawing View "
    hUseAsyncSlot( "ViewWorkspaceDrawingView" )
    printlog "close application "
    Call hCloseDocument
endcase 'tiViewMasterView
'---------------------------------------------------------
testcase tiViewSlideMaster

    printlog "open application with : File->Autopilot->Presentation; OK; OK "
    FileAutopilotPresentation                ' to get a title :-)
    Kontext "AutopilotPraesentation1"
    if ( AutopilotPraesentation1.exists( 2 ) ) then
        hCloseDialog( AutopilotPraesentation1, "ok" )
    else
        warnlog( "Dialog <AutopilotPraesentation1> did not open" )
    endif
    Kontext "Seitenlayout"  ' aka: Modify Slide

    if ( Seitenlayout.exists( 5 ) ) then
        warnlog "Slidelayout has to vanish; moved to sidebar"
        hCloseDialog( Seitenlayout, "ok" )
    endif

    kontext "DocumentImpress"
    printlog "View->Slide "
    hUseAsyncSlot( "ViewSlide" )
    
    printlog "View->Master->Drawing "
    hUseAsyncSlot( "ViewDrawing" )

    printlog "View->Slide "
    hUseAsyncSlot( "ViewSlide" )

    printlog "View->Master->Title "
    try
        ViewTitle
        Errorlog "View - Master - Title Slide Master should NOT be accessable"
    catch
        printlog "View - Master - Title Slide Master not accessable - good"
    endcatch

    printlog "View->Slide "
    hUseAsyncSlot( "ViewSlide" )

    printlog "View->Master->Handout "
    hUseAsyncSlot( "ViewHandout" )

    printlog "View->Master->Notes "
    hUseAsyncSlot( "ViewNotes" )
    kontext "DocumentImpress"

    printlog "View->Slide "
    hUseAsyncSlot( "ViewSlide" )

    printlog "close application "
    Call  hCloseDocument

endcase 'tiViewSlideMaster
'--------------------------------------------------------
testcase tiViewToolbar_1

    const DEFAULT_DELAY = 3

    Dim NumberOfGraphicModes as integer
    Dim iCurrentGraphicsMode as integer

    dim TestFile as string
    TestFile = ConvertPath (gTesttoolPath + "global\input\graf_inp\desp.bmp")

    printlog "open application "
    Call hNewDocument
    
    printlog "use the empty layout"
    call sSelectEmptyLayout

    printlog "Insert->Graphic... : global\input\graf_inp\desp.bmp "
    hUseAsyncSlot( "InsertGraphicsFromFile" )

    Kontext "GrafikEinfuegenDlg"
    if ( GrafikEinfuegenDlg.exists( DEFAULT_DELAY ) ) then
        Dateiname.SetText( TestFile )
        Oeffnen.Click

        Kontext "Messagebox"
        if ( Messagebox.Exists( DEFAULT_DELAY ) ) then
            Warnlog Messagebox.GetText
            hCloseDialog( Messagebox, "ok" )
        end if

        Kontext "DocumentImpress"
        printlog "select graphic "
        hUseAsyncSlot( "EditSelectAll" )

        Kontext "GraphicObjectbar"
        printlog "The Graphics Toolbar has to be visible now; If not -> ERROR "
        if ( GraphicObjectbar.Exists( DEFAULT_DELAY ) ) Then

            Printlog "- graphic object toolbar exists"
            NumberOfGraphicModes=Grafikmodus.GetItemCount

            for iCurrentGraphicsMode = 1 to NumberOfGraphicModes
                Printlog( "- access all controls in the toolbar (" & iCurrentGraphicsMode & "/" & NumberOfGraphicModes & ")" )
                Grafikmodus.Select( iCurrentGraphicsMode )
                sleep ( DEFAULT_DELAY )
            next iCurrentGraphicsMode
        else
            Warnlog "- No graphic function toolbar visible"
        end if
    else
        warnlog( "Insert Graphics dialog did not open" )
    endif

    printlog "close application "
    Call hCloseDocument

endcase 'tiViewToolbar_1