1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: g_tables.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 10:42:40 $
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 : wolfram.garten@sun.com
36 '* short description : Testing of impress tables
38 '*******************************************************************
40 ' #1 tiInsertTableUsingMenu
41 ' #1 tiInsertTableUsingButton
43 ' #1 tiInsertTableUsingToolbarbutton
45 '\******************************************************************
49 dim iItemCount AS integer 'Count variable for combobox
50 dim iItemIndex AS integer 'Counter for/next
52 '-------------------------------------------------------------------------------
54 testcase tiInsertTableUsingMenu
56 printlog "Inserting table into doc using the menu."
58 printlog "Switching between Draw/Impress"
59 if (UCase(gApplication)) = "IMPRESS" then
60 DocumentImpress.UseMenu
70 printlog "Checking if insert Table dialog comes up."
71 Kontext "InsertTableImpress"
72 if InsertTableImpress.Exists then
73 printlog "InsertTable Dialog is up."
75 warnlog "InsertTableDialog did not come up!"
78 printlog "Checking for availability of column and row boxes."
79 if NumberOfColumns.IsEnabled AND NumberOfRows.IsEnabled then
80 printlog "Columns and rows boxes available."
82 warnlog "One or both spinboxes not active!"
85 printlog "Checking max and min for Columns."
87 if NumberOfColumns.GetText = "75" then
88 printlog "Max is 75 Columns."
90 warnlog "Max Columns cannot be reached!"
94 if NumberOfColumns.GetText ="1" then
95 printlog "Min is 1 column."
97 warnlog "Min column is wrong!"
100 printlog "Checking max and min for Rows."
102 if NumberOfRows.GetText = "75" then
103 printlog "Max is 75 Rows."
105 warnlog "Max Rows cannot be reached!"
109 if NumberOfRows.GetText ="1" then
110 printlog "Min is 1 Row."
112 warnlog "Min Row is wrong!"
115 printlog "Inserting Table now, 5 columns ,2 rows."
116 NumberOfColumns.SetText "5"
117 NumberOfRows.SetText "2"
118 InsertTableImpress.OK
119 Kontext "DocumentImpress"
121 printlog "Checking if table is inserted."
122 Kontext "TableObjectbar"
123 if TableObjectbar.Exists(1) then
124 printlog "TableObjectBar is up, Table inserted."
126 warnlog " TableObjectBar not up !"
130 printlog " Close document."
133 endcase 'tiInsertTableUsingMenu
135 '-------------------------------------------------------------------------------
137 testcase tiInsertTableUsingButton
139 printlog " Inserting table using the button in standard toolbar."
141 printlog "Open New Document."
142 kontext "Standardbar"
144 printlog "Checking if button is available."
148 warnlog "Table button in standardbar is not available!"
150 printlog "Clicking on insert table button in standardbar."
152 printlog " Checking if insert Table dialog comes up."
153 Kontext "InsertTableImpress"
154 if InsertTableImpress.Exists then
155 printlog "InsertTable Dialog is up."
157 warnlog "InsertTableDialog did not come up!"
159 printlog "Inserting Table by clicking OK."
160 InsertTableImpress.OK
162 printlog "Checking if table is inserted."
163 Kontext "TableObjectbar"
164 if TableObjectbar.Exists(1) then
165 printlog "TableObjectBar is up, Table inserted."
167 warnlog "TableObjectBar not up!"
170 printlog " Close document."
173 endcase 'tiInsertTableUsingButton
175 '-------------------------------------------------------------------------------
176 testcase tiInsertTableUsingToolbarbutton
178 printlog " Inserting table using the button in table toolbar."
180 printlog "Clicking on button in toolbar."
181 Call hToolbarSelect ("Table", true)
182 Kontext "TableObjectBar"
183 if TableObjectbar.Exists(1) then
184 printlog "TableObjectBar is up."
186 warnlog "TableObjectBar not up!"
190 printlog " Checking if insert Table dialog comes up."
191 Kontext "InsertTableImpress"
192 if InsertTableImpress.Exists then
193 printlog "InsertTable Dialog is up."
195 warnlog "InsertTableDialog did not come up!"
198 printlog "Inserting Table..."
199 InsertTableImpress.OK
201 printlog " Checking if dialog comes up."
202 Kontext "TableObjectbar"
203 if TableObjectbar.Exists(1) then
204 printlog "Success, Table inserted."
206 warnlog " Table Dialog did not came up!"
210 printlog " Close document."
213 endcase 'tiInsertTableUsingToolbarbutton
215 '-------------------------------------------------------------------------------
216 testcase tiTableObjectBar
218 printlog "Testing TableObjectBar."
219 printlog "Inserting table into doc using the menu."
221 printlog "Switching between Draw/Impress"
222 if (UCase(gApplication)) = "IMPRESS" then
223 DocumentImpress.UseMenu
232 Kontext "InsertTableImpress"
233 printlog "Inserting table."
234 InsertTableImpress.OK
236 printlog "Selecting table for geeting the TableObjectBar."
237 printlog "Switching between Draw/Impress"
238 if (UCase(gApplication)) = "IMPRESS" then
239 Kontext "DocumentImpress"
240 DocumentImpress.TypeKeys "<MOD1 A>"
242 Kontext "DocumentDraw"
243 DocumentDraw.TypeKeys "<MOD1 A>"
246 printlog " Checking Table button."
247 Kontext "TableObjectBar"
248 if TableObjectBar.Exists then
249 printlog "Table bar visible."
251 warnlog "Table bar is not up!"
254 printlog "Checking LinienStil."
256 Kontext "TB_Umrandungsstil"
258 if TB_Umrandungsstil.Exists then
259 printlog "LineStyle Box is up."
260 TB_Umrandungsstil.Close
262 warnlog "LineStyleBox is not up!"
264 Kontext "TableObjectBar"
267 if (UCase(gApplication)) = "IMPRESS" then
268 Kontext "DocumentImpress"
270 Kontext "DocumentDraw"
272 Call hToolbarSelect ("Table", true)
273 Kontext "TableObjectBar"
275 printlog "Checking LineColorOfTheBorder."
276 LineColorOfTheBorder.TearOff
279 if TB_Farbe.Exists then
280 printlog "LineColorOfTheBorder is up."
283 warnlog "LineColorOfTheBorder is not up!"
285 Kontext "TableObjectBar"
287 if (UCase(gApplication)) = "IMPRESS" then
288 Kontext "DocumentImpress"
290 Kontext "DocumentDraw"
292 Call hToolbarSelect ("Table", true)
293 Kontext "TableObjectBar"
295 printlog "Checking Borderstyle."
297 Kontext "TB_Umrandung"
298 if TB_Umrandung.Exists then
299 printlog " BordersTB is up."
302 warnlog "BordersTB is not up!"
304 if (UCase(gApplication)) = "IMPRESS" then
305 Kontext "DocumentImpress"
307 Kontext "DocumentDraw"
310 printlog "Checking merge cells."
311 printlog "Inserting something into cell and select."
312 if (UCase(gApplication)) = "IMPRESS" then
313 DocumentImpress.TypeKeys ("a")
314 DocumentImpress.TypeKeys "<SHIFT RIGHT>"
316 DocumentDraw.TypeKeys ("a")
317 DocumentDraw.TypeKeys "<SHIFT RIGHT>"
319 Kontext "TableObjectBar"
320 ZellenVerbinden.Click
321 printlog "Cells merged."
323 printlog "Checking split cells."
325 printlog "Cells split."
326 Kontext "ZellenTeilen"
328 printlog "SplitCells dialog open."
330 printlog "Maximum SplitCellCount is " & Anzahl.GetText & "."
332 printlog "Minimum SplitCellCount is " & Anzahl.GetText & "."
333 if Horizontal.IsChecked = TRUE then
334 printlog "Horizontally is clicked."
336 warnlog "Horizontally should be clicked by default!"
338 GleichmaessigTeilen.Check
339 printlog "Split Equal checked."
341 printlog "Cells vertically checked."
343 printlog " Checking optimize button 'ToDo: button not working"
344 'Kontext "TableObjectBar"
346 'OptimizeTablebar.Close
348 printlog "Checking Alignment."
349 Kontext "TableObjectBar"
353 printlog "Alignment buttons checked."
355 printlog "Checking inserting and deleting of columns and rows."
357 printlog "Row inserted."
360 printlog "Row deleted."
362 SpalteEinfuegen.Click
363 printlog "Column inserted."
366 printlog "Column deleted."
368 printlog "Checking table design button 'ToDo:needs some further examination here!"
371 printlog "Checking for Table Design in Impress TaskBar or for Dialog in Draw."
372 if (UCase(gApplication)) = "IMPRESS" then
374 if (NOT Tasks.exists) then
375 warnlog "Tasks Panel not visible. Opening now."
378 printlog "Task Pane visible."
381 kontext "TableDesign"
382 if TableDesign.exists then
383 printlog "Table Design Dialog is up."
386 warnlog "TableDesign Dialog for Draw is missing."
390 printlog "Checking Properties button."
391 Kontext "TableObjectBar"
392 TableProperties.Click
394 active.SetPage TabFont
395 if (NOT TabFont.Exists) then
396 warnlog "Tabpage missing!"
398 printlog "Tabpage Font is up."
402 printlog "Checking Fonts Box."
403 iItemCount = Font.GetItemCount
404 printlog "Fontbox has " & iItemCount & " entries."
405 for iItemIndex = 1 to iItemCount
406 Font.Select(iItemIndex)
409 printlog "Checking style box."
410 iItemCount = Style.GetItemCount
411 printlog "Stylebox has " & iItemCount & " entries."
412 for iItemIndex = 1 to iItemCount
413 Style.Select(iItemIndex)
416 printlog "Checking size box."
417 iItemCount = Size.GetItemCount
418 printlog "Sizebox has " & iItemCount & " entries."
419 for iItemIndex = 1 to iItemCount
420 Size.Select(iItemIndex)
423 printlog "Checking language box."
424 iItemCount = Language.GetItemCount
425 printlog "Language box has " & iItemCount & " entries."
426 for iItemIndex = 1 to iItemCount
427 Language.Select(iItemIndex)
430 '------------Next Tab-----------------
432 printlog "Checking Tabpage FontEffects."
434 active.SetPage TabFontEffects
435 if (NOT TabFontEffects.Exists) then
436 warnlog "Tabpage FontEffects missing!"
438 printlog "Tabpage FontEffects is up."
440 kontext "TabFontEffects"
442 printlog "Checking Underlining box."
443 iItemCount = Underline.GetItemCount
444 printlog "Underlining has " & iItemCount & " entries."
445 for iItemIndex = 1 to iItemCount
446 Underline.Select(iItemIndex)
449 printlog "Checking StrikeThrough box."
450 iItemCount = StrikeThrough.GetItemCount
451 printlog "StrikeThrough has " & iItemCount & " entries."
452 for iItemIndex = 1 to iItemCount
453 StrikeThrough.Select(iItemIndex)
456 printlog "Checking individual words."
457 IndividualWords.Check
458 printlog "Individual words checked."
460 printlog "Checking Color box."
461 iItemCount = Color.GetItemCount
462 printlog "Font color has " & iItemCount & " entries."
463 for iItemIndex = 1 to iItemCount
464 Color.Select(iItemIndex)
467 printlog "Checking Relief."
468 iItemCount = Relief.GetItemCount
469 printlog "Relief has " & iItemCount & " entries."
470 for iItemIndex = 1 to iItemCount
471 Relief.Select(iItemIndex)
473 Relief.Select(1) 'setting back Relief, otherwise Outline is greyed out
475 printlog "Checking Outline and Shadow."
477 printlog "Outline checked."
479 printlog "Shadow checked."
481 '------------Next Tab-----------------
483 printlog "Checking Tabpage Borders."
485 active.SetPage TabUmrandung
486 if (NOT TabUmrandung.Exists) then
487 warnlog "Tabpage Borders missing!"
489 printlog "Tabpage Borders is up."
491 kontext "TabUmrandung"
492 printlog "Checking Style."
493 iItemCount = Stil.GetItemCount
494 printlog "Style has " & iItemCount & " entries."
495 for iItemIndex = 1 to iItemCount
496 Stil.Select(iItemIndex)
499 printlog "Checking Color."
500 iItemCount = StilFarbe.GetItemCount
501 printlog "Color has " & iItemCount & " entries."
502 for iItemIndex = 1 to iItemCount
503 StilFarbe.Select(iItemIndex)
506 printlog "Un-Checking Synchronize."
507 Synchronisieren.UnCheck
508 printlog "Synchronize unchecked."
510 printlog "Checking Left."
512 printlog "Maximum Left is " & Links.GetText & "."
514 printlog "Minimum Left is " & Links.GetText & "."
516 printlog "Checking Right."
518 printlog "Maximum Right is " & Rechts.GetText & "."
520 printlog "Minimum Right is " & Rechts.GetText & "."
522 printlog "Checking Top."
524 printlog "Maximum Top is " & Oben.GetText & "."
526 printlog "Minimum Top is " & Oben.GetText & "."
528 printlog "Checking Bottom."
530 printlog "Maximum Bottom is " & Unten.GetText & "."
532 printlog "Minimum Bottom is " & Unten.GetText & "."
534 '------------Next Tab-----------------
536 printlog "Checking Tabpage Background."
538 active.SetPage TabArea
539 if (NOT TabArea.Exists) then
540 warnlog "Tabpage Area missing!"
542 printlog "Tabpage Area is up."
546 iItemCount = FillOptions.GetItemCount
547 for iItemIndex = 2 to iItemCount
548 FillOptions.Select(iItemIndex)
550 printlog "Tabpage Background tested."
552 printlog "Format Cells dialog closed."
553 printlog "Toolbar tested."
555 printlog " Closing doc."
558 endcase 'tiTableObjectBar
560 '-------------------------------------------------------------------------------