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: c_printrange.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 08:05:51 $
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 : oliver.craemer@sun.com
36 '* short description : spreadsheet printrange test
38 '*************************************************************************
40 ' #1 tDefinePrintRange
42 ' #1 tRemovePrintRangeByContext
43 ' #1 tRemovePrintRangeByMenu
44 ' #1 tNamedRangeToPrintRange
46 ' #1 tPrintRangeMouseSelection
47 ' #1 tEmptyRangeMessagebox
49 '\************************************************************************
50 'TODO: three test cases to go
54 Printlog Chr(13) + "--------- printrange ---------"
56 call tDefinePrintRange
58 call tRemovePrintRangeByContext
59 call tRemovePrintRangeByMenu
60 call tNamedRangeToPrintRange
62 call tPrintRangeMouseSelection
63 call tEmptyRangeMessagebox
67 '---------------------------------------------------------------------------
69 testcase tDefinePrintRange
71 dim sRangeFile as string
72 dim sLocalFile as string
74 sRangeFile = convertpath ( gTesttoolpath & "spreadsheet/optional/input/printrange.sxc" )
75 sLocalFile = convertpath ( gOfficepath & "user/work/defineprintrange." & sDefaultExtension )
77 printlog " Load testdocument and save locally with current filter"
78 call hFileOpen ( sRangeFile )
79 if not hFileSaveAsWithFilterKill( sLocalFile , sDefaultCalcFilter ) then
80 warnlog "Saving test document localy failed -> Aborting"
85 printlog " Select area B2:E5"
86 call fCalcSelectRange("B2:E5")
87 printlog " Define print range by menu Format-Print Ranges-Define"
88 FormatPrintRangesDefine
89 printlog " Activate Page Preview (File-Page Preview)"
92 printlog " Check if there is only one page as output"
94 'now all navigation buttons should be deactivated
95 'if this is true there's only one page to print
96 'that's what we check now
97 printlog "Check if all navigation buttons do not work"
98 printlog "True -> Only one page to print (expected result)"
99 printlog "False -> BUG"
102 OL_SEITENANSICHT_NaechsteSeiteCalc
103 warnlog "+ There seems to be more than one page -> BUG!?"
105 printlog " + OK, 'next page' button does not work"
109 OL_SEITENANSICHT_VorherigeSeiteCalc
110 warnlog "+ There seems to be more than one page -> BUG!?"
112 printlog " + OK, 'previous page' button does not work"
116 OL_SEITENANSICHT_ErsteSeiteCalc
117 warnlog "+ There seems to be more than one page -> BUG!?"
119 printlog " + OK, 'first page' button does not work"
123 OL_SEITENANSICHT_LetzteSeiteCalc
124 warnlog "+ There seems to be more than one page -> BUG!?"
126 printlog " + OK, 'last page' button does not work"
128 printlog " Close page preview"
130 printlog " Enable View-Page Break Preview"
132 printlog " Select area A1:C10"
133 call fCalcSelectRange("A1:C10")
134 printlog " Call context Define Print Range"
135 Kontext "DocumentCalc"
136 DocumentCalc.MouseMove(5,5)
138 DocumentCalc.OpenContextMenu
140 'Because of the SunSearchToolbar, which is not available on OOo by default the count of
141 'entries in the context could vary, therefor the desired entry must be searched.
142 if hMenuFindSelect(26602, true, 3) = false then
143 Warnlog "Context-Menu-entry `Define Print Range` was not found. Therefore the test ends."
147 printlog "+ 'Define Print Range' was selected in context menu"
148 printlog " Activate Page Preview (File-Page Preview)"
151 '///+ Check if there is only one page as output</li>
153 'now all navigation buttons should be deactivated
154 'if this is true there's only one page to print
155 'that's what we check now
156 printlog "Check if all navigation buttons do not work"
157 printlog "True -> Only one page to print (expected result)"
158 printlog "False -> BUG"
161 OL_SEITENANSICHT_NaechsteSeiteCalc
162 warnlog "+ There seems to be more than one page -> BUG!?"
164 printlog " + OK, 'next page' button does not work"
168 OL_SEITENANSICHT_VorherigeSeiteCalc
169 warnlog "+ There seems to be more than one page -> BUG!?"
171 printlog " + OK, 'previous page' button does not work"
175 OL_SEITENANSICHT_ErsteSeiteCalc
176 warnlog "+ There seems to be more than one page -> BUG!?"
178 printlog " + OK, 'first page' button does not work"
182 OL_SEITENANSICHT_LetzteSeiteCalc
183 warnlog "+ There seems to be more than one page -> BUG!?"
185 printlog " + OK, 'last page' button does not work"
187 printlog " Close page preview"
189 printlog " At last check if the expected print range is selected"
190 FormatPrintRangesEdit
191 Kontext "DruckbereicheBearbeiten"
192 if DruckBereich.GetText = "$A$1:$C$10" then
193 printlog " Print range selection as expected"
195 warnlog "Expected print range is <$A$1:$C$10>, but we got: " & DruckBereich.GetText
197 DruckbereicheBearbeiten.Cancel
203 '---------------------------------------------------------------------------
205 testcase tAddPrintRange
207 dim sRangeFile as string
208 dim sLocalFile as string
210 sRangeFile = convertpath ( gTesttoolpath & "spreadsheet/optional/input/printrange.sxc" )
211 sLocalFile = convertpath ( gOfficepath & "user/work/addprintrange" & sDefaultExtension )
213 printlog " Load testdocument printrange.sxc and save locally with current filter"
214 call hFileOpen ( sRangeFile )
215 if ( not hFileSaveAsWithFilterKill( sLocalFile , sDefaultCalcFilter ) ) then
216 warnlog "Saving test document localy failed -> Aborting"
221 printlog " Select area H11:J15"
223 call fCalcSelectRange("H11:J15")
224 printlog " Define print range by menu Format-Print Ranges-Define"
225 FormatPrintRangesDefine
226 printlog " Select area E41:H55"
227 call fCalcSelectRange("E41:H55")
228 printlog " Add print range by menu Format-Print Ranges-Add"
230 printlog " Select area A1:F15"
231 call fCalcSelectRange("A1:F20")
232 printlog " Call context Add Print Range"
233 Kontext "DocumentCalc"
234 DocumentCalc.MouseMove(5,5)
236 DocumentCalc.OpenContextMenu
238 'Because of the SunSearchToolbar, which is not available on OOo by default the count of
239 'entries in the context could vary, therefor the desired entry must be searched.
240 if hMenuFindSelect(26651, true, 3) = false then
241 Warnlog "Context-Menu-entry `Add Print Range` was not found. Therefore the test ends."
245 printlog "+ <Add Print Range> was selected in context menu"
247 printlog " Save and Reload"
252 printlog " Check if the expected print range is selected"
253 FormatPrintRangesEdit
254 Kontext "DruckbereicheBearbeiten"
255 if DruckBereich.GetText = "$H$11:$J$15;$E$41:$H$55;$A$1:$F$20" then
256 printlog "Print range selection as expected"
258 warnlog "Expected print range is <$H$11:$J$15;$E$41:$H$55;$A$1:$F$20>, but we got: " & DruckBereich.GetText
260 DruckbereicheBearbeiten.Cancel
262 printlog " Check if the expected number of pages will be print"
265 if Active.exists( 2 ) then
271 if SeitenText.GetText = "1-3" then
272 printlog "+ Pages to print as expected"
274 warnlog "Expected pages to print are <1-3>, but we got: " & SeitenText.GetText
282 '---------------------------------------------------------------------------
284 testcase tRemovePrintRangeByContext
286 dim sRangeFile as string
287 dim sLocalFile as string
289 sRangeFile = convertpath ( gTesttoolpath & "spreadsheet/optional/input/printranges_3defined.ods" )
290 sLocalFile = convertpath ( gOfficepath & "user/work/removeprintrange." & sDefaultExtension )
292 printlog " Open test document '.../spreadsheet/optional/input/printranges_3defined.ods'"
293 call hFileOpen ( sRangeFile )
294 printlog " Save file locally '.../user/work/removeprintrange.ods'"
295 if ( not hFileSaveAsWithFilterKill( sLocalFile , sDefaultCalcFilter ) ) then
296 warnlog "Saving test document localy failed -> Aborting"
301 printlog " Invoke Format::Print Ranges::Edit"
302 FormatPrintRangesEdit
303 Kontext "DruckbereicheBearbeiten"
304 printlog " Check if print range is '$H$11:$J$15;$E$41:$H$55;$A$1:$F$20'"
305 if DruckBereich.GetText = "$H$11:$J$15;$E$41:$H$55;$A$1:$F$20" then
306 printlog "+ Print range selection as expected"
308 warnlog "Expected print range is <$H$11:$J$15;$E$41:$H$55;$A$1:$F$20>, but we got: " & DruckBereich.GetText
310 printlog " Cancel print range dialog"
311 DruckbereicheBearbeiten.Cancel
313 Kontext "DocumentCalc"
314 printlog " Click in right buttom corner"
315 call gMouseClick ( 95, 95 )
317 printlog " Open context menu"
318 DocumentCalc.OpenContextMenu
320 printlog " Select 'Undo Print Range' in context menu"
321 'Because of the SunSearchToolbar, which is not available on OOo by default the count of
322 'entries in the context could vary, therefor the desired entry must be searched.
323 if hMenuFindSelect(26603, true, 3) = false then
324 warnlog "Context-Menu-entry `Undo Print Range` was not found. Therefore the test ends."
328 printlog "+ <Undo Print Range> was selected in context menu"
330 printlog " Invoke Format::Print Ranges::Edit"
331 FormatPrintRangesEdit
332 Kontext "DruckbereicheBearbeiten"
333 printlog " Check if no print range is defined"
334 if DruckBereich.GetText = "" then
335 printlog "+ No print range selected as expected"
337 warnlog "Expected print range is <EMPTY>, but we got: " & DruckBereich.GetText
339 DruckbereicheBearbeiten.Cancel
342 printlog " Close document"
348 '---------------------------------------------------------------------------
350 testcase tRemovePrintRangeByMenu
352 dim sRangeFile as string
353 dim sLocalFile as string
355 sRangeFile = convertpath ( gTesttoolpath & "spreadsheet/optional/input/printranges_3defined.ods" )
356 sLocalFile = convertpath ( gOfficepath & "user/work/removeprintrange." & sDefaultExtension )
358 printlog " Open test document '.../spreadsheet/optional/input/printranges_3defined.ods'"
359 call hFileOpen ( sRangeFile )
360 printlog " Save file locally '.../user/work/removeprintrange.ods'"
361 if ( not hFileSaveAsWithFilterKill( sLocalFile , sDefaultCalcFilter ) ) then
362 warnlog "Saving test document localy failed -> Aborting"
367 printlog "Invoke Format::Print Ranges::Edit"
368 FormatPrintRangesEdit
369 Kontext "DruckbereicheBearbeiten"
370 printlog " Check if print range is '$H$11:$J$15;$E$41:$H$55;$A$1:$F$20'"
371 if DruckBereich.GetText = "$H$11:$J$15;$E$41:$H$55;$A$1:$F$20" then
372 printlog "+ Print range selection as expected"
374 warnlog "Expected print range is <$H$11:$J$15;$E$41:$H$55;$A$1:$F$20>, but we got: " & DruckBereich.GetText
376 printlog "Cancel print range dialog"
377 DruckbereicheBearbeiten.Cancel
379 Kontext "DocumentCalc"
380 printlog " Invoke Format::Print Ranges::Remove"
381 FormatPrintRangesRemove
382 printlog " Invoke Format::Print Ranges::Edit"
383 FormatPrintRangesEdit
384 printlog " Check if no print range is defined"
385 Kontext "DruckbereicheBearbeiten"
386 if DruckBereich.GetText = "" then
387 printlog "+ No print range selected as expected"
389 warnlog "Expected print range is <EMPTY>, but we got: " & DruckBereich.GetText
391 printlog " Cancel print range dialog"
392 DruckbereicheBearbeiten.Cancel
393 printlog " Undo removal"
396 printlog " Invoke Format::Print Ranges::Edit"
397 FormatPrintRangesEdit
398 Kontext "DruckbereicheBearbeiten"
399 printlog " Check if print range is '$H$11:$J$15;$E$41:$H$55;$A$1:$F$20'"
400 if DruckBereich.GetText = "$H$11:$J$15;$E$41:$H$55;$A$1:$F$20" then
401 printlog "+ Print range selection as expected"
403 warnlog "Expected print range is <$H$11:$J$15;$E$41:$H$55;$A$1:$F$20>, but we got: " & DruckBereich.GetText
405 printlog " Cancel print range dialog"
406 DruckbereicheBearbeiten.Cancel
407 printlog " Redo removal"
409 printlog " Invoke Format::Print Ranges::Edit"
410 FormatPrintRangesEdit
411 Kontext "DruckbereicheBearbeiten"
412 printlog " Check if no print range is defined"
413 if DruckBereich.GetText = "" then
414 printlog "+ No print range selected as expected"
416 warnlog "Expected print range is <EMPTY>, but we got: " & DruckBereich.GetText
418 printlog " Cancel print range dialog"
419 DruckbereicheBearbeiten.Cancel
420 printlog " Undo removal"
422 printlog " File::Save"
426 printlog " Close document"
428 printlog " Re-open document"
429 call hFileOpen ( sLocalFile )
430 printlog " Invoke Format::Print Ranges::Edit"
431 FormatPrintRangesEdit
432 Kontext "DruckbereicheBearbeiten"
433 printlog " Check if print range is '$H$11:$J$15;$E$41:$H$55;$A$1:$F$20'"
434 if DruckBereich.GetText = "$H$11:$J$15;$E$41:$H$55;$A$1:$F$20" then
435 printlog "+ Print range selection as expected"
437 warnlog "Expected print range is <$H$11:$J$15;$E$41:$H$55;$A$1:$F$20>, but we got: " & DruckBereich.GetText
440 DruckbereicheBearbeiten.Cancel
441 printlog " Cancel print range dialog"
443 printlog " Close document"
449 '---------------------------------------------------------------------------
451 testcase tNamedRangeToPrintRange
453 dim sLocalFile as STRING
454 sLocalFile = convertpath ( gOfficepath & "user/work/namedRange." & sDefaultExtension )
455 dim sAnotherFile as STRING
456 sAnotherFile = convertpath ( gOfficepath & "user/work/namedRange1." & sDefaultExtension )
457 dim sLocalFileXLS as STRING
458 sLocalFileXLS = convertpath ( gOfficepath & "user/work/namedRange.xls" )
459 dim sFormatXLS as STRING
460 sFormatXLS = "MS Excel 97"
461 dim sRangeToSelect as STRING
462 sRangeToSelect = "$B$3:$D$5"
463 dim sRangeName as STRING
464 sRangeName = "NamedRange"
465 dim sNewRangeToSelect as STRING
466 sNewRangeToSelect = "$C$4:$E$6"
468 printlog "Use named range as print range"
470 printlog " Open new document"
472 printlog " Select range '$B$3:$D$5'"
473 fCalcSelectRange ( sRangeToSelect )
474 printlog " Name this range 'NamedRange'"
475 fCalcNameRange ( sRangeName )
476 printlog " Invoke Insert::Names::Define"
479 Kontext "NamenFestlegen"
480 printlog " Select previously defined range"
481 BereichsName.typekeys "N"
483 printlog " Click 'More' button"
485 printlog " Check 'Print range'"
489 printlog " Invoke Format::Print Ranges::Edit"
490 FormatPrintRangesEdit
491 Kontext "DruckbereicheBearbeiten"
492 printlog " Select 'NamedRange' as print range"
493 DruckbereichListe.select ( sRangeName )
494 printlog " Check if this is item no.5"
495 if NOT DruckbereichListe.getSelIndex = 5 then
496 warnlog "Unexpected selection for 'print range' listbox"
498 printlog " Check if the according string is '$B$3:$D$5'"
499 if Druckbereich.getText <> sRangeToSelect then
500 warnlog "Unexpected string in 'print range' textbox"
503 DruckbereicheBearbeiten.OK
504 printlog " Save file locally '.../user/work/namedRange.ods'"
505 if ( not hFileSaveAsWithFilterKill( sLocalFile , sDefaultCalcFilter ) ) then
506 warnlog "Saving test document localy failed -> Aborting"
510 printlog " Close document"
512 printlog " Open document"
513 call hFileOpen ( sLocalFile )
514 printlog " Invoke Format::Print Ranges::Edit"
515 FormatPrintRangesEdit
516 Kontext "DruckbereicheBearbeiten"
517 printlog " Check if item no.5 is selected as print range"
518 if DruckbereichListe.getSelIndex <> 5 then
519 warnlog "Unexpected selection for 'print range' listbox"
521 printlog " Check if 'NamedRange' is selected as print range"
522 if DruckbereichListe.getSelText <> sRangeName then
523 warnlog "Unexpected selection for 'print range' listbox"
525 printlog " Check if the according string is '$B$3:$D$5'"
526 if Druckbereich.getText <> sRangeToSelect then
527 warnlog "Unexpected string in 'print range' textbox"
529 printlog " Cancel print range dialog"
530 DruckbereicheBearbeiten.Cancel
531 printlog " Save filein Excel97/2000/XP format '.../user/work/namedRange.xls'"
532 if NOT hFileSaveAsWithFilterKill ( sLocalFileXLS , sFormatXLS ) then
533 warnlog "Saving test document localy failed -> Aborting"
537 printlog " Close document"
539 printlog " Open document"
540 call hFileOpen ( sLocalFileXLS )
541 printlog " Invoke Format::Print Ranges::Edit"
542 FormatPrintRangesEdit
543 Kontext "DruckbereicheBearbeiten"
544 printlog " Check if item no.5 is selected as print range"
545 if DruckbereichListe.getSelIndex <> 5 then
546 warnlog "Unexpected selection for 'print range' listbox"
548 printlog " Check if the according string is '$B$3:$D$5'"
549 if Druckbereich.getText <> sRangeToSelect then
550 warnlog "Unexpected string in 'print range' textbox"
552 printlog " Cancel print range dialog"
553 DruckbereicheBearbeiten.Cancel
554 printlog " Invoke Insert::Names::Define"
557 Kontext "NamenFestlegen"
558 printlog " Select entry 'NamedRange'"
559 BereichsName.typekeys "N"
561 printlog " Assign new range, '$C$4:$E$6'"
562 ZugeordnetZu.SetText ( sNewRangeToSelect )
563 printlog " Click 'More'"
565 printlog " Check 'Print range'"
569 printlog " Invoke Format::Print Ranges::Edit"
570 FormatPrintRangesEdit
571 Kontext "DruckbereicheBearbeiten"
572 printlog " Select 'NamedRange' as print range"
573 DruckbereichListe.select ( sRangeName )
574 printlog " Check if this is item no.6"
575 if NOT DruckbereichListe.getSelIndex = 6 then
576 warnlog "Unexpected selection for 'print range' listbox"
578 printlog " Check if the according string is '$C$4:$E$6'"
579 if Druckbereich.getText <> sNewRangeToSelect then
580 warnlog "Unexpected string in 'print range' textbox"
583 DruckbereicheBearbeiten.OK
584 printlog " Save file locally '.../user/work/namedRange1.ods'"
585 if NOT hFileSaveAsWithFilterKill ( sAnotherFile , sDefaultCalcFilter ) then
586 warnlog "Saving test document localy failed -> Aborting"
590 printlog " Close document"
592 printlog " Open document again"
593 call hFileOpen ( sAnotherFile )
594 printlog " Invoke Format::Print Ranges::Edit"
595 FormatPrintRangesEdit
596 Kontext "DruckbereicheBearbeiten"
597 printlog " Check if item no.6 is selected as print range"
598 if DruckbereichListe.getSelIndex <> 6 then
599 warnlog "Unexpected selection for 'print range' listbox"
601 printlog " Check if 'NamedRange' is selected as print range"
602 if DruckbereichListe.getSelText <> sRangeName then
603 warnlog "Unexpected selection for 'print range' listbox"
605 printlog " Check if the according string is '$C$4:$E$6'"
606 if Druckbereich.getText <> sNewRangeToSelect then
607 warnlog "Unexpected string in 'print range' textbox"
609 printlog " Cancel print range dialog"
610 DruckbereicheBearbeiten.Cancel
611 printlog " Close document"
617 '---------------------------------------------------------------------------
619 testcase tEntireSheet
621 dim sRangeFile as STRING
622 sRangeFile = convertpath ( gTesttoolpath & "spreadsheet/optional/input/printrange.xls" )
623 dim sLocalFile as STRING
624 sLocalFile = convertpath ( gOfficepath & "user/work/entireSheet." & sDefaultExtension )
625 dim sLocalFileXLS as STRING
626 sLocalFileXLS = convertpath ( gOfficepath & "user/work/entireSheet.xls" )
627 dim sFormatXLS as STRING
628 sFormatXLS = "MS Excel 97"
630 printlog " Open test document '.../spreadsheet/optional/input/printrange.xls'"
631 call hFileOpen ( sRangeFile )
632 printlog " Save file locally '.../user/work/entireSheet.ods'"
633 if NOT hFileSaveAsWithFilterKill ( sLocalFile , sDefaultCalcFilter ) then
634 warnlog "Saving test document localy failed -> Aborting"
638 printlog " Select second sheet"
639 if NOT fCalcSelectSheet ( 2 ) then
640 warnlog "Selecting sheet no. 2 failed -> Aborting"
644 printlog " Invoke Format::Print Ranges::Edit"
645 FormatPrintRangesEdit
646 Kontext "DruckbereicheBearbeiten"
647 printlog " Check if item no.2 (should be 'entire sheet') is selected in print range listbox"
648 if DruckbereichListe.getSelIndex = 2 then
649 printlog "+ OK, print range is '- entire sheet -'"
651 warnlog "Unexpected print range defined -> Check this out!"
653 printlog " Cancel print range dialog"
654 DruckbereicheBearbeiten.Cancel
655 printlog " Close document"
657 printlog " Open document"
658 call hFileOpen ( sLocalFile )
659 printlog " Select second sheet"
660 if NOT fCalcSelectSheet ( 2 ) then
661 warnlog "Selecting sheet no. 2 failed -> Aborting"
665 printlog " Invoke Format::Print Ranges::Edit"
666 FormatPrintRangesEdit
667 Kontext "DruckbereicheBearbeiten"
668 printlog " Check if item no.2 (should be 'entire sheet') is selected in print range listbox"
669 if DruckbereichListe.getSelIndex = 2 then
670 printlog "+ OK, print range is '- entire sheet -'"
672 warnlog "Unexpected print range defined -> Check this out!"
674 printlog " Cancel print range dialog"
675 DruckbereicheBearbeiten.Cancel
676 printlog " Save filein Excel97/2000/XP format '.../user/work/entireSheet.xls'"
677 if NOT hFileSaveAsWithFilterKill ( sLocalFileXLS , sFormatXLS ) then
678 warnlog "Saving test document localy failed -> Aborting"
682 printlog " Close document"
684 printlog " Open document again"
685 call hFileOpen ( sLocalFileXLS )
686 printlog " Select second sheet"
687 if NOT fCalcSelectSheet ( 2 ) then
688 warnlog "Selecting sheet no. 2 failed -> Aborting"
692 printlog " Invoke Format::Print Ranges::Edit"
693 FormatPrintRangesEdit
694 Kontext "DruckbereicheBearbeiten"
695 printlog " Check if item no.2 (should be 'entire sheet') is selected in print range listbox"
696 if DruckbereichListe.getSelIndex = 2 then
697 printlog "+ OK, print range is '- entire sheet -'"
699 warnlog "Unexpected print range defined -> Check this out!"
701 printlog " Cancel print range dialog"
702 DruckbereicheBearbeiten.Cancel
703 printlog " Close document"
709 '---------------------------------------------------------------------------
711 testcase tPrintRangeMouseSelection
713 dim sLocalFile as STRING
714 sLocalFile = convertpath ( gOfficepath & "user/work/mouseSelection." & sDefaultExtension )
715 dim sSelectedRange as STRING
716 dim sSelectedRows as STRING
717 dim sSelectedColumns as STRING
719 printlog " Open new document"
721 printlog " Invoke Format::Print Ranges::Edit"
722 FormatPrintRangesEdit
723 printlog " Check if all settings are in initial state"
724 Kontext "DruckbereicheBearbeiten"
725 if NOT DruckbereichListe.getSelIndex = 1 then
726 warnlog "Unexpected selection for 'print range' listbox"
728 if NOT WiederholungszeileListe.getSelIndex = 1 then
729 warnlog "Unexpected selection for 'rows to repeat' listbox"
731 if NOT WiederholungsspalteListe.getSelIndex = 1 then
732 warnlog "Unexpected selection for 'columns to repeat' listbox"
734 if Druckbereich.getText <> "" then
735 warnlog "Unexpected string in 'print range' textbox"
737 if Wiederholungszeile.getText <> "" then
738 warnlog "Unexpected string in 'rows to repeat' textbox"
740 if Wiederholungsspalte.getText <> "" then
741 warnlog "Unexpected string in 'columns to repeat' textbox"
744 printlog " Click print range button to shrink dialog"
745 DruckbereichButton.typekeys "<RETURN>"
747 Kontext "DocumentCalc"
748 printlog " Select print range using mouse"
749 DocumentCalc.MouseDown ( 20 , 20 )
750 DocumentCalc.MouseMove ( 60 , 60 )
751 DocumentCalc.MouseUp ( 60 , 60 )
753 Kontext "DruckbereicheBearbeiten"
754 printlog " Click print range button to unshrink dialog again"
755 DruckbereichButton.typekeys "<RETURN>"
756 printlog " Rember to selection for later comparisson"
758 sSelectedRange = Druckbereich.getText
759 printlog " Click 'rows to repeat' button to shrink dialog"
760 WiederholungszeileButton.typekeys "<RETURN>"
762 Kontext "DocumentCalc"
763 printlog " Select 'rows to repeat' using mouse"
764 DocumentCalc.MouseDown ( 10 , 10 )
765 DocumentCalc.MouseMove ( 15 , 30 )
766 DocumentCalc.MouseUp ( 15 , 30 )
768 Kontext "DruckbereicheBearbeiten"
769 printlog " Click 'rows to repeat' button to unshrink dialog again"
770 WiederholungszeileButton.typekeys "<RETURN>"
772 printlog " Remember to selection for later comparisson"
773 sSelectedRows = Wiederholungszeile.getText
774 printlog " Click 'columns to repeat' button to shrink dialog"
775 WiederholungsspalteButton.typekeys "<RETURN>"
777 Kontext "DocumentCalc"
778 printlog " Select 'columns to repeat' using mouse"
779 DocumentCalc.MouseDown ( 10 , 10 )
780 DocumentCalc.MouseMove ( 50 , 15 )
781 DocumentCalc.MouseUp ( 50 , 15 )
783 Kontext "DruckbereicheBearbeiten"
784 printlog " Click 'columns to repeat' button to unshrink dialog again"
785 WiederholungsspalteButton.typekeys "<RETURN>"
787 printlog " Rember to selection for later comparisson"
788 sSelectedColumns = Wiederholungsspalte.getText
791 DruckbereicheBearbeiten.OK
793 printlog " Save file locally '.../user/work/mouseSelection.ods'"
794 if not hFileSaveAsWithFilterKill( sLocalFile , sDefaultCalcFilter ) then
795 warnlog "Saving test document localy failed -> Aborting"
800 printlog " Close document"
802 printlog " Open document again"
803 call hFileOpen ( sLocalFile )
804 printlog " Invoke Format::Print Ranges::Edit"
805 FormatPrintRangesEdit
806 Kontext "DruckbereicheBearbeiten"
807 printlog " Check persistance of all settings"
808 if NOT DruckbereichListe.getSelIndex = 3 then
809 warnlog "Unexpected selection for 'print range' listbox: Item No. " & DruckbereichListe.getSelIndex
811 if NOT WiederholungszeileListe.getSelIndex = 2 then
812 warnlog "Unexpected selection for 'rows to repeat' listbox: Item No. " & WiederholungszeileListe.getSelIndex
814 if NOT WiederholungsspalteListe.getSelIndex = 2 then
815 warnlog "Unexpected selection for 'columns to repeat' listbox: Item No. " & WiederholungsspalteListe.getSelIndex
817 if Druckbereich.getText <> sSelectedRange then
818 warnlog "Unexpected selection in 'print range' textbox"
819 qaErrorLog "Found: " & Druckbereich.getText
820 qaErrorLog "Should: " & sSelectedRange
822 if Wiederholungszeile.getText <> sSelectedRows then
823 warnlog "Unexpected selection in 'rows to repeat' textbox"
824 qaErrorLog "Found: " & Wiederholungszeile.getText
825 qaErrorLog "Should: " & sSelectedRows
827 if Wiederholungsspalte.getText <> sSelectedColumns then
828 warnlog "Unexpected selection in 'columns to repeat' textbox"
829 qaErrorLog "Found: " & Wiederholungsspalte.getText
830 qaErrorLog "Should: " & sSelectedColumns
832 printlog " Cancel print range dialog"
833 DruckbereicheBearbeiten.Cancel
834 printlog " Close document"
840 '---------------------------------------------------------------------------
842 testcase tEmptyRangeMessagebox
844 printlog "If the printrange or sheet is empty there should be a messagebox which says that there is nothing to print"
845 printlog " Open new document"
848 printlog " Print empty document by pressing standardbar button"
849 kontext "Standardbar"
852 printlog " Check that there is a messagebox"
854 if Active.Exists(2) then
855 if Active.GetRT = 304 then
856 printlog "+ The messagebox " & Active.GetText & " has appeared"
859 warnlog "Unexpected objekt: " & Active.GetText & " found!"
867 warnlog "There is no messagebox"
868 kontext "DocumentCalc"
874 if DruckenDlg.Exists( 2 ) then
879 printlog " Enter 1 in A1"
880 Kontext "DocumentCalc"
881 DocumentCalc.TypeKeys "1 <RETURN>"
883 printlog " Select cell A5"
884 if fGotoCell ( "A5" ) <> 0 then
885 warnlog "Could not select cell I2"
890 printlog " Define print range by menu FORMAT / PRINT RANGES / DEFINE"
891 kontext "DocumentCalc"
892 FormatPrintRangesDefine
894 printlog " Print empty range by pressing standardbar button"
895 kontext "Standardbar"
898 printlog " Check that there is a messagebox"
900 if Active.Exists(2) then
901 if Active.GetRT = 304 then
902 printlog "+ The messagebox " & Active.GetText & " has appeared"
905 warnlog "Unexpected objekt: " & Active.GetText & " found!"
913 warnlog "There is no messagebox"
914 kontext "DocumentCalc"
920 if DruckenDlg.Exists( 2 ) then
923 printlog "Close document"