summaryrefslogtreecommitdiff
path: root/testautomation/math/required/includes/m_005_.inc
blob: a7884f29f8a264ee34e8028a53a781ae6aa5265c (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
'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 : thorsten.bosbach@oracle.com
'*
'* short description :
'*
'\*****************************************************************

sub M_005_
   printlog Chr(13) +  "--  Tools Menu  m_005_ --"

   Call tToolsCatalog
   Call tToolsImportFormula
   Call tiToolsMacro
   Call tToolsExtensionManager
   
   Call tToolsCustomize 'global one ! TBO
   Call tToolsOptionstest ' global one ! TZ
end sub

testcase tToolsCatalog
   '/// open application ///'
   Call hNewDocument
   '/// Tools->Catalog ///'
   ToolsSymbolsCatalog
      Kontext "SymboleMath"
      Call Dialogtest (SymboleMath)
      printlog "count of 'Symbol set' :" + Symbolset.GetItemCount
      '/// click button 'Edit...' ///'
      Bearbeiten.Click
         Kontext "EditSymbols"
         Call DialogTest (EditSymbols)
         OldSymbol.GetItemCount
         OldSymbolSet.GetItemCount
         Symbol.GetItemCount
         SymbolSet.GetItemCount
         Subset.GetItemCount
         Typeface.GetItemCount
         '/// select last item in listbox 'Font' ///'
         Font.Select (Font.GetItemCount)
         sleep 1
         '/// Click Button 'Modify' ///'
         Modify.Click
         sleep 1
      '/// cancel dialog 'Edit Symbols' ///'
      EditSymbols.Cancel
      ' since cws tl82 - dev300m88 we need to go into dialog again to get the others buttons
      Kontext "SymboleMath"
      printlog "count of 'Symbol set' :" + Symbolset.GetItemCount
      '/// click button 'Edit...' ///'
      Bearbeiten.Click
         Kontext "EditSymbols"
         '/// select last item in listbox 'Font' ///'
         Font.Select (Font.GetItemCount)
         sleep 1
         '/// Click Button 'Delete' ///'
         Delete.Click
         sleep 1
         '/// Click Button 'Add' ///'
         Add.Click
         sleep 1
      '/// cancel dialog 'Edit Symbols' ///'
      EditSymbols.Cancel
      Kontext "SymboleMath"
      '/// click button 'Insert' ///'
      Uebernehmen.Click
      Sleep 2
   '/// close dialog 'Symbols' ///'
   SymboleMath.close
   '/// close application ///'
   Call hCloseDocument
endcase

testcase tToolsImportFormula
   '/// open application ///'
   Call hNewDocument
   Sleep 3
   '/// Tools->Import->Formula ///'
   ToolsImportFormula
   Kontext "OeffnenDlg"
      Kontext "OeffnenDlg"
      UebergeordneterOrdner.Click
      Standard.Click
      Call DialogTest ( OeffnenDlg )
   '/// cancel dialog 'Insert' ///'
   OeffnenDlg.Cancel
   Sleep 2
   '/// close application ///'
   Call hCloseDocument
endcase

testcase tiToolsMacro
'/// open application ///'
   Call hNewDocument
   sleep 2
   '/// try to call Tools->Macros...->Record Macro => this has to fail, it is only aloowed from writer and Calc ///'
   try
      ToolsMacroRecordMacro
      Warnlog "I can record macros in this application :-("
   catch
      Printlog "i can't record macros in this application :-)"
   endcatch
'/// Tools->Macro ///'
   ToolsMacro
   Kontext "Makro"
   Call DialogTest ( Makro )
'/// click button 'organizer...' ///'
   Verwalten.Click

   Kontext
'/// switch to tabpage 'Modules' ///'
   Messagebox.SetPage TabModule
   Kontext "TabModule"
   Call DialogTest ( TabModule )

   Kontext
'/// switch to tabpage 'Libraries' ///'
   Messagebox.SetPage TabBibliotheken
   Kontext "TabBibliotheken"
   Call DialogTest ( TabBibliotheken )
'/// click lbutton 'append' ///'
      Hinzufuegen.Click
      Kontext "Messagebox"
      if Messagebox.Exists (5) then
     if Messagebox.GetRT = 304 then
            Warnlog Messagebox.Gettext
            Messagebox.Ok
     endif
      end if
      Kontext "OeffnenDlg"
'/// cancel dialog 'append libraries' ///'
      OeffnenDlg.Cancel
      Kontext "TabBibliotheken"
'/// click button 'new' ///'
      Neu.Click
      kontext "NeueBibliothek"
      sleep 1 'Bibliotheksname
'/// cancel dialog 'new library' ///'
      NeueBibliothek.cancel
   Kontext "TabBibliotheken"
'/// close dialog 'macro organizer' ///'
   TabBibliotheken.Close

   Kontext "Makro"
'/// close dialog 'macro' ///'
   Makro.Cancel
'/// close application ///'
   Call hCloseDocument
endcase

testcase tToolsExtensionManager
    dim sPath as string
    dim sTemp as string
    dim sTemp2 as string
    dim x as integer

    if ( lcase( gPlatform ) <> "osx" ) then
    sPath = convertPath(gTestToolPath+"math/required/input/")
    '/// open application ///'
    Call hNewDocument
    sleep 2
    '/// call Tools - Package/Extension manager ///'
    ToolsPackageManager
        kontext "PackageManager"
        If PackageManager.exists(10) then
            DialogTest(PackageManager)
            '/// going to top of package list and explode every line, until the button 'Add' is enabled ///'
            '/// should be 'My Packages' ///'
            BrowsePackages.typeKeys("<home>")
            if (Not Add.isEnabled) then
                warnlog "Couldn't find a way to enable the Add button - aborting"
                goto endsub
            endif
            '/// click button 'Add' ///'
            Add.click
                '/// Add Package(s)... dialg comes up ///'
                Kontext "OeffnenDlg"
                if OeffnenDlg.exists(5) then
                    '/// put filename into field ///'
                    Dateiname.setText (sPath + "unknown-dependency.oxt")
                    '/// press button 'Open' ///'
                    Oeffnen.click
                else
                    warnlog "Add Package(s)... dialog didn't came up"
                endif
                
            'Asking for whom to install; All: YES, Me: NO, nobody: Cancel
             kontext
             if active.exists(5) then
                sTemp = active.getText
                try
                active.yes
                catch
                'printlog sTemp
                endcatch
             endif

                '/// Progress dialog comes up ///'
                Kontext "AddingPackages"
                if AddingPackages.exists(1) then
                    printlog " - AddingPackages dialog exists"
                    DialogTest(AddingPackages)
                endif
                
                '/// If any error happens, an active comes up, telling what is wrong ///'
                Kontext
                if active.exists(5) then
                    sTemp = active.getText
                        printlog sTemp
                    active.ok
                endif
                
                '/// If there are any unsatisfied dependencies, they are shown now ///'
                Kontext "UnsatisfiedDependencies"
                if UnsatisfiedDependencies.exists(10) then
                        printlog " - UnsatisfiedDependencies dialog exists"
                    DialogTest(UnsatisfiedDependencies)
                    '/// close dialog if available, extension will not be installed ///'
                    UnsatisfiedDependencies.ok
                endif

                Kontext "AddingPackages"
                x=0
                while AddingPackages.exists(1) AND (x<6)
                    printlog "AddingPackages..."
                    sleep 5
                    x=x+1
                wend
                
             kontext "PackageManager"
             Add.click
                '/// Add Package(s)... dialg comes up ///'
                Kontext "OeffnenDlg"
                if OeffnenDlg.exists(5) then
                    '/// put filename into field ///'
                    Dateiname.setText (sPath + "ShortLicense.oxt")
                    '/// press button 'Open' ///'
                    Oeffnen.click
                else
                    warnlog "Add Package(s)... dialog didn't came up"
                endif
                
            'Asking for whom to install; All: YES, Me: NO, nobody: Cancel
             kontext
             if active.exists(5) then
                sTemp = active.getText
                try
                active.yes
                catch
                'printlog sTemp
                endcatch
             endif

                '/// Progress dialog comes up ///'
                Kontext "AddingPackages"
                if AddingPackages.exists(1) then
                    printlog " - AddingPackages dialog exists"
                endif
                
                '/// If any error happens, an active comes up, telling what is wrong ///'
                Kontext
                if active.exists(5) then
                    sTemp = active.getText
                        printlog sTemp
                    active.ok
                endif
                
                '/// If there is a license, it is shown now ///'
                Kontext "ExtensionSoftwareLicenseAgreement"
                if ExtensionSoftwareLicenseAgreement.exists(10) then
                    DialogTest (ExtensionSoftwareLicenseAgreement)
                        printlog " - ExtensionSoftwareLicenseAgreement dialog exists"
                            ExtensionSoftwareLicenseAgreement.CANCEL
                    kontext
                    if active.exists(5) then
                        '#i73307# 
                    	warnlog "Alzheimer feature extension licensing '" + active.getText + "'"
                    	active.ok
                    endif
                endif

                Kontext "AddingPackages"
                x=0
                while AddingPackages.exists(1) AND (x<6)
                    printlog "AddingPackages..."
                    sleep 5
                    x=x+1
                wend
                
            '/// Close extension manager ///'
            kontext "PackageManager"
            PackageManager.OK
        else
            warnlog "Couldn't call Tools -> Package manager - aborting test"
        endif
   Call hCloseDocument
   else
       qaErrorLog "Do not run on macosx - not reproduceable error"
   endif
endcase