update dev300-m58
[ooovba.git] / testautomation / math / required / includes / m_004_.inc
blob6491bbcb8d7781b850831d6e658bedd17b5bc67b
1 'encoding UTF-8  Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 '* 
5 '* Copyright 2008 by Sun Microsystems, Inc.
6 '*
7 '* OpenOffice.org - a multi-platform office productivity suite
8 '*
9 '* $RCSfile: m_004_.inc,v $
11 '* $Revision: 1.1 $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 11:51:23 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org.  If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* Owner : thorsten.bosbach@sun.com
36 '* short description :
38 '\*****************************************************************
40 sub M_004_
41    Printlog Chr(13)+"--  Format Menu  m_004_  --"
43    Call tFormatFonts
44    Call tFormatFontsize
45    Call tFormatDistance
46    Call tFormatAlignment
47    Call tFormatTextmode
48 end sub
50 testcase tFormatFonts
51    Dim i as integer
52    dim iCount as integer
53    '/// open application ///'
54    Call hNewDocument
55    sleep (5)
56    '/// Format->Fonts ///'
57    FormatFonts
58    Kontext "Schriftarten"
59    Call DialogTest (Schriftarten)
60    '/// select every entry from 'Modify' and do ///'
61    Aendern.OpenMenu
62    iCount = hMenuItemGetCount
63    if (iCount <> 7) then
64        warnlog "There are Entries missing; expected: '7'; found: '" + iCount +"'"
65    endif
66    for i=1 to iCount
67       sleep 2
68       printlog "  Font for Menuitem Nr. " & i
69            sleep 2
70       hMenuSelectNr ( i )
71       Sleep 2
72       Kontext "Schriften"
73          Call DialogTest (Schriften)
74          if (i<5) then
75              try
76                  '/// check checkbox 'bold' ///'
77                  fett.check
78                  '/// check checkbox 'italic' ///'
79                  kursiv.check
80              catch
81                  warnlog "fett and/or kursiv checkbox doesn't exist"
82              endcatch
83          else
84              if (fett.isvisible OR kursiv.isVisible) then
85                  warnlog "fett and/or kursiv checkbox exists"
86              endif
87          endif
88          sleep 1
89          '/// cancel dialog 'fonts' ///'
90       Schriften.Cancel
91       Sleep 2
92       Kontext "Schriftarten"
93       Aendern.OpenMenu
94    next i
95    Kontext "Schriftarten"
96    hMenuClose
97    '/// cklick button 'default' ///'
98    Standard.Click
99    Kontext "Active"
100    if active.exists (5) then
101       Active.No ' should changes ybe saved as default (yes/no)
102    else
103       warnlog "should changes be saved as default (yes/no) failed :-("
104    endif
105    Kontext "Schriftarten"
106    '/// cancel dialog 'fonts' ///'
107    Schriftarten.Cancel
108    '/// close document ///'
109    Call hCloseDocument
110 endcase
112 testcase tFormatFontsize
113    '/// open application ///'
114    Call hNewDocument
115    '/// Format->FontSize ///'
116    FormatFontSize
117    Kontext "Schriftgroessen"
118       Call DialogTest (Schriftgroessen)
119       '/// press button MORE on 'Base size' ///'
120       BasisGroesse.more
121       '/// press button MORE on 'Text' ///'
122       TextGroesse.more
123       '/// press button MORE on 'Indexes' ///'
124       Indizes.more
125       '/// press button MORE on 'Functions' ///'
126       Funktionen.more
127       '/// press button MORE on 'Operators' ///'
128       Operatoren.more
129       '/// press button MORE on 'Limits' ///'
130       Grenzen.more
131       sleep 1
132       '/// press button 'default' ///'
133       Standard.Click
134       kontext "active"
135       if active.exists (5) then
136          Active.No ' should changes ybe saved as default (yes/no)
137       else
138          warnlog "should changes be saved as default (yes/no) failed :-("
139       endif
140       Kontext "Schriftgroessen"
141    '/// cancel dialog 'Font Sizes' ///'
142    Schriftgroessen.Cancel
143    sleep 2
144 '/// close document ///'
145    Call hCloseDocument
146 endcase
148 testcase tFormatDistance
149    Dim i as integer
150    '/// open application ///'
151    Call hNewDocument
152    '/// Format->Spacing ///'
153    FormatSpacing
154    Kontext "Spacing"
155       Call DialogTest (Spacing)
156       Category.Open
157       sleep 1
158       for i=1 to hMenuItemGetCount
159          hMenuSelectNr (i)
160          Sleep 1
161          Call DialogTest (Spacing,i)
162          Select Case i
163             Case 1
164                '/// select 'Spacing' from Category menu ///'
165                '///+ click MORE button on '' ///'
166                SpacingSpacing.More
167                '///+ click MORE button on '' ///'
168                LineSpacing.More
169                '///+ click MORE button on '' ///'
170                RootSpacing.More
171             Case 2
172                '/// select 'Indexing' from Category menu ///'
173                '///+ click MORE button on '' ///'
174                Superscript.More
175                '///+ click MORE button on '' ///'
176                Subscript.More
177             Case 3
178                '/// select 'Fractions' from Category menu ///'
179                '///+ click MORE button on '' ///'
180                Numerator.More
181                '///+ click MORE button on '' ///'
182                Denominator.More
183             Case 4
184                '/// select 'Fraction bars' from Category menu ///'
185                '///+ click MORE button on '' ///'
186                ExcessLength.More
187                '///+ click MORE button on '' ///'
188                Weight.More
189             Case 5
190                '/// select 'Limits' from Category menu ///'
191                '///+ click MORE button on '' ///'
192                UpperLimit.More
193                '///+ click MORE button on '' ///'
194                LowerLimit.More
195             Case 6
196                '/// select 'Brackets' from Category menu ///'
197                '///+ click MORE button on '' ///'
198                ExcessSize.More
199                '///+ click MORE button on '' ///'
200                BracketSpacing.More
201                ScaleAllBrackets.Check
202                '///+ click MORE button on '' ///'
203                   ExcessSizeAll.More
204             Case 7
205                '/// select 'Matrixes' from Category menu ///'
206                '///+ click MORE button on '' ///'
207                MatrixLineSpacing.More
208                '///+ click MORE button on '' ///'
209                ColumnSpacing.More
210             Case 8
211                '/// select 'Symbols' from Category menu ///'
212                '///+ click MORE button on '' ///'
213                PrimaryHeight.More
214                '///+ click MORE button on '' ///'
215                MinimunSpacing.More
216             Case 9
217                '/// select 'Operators' from Category menu ///'
218                '///+ click MORE button on '' ///'
219                OperatorsExcessSize.More
220                '///+ click MORE button on '' ///'
221                OperatorsSpacing.More
222             Case 10
223                '/// select 'Borders' from Category menu ///'
224                '///+ click MORE button on '' ///'
225                BordersLeft.More
226                '///+ click MORE button on '' ///'
227                BordersRight.More
228                '///+ click MORE button on '' ///'
229                BordersTop.More
230                '///+ click MORE button on '' ///'
231                BordersBottom.More
232             Case Else
233                warnlog "More items than expected :-("
234          End Select
235          Category.Click
236       next i
237       hMenuClose
238       Sleep 1
239       Default.Click
240       kontext "active"
241       if active.exists (5) then
242          Active.No ' should changes ybe saved as default (yes/no)
243       else
244          warnlog "should changes be saved as default (yes/no) failed :-("
245       endif
246       Kontext "Spacing"
247    '/// cancel dialog 'Spacing' ///'
248    Spacing.Cancel
249    Sleep 2
250 '/// close document ///'
251    Call hCloseDocument
252 endcase
254 testcase tFormatAlignment
255    '/// open application ///'
256    Call hNewDocument
257    '/// Format->Alignment ///'
258    FormatAlignment
259    Kontext "Ausrichtung"
260    Call DialogTest (Ausrichtung)
261       '/// check Radiobutton 'Left' ///'
262       Links.Check
263       '/// check Radiobutton 'Centered' ///'
264       Zentriert.Check
265       '/// check Radiobutton 'Right' ///'
266       Rechts.Check
267       '/// check Button 'Default' ///'
268       Standard.Click
269       kontext "active"
270       if active.exists (5) then
271          Active.No ' should changes ybe saved as default (yes/no)
272       else
273          warnlog "should changes be saved as default (yes/no) failed :-("
274       endif
275    Kontext "Ausrichtung"
276    Ausrichtung.Cancel
277    '/// close document ///'
278    Call hCloseDocument
279 endcase
281 testcase tFormatTextmode
282 '/// open application ///'
283    Call hNewDocument
284    '/// Format->Text Mode ///'
285    FormatTextMode
286    sleep 1
287    '/// Format->Text Mode ///'
288    FormatTextMode
289 '/// close document ///'
290    Call hCloseDocument
291 endcase