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 tiInsertTableUsingToolbarbuttonView
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 if TableObjectBar.NotExists(2) then ViewToolbarsTable
321 ZellenVerbinden.Click
322 printlog "Cells merged."
324 printlog "Checking split cells."
326 printlog "Cells split."
327 Kontext "ZellenTeilen"
329 printlog "SplitCells dialog open."
331 printlog "Maximum SplitCellCount is " & Anzahl.GetText & "."
333 printlog "Minimum SplitCellCount is " & Anzahl.GetText & "."
334 if Horizontal.IsChecked = TRUE then
335 printlog "Horizontally is clicked."
337 warnlog "Horizontally should be clicked by default!"
339 GleichmaessigTeilen.Check
340 printlog "Split Equal checked."
342 printlog "Cells vertically checked."
344 printlog " Checking optimize button 'ToDo: button not working"
345 'Kontext "TableObjectBar"
347 'OptimizeTablebar.Close
349 printlog "Checking Alignment."
350 Kontext "TableObjectBar"
354 printlog "Alignment buttons checked."
356 printlog "Checking inserting and deleting of columns and rows."
358 printlog "Row inserted."
361 printlog "Row deleted."
363 SpalteEinfuegen.Click
364 printlog "Column inserted."
367 printlog "Column deleted."
369 printlog "Checking table design button 'ToDo:needs some further examination here!"
372 printlog "Checking for Table Design in Impress TaskBar or for Dialog in Draw."
373 if (UCase(gApplication)) = "IMPRESS" then
375 if (NOT Tasks.exists) then
376 warnlog "Tasks Panel not visible. Opening now."
379 printlog "Task Pane visible."
382 kontext "TableDesign"
383 if TableDesign.exists then
384 printlog "Table Design Dialog is up."
387 warnlog "TableDesign Dialog for Draw is missing."
391 printlog "Checking Properties button."
392 Kontext "TableObjectBar"
393 TableProperties.Click
395 active.SetPage TabFont
396 if (NOT TabFont.Exists) then
397 warnlog "Tabpage missing!"
399 printlog "Tabpage Font is up."
403 printlog "Checking Fonts Box."
404 iItemCount = Font.GetItemCount
405 printlog "Fontbox has " & iItemCount & " entries."
406 for iItemIndex = 1 to iItemCount
407 Font.Select(iItemIndex)
410 printlog "Checking style box."
411 iItemCount = Style.GetItemCount
412 printlog "Stylebox has " & iItemCount & " entries."
413 for iItemIndex = 1 to iItemCount
414 Style.Select(iItemIndex)
417 printlog "Checking size box."
418 iItemCount = Size.GetItemCount
419 printlog "Sizebox has " & iItemCount & " entries."
420 for iItemIndex = 1 to iItemCount
421 Size.Select(iItemIndex)
424 printlog "Checking language box."
425 iItemCount = Language.GetItemCount
426 printlog "Language box has " & iItemCount & " entries."
427 for iItemIndex = 1 to iItemCount
428 Language.Select(iItemIndex)
431 '------------Next Tab-----------------
433 printlog "Checking Tabpage FontEffects."
435 active.SetPage TabFontEffects
436 if (NOT TabFontEffects.Exists) then
437 warnlog "Tabpage FontEffects missing!"
439 printlog "Tabpage FontEffects is up."
441 kontext "TabFontEffects"
443 printlog "Checking Underlining box."
444 iItemCount = Underline.GetItemCount
445 printlog "Underlining has " & iItemCount & " entries."
446 for iItemIndex = 1 to iItemCount
447 Underline.Select(iItemIndex)
450 printlog "Checking StrikeThrough box."
451 iItemCount = StrikeThrough.GetItemCount
452 printlog "StrikeThrough has " & iItemCount & " entries."
453 for iItemIndex = 1 to iItemCount
454 StrikeThrough.Select(iItemIndex)
457 printlog "Checking individual words."
458 IndividualWords.Check
459 printlog "Individual words checked."
461 printlog "Checking Color box."
462 iItemCount = Color.GetItemCount
463 printlog "Font color has " & iItemCount & " entries."
464 for iItemIndex = 1 to iItemCount
465 Color.Select(iItemIndex)
468 printlog "Checking Relief."
469 iItemCount = Relief.GetItemCount
470 printlog "Relief has " & iItemCount & " entries."
471 for iItemIndex = 1 to iItemCount
472 Relief.Select(iItemIndex)
474 Relief.Select(1) 'setting back Relief, otherwise Outline is greyed out
476 printlog "Checking Outline and Shadow."
478 printlog "Outline checked."
480 printlog "Shadow checked."
482 '------------Next Tab-----------------
484 printlog "Checking Tabpage Borders."
486 active.SetPage TabUmrandung
487 if (NOT TabUmrandung.Exists) then
488 warnlog "Tabpage Borders missing!"
490 printlog "Tabpage Borders is up."
492 kontext "TabUmrandung"
493 printlog "Checking Style."
494 iItemCount = Stil.GetItemCount
495 printlog "Style has " & iItemCount & " entries."
496 for iItemIndex = 1 to iItemCount
497 Stil.Select(iItemIndex)
500 printlog "Checking Color."
501 iItemCount = StilFarbe.GetItemCount
502 printlog "Color has " & iItemCount & " entries."
503 for iItemIndex = 1 to iItemCount
504 StilFarbe.Select(iItemIndex)
507 printlog "Un-Checking Synchronize."
508 Synchronisieren.UnCheck
509 printlog "Synchronize unchecked."
511 printlog "Checking Left."
513 printlog "Maximum Left is " & Links.GetText & "."
515 printlog "Minimum Left is " & Links.GetText & "."
517 printlog "Checking Right."
519 printlog "Maximum Right is " & Rechts.GetText & "."
521 printlog "Minimum Right is " & Rechts.GetText & "."
523 printlog "Checking Top."
525 printlog "Maximum Top is " & Oben.GetText & "."
527 printlog "Minimum Top is " & Oben.GetText & "."
529 printlog "Checking Bottom."
531 printlog "Maximum Bottom is " & Unten.GetText & "."
533 printlog "Minimum Bottom is " & Unten.GetText & "."
535 '------------Next Tab-----------------
537 printlog "Checking Tabpage Background."
539 active.SetPage TabArea
540 if (NOT TabArea.Exists) then
541 warnlog "Tabpage Area missing!"
543 printlog "Tabpage Area is up."
547 iItemCount = FillOptions.GetItemCount
548 for iItemIndex = 2 to iItemCount
549 FillOptions.Select(iItemIndex)
551 printlog "Tabpage Background tested."
553 printlog "Format Cells dialog closed."
554 printlog "Toolbar tested."
556 printlog " Closing doc."
559 endcase 'tiTableObjectBar
561 '-------------------------------------------------------------------------------