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: i_headerfooter.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 10:42:41 $
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 : Tests the header-footer-function in Impress
38 '*******************************************************************
40 ' #1 tiHeaderFooterSlide
41 ' #1 tiHeaderFooterNotesHandout
43 '\*******************************************************************
45 dim numbervalue1 as integer
49 '------------------------------------------------------------------------------
51 testcase tiHeaderFooterSlide
52 '/// This part checks the first Tabpage of the Header and Footer Dialog
54 Call hNewDocument '/// Open New document
57 ViewHeaderAndFooter '/// View - Header And Footer
60 warnlog " Could'nt open ViewHeaderAndFooter!" '/// Warnlog for not opening dialog
63 printlog " Testing TabHeaderFooterSlide."
64 kontext "TabHeaderFooterSlide"
66 '/// Check Date And Time on first tab
67 if DateTime.Exists = TRUE AND DateTimeFixed.isVisible = TRUE then '/// Testing date and time checkbox
73 if DateTime.IsChecked then
74 printlog " DateTimeFormat-checkbox works."
76 warnlog " Something wrong with the DateTime-checkbox!"
80 warnlog "DateTime does not exist or is not visible."
83 '/// Checking if DateTime checkbox setting is remembered...
85 printlog " Date Time is unchecked now."
89 if DateTime.isChecked then
90 warnlog " Settings of Date Time not remembered!"
92 printlog " Setting of date Time is remembered."
96 '/// Check DateTimeFixed can be checked/unchecked
97 if DateTimeFixed.Exists = TRUE AND DateTimeFixed.isVisible = TRUE then
101 if DateTimeFixed.isChecked = TRUE AND DateTimeVariable.IsChecked = FALSE then
102 printlog " Datetimefixed-checkbox seem to work."
104 warnlog " Datetimefixed-checkbox isnt checked or DateTimeVariable is checked!"
108 warnlog " DateTimeFixed doesnt exist or is not visible!"
111 '/// Can text be inserted in the "fixed"-field?
112 if DateTimeFixedText.exists = TRUE AND DateTimeFixedText.isVisible = TRUE then
113 DateTimeFixedText.settext "lalala"
115 if DateTimeFixedText.gettext <> "lalala" then
116 errorlog " Could'nt write a text to the DateTimeFixedText-field!"
118 printlog " Text is the same."
122 warnlog " DateTimeFixedText doesnt exist or is not visible!"
125 '/// Checking if DateTimeFixed and Text setting is remembered...
128 DateTimeFixedText.settext "lalala"
132 if DateTimeFixedText.gettext <> "lalala" then
133 warnlog " Text in DateTimeFixedText is not the same!"
135 printlog " Text was saved."
137 DateTimeFixedText.settext ""
139 '/// Can I change to "Variable" and check it?
140 if DateTimeVariable.exists = TRUE AND DateTimeVariable.isVisible = TRUE then
141 DateTimeVariable.Check
144 if DateTimeVariable.IsChecked AND DateTimeFixed.IsChecked = FALSE then
145 printlog " DateTimeVariable-checkbox works."
147 warnlog " Something wrong with the DateTimeVariable-checkbox or DateTimeFormat is checked!"
151 warnlog " DateTimeVariable doesnt exist or is not visible!"
154 '/// Is the Variable setting saved?
157 if DateTimeVariable.isChecked then
158 printlog " Variable Setting gets saved."
160 warnlog " Variable setting does not get saved!"
163 '/// Checking DateTimeFormat box
164 if DateTimeFormat.exists = TRUE AND DateTimeFormat.isVisible = TRUE then
165 numbervalue1 = DateTimeFormat.getitemcount '/// Get the number of choices
166 printlog " DateTimeFormat equals: " + numbervalue1
167 value2 = DateTimeFormat.getseltext '/// Get the text for the choosen entry
168 printlog " Tries to get ", numbervalue1 & "."
169 DateTimeFormat.select ( numbervalue1 - 1 ) '/// Select the last entry
170 value3 = DateTimeFormat.getseltext '/// Get the text for the last entry
171 printlog " DateTimeFormat is: " + value3
173 if value2 = value3 then
174 errorlog " More options for Date should exist!" '/// Check if the first and last are the same.
175 DateTimeFormat.select value2 '/// Choose the original state
177 printlog " DateTimeFormat box works."
180 '/// Checking if settings of DateTimeFormat box get saved
183 if DateTimeFormat.GetSelText = value3 then
184 printlog " DateTimeFormat settings get saved."
186 warnlog " DateTimeFormat settings did not get saved!"
190 warnlog " DateTimeFormat doesnt exist or is not visible."
193 '/// Checking DateTimeLanguage box
194 if DateTimeLanguage.exists = TRUE AND DateTimeLanguage.isVisible = TRUE then
195 numbervalue1 = DateTimeLanguage.GetItemCount '/// Get the number of choices
196 DateTimeFormat.select 1 '/// Choose the first entry
197 value2 = DateTimeLanguage.GetSelText '/// Get the text for the choosen entry
198 DateTimeLanguage.select ( numbervalue1 - 1 ) '/// Select the last entry
199 value3 = DateTimeLanguage.GetSelText '/// Get the text for the last entry
201 if value2 = value3 then
202 errorlog " More options for Date should exist!" '/// Check if the first and last aare the same.
203 DateTimeLanguage.select value2 '/// Choose the original state
204 value3 = DateTimeLanguage.GetSelText
206 printlog " DateTimeLanguage box works."
209 '/// Checking if language settings get saved
212 if DateTimeLanguage.GetSelText = value3 then
213 printlog " DateTimeLanguage settings get saved."
215 warnlog " DateTimeLanguage do not get saved!"
219 warnlog " DateTime doesnt exist or is not visible!"
222 '/// Checking Footer checkbox
223 if Footer.exists = TRUE AND Footer.isVisible = TRUE then
227 if Footer.IsChecked then
228 printlog " Footer-checkbox works."
230 errorlog " Something wrong with the Footer-checkbox!"
234 warnlog " Footer checkbox doesnt exist or is not visible!"
237 '/// Checking if Footer setting gest saved
241 if Footer.IsChecked then
242 warnlog " Footer settings do not get saved!"
244 printlog " Footer settings saved."
248 '/// Checking if text can be inserted in FooterFixedText
249 if FooterFixedText.exists = TRUE AND FooterFixedText.isVisible = TRUE then
250 FooterFixedText.SetText "lalala"
252 if FooterFixedText.GetText <> "lalala" then
253 errorlog " Could'nt write a text to the FooterFixedText-field!"
255 printlog " FooterFixedText works."
259 warnlog " Footer doesnt exist or is not visible!"
262 '/// Checking if Footer text gets saved.
266 if FooterFixedText.GetText <>"lalala" then
267 errorlog " Text does not get saved!"
269 printlog " FooterFixedText works."
272 FooterFixedText.SetText ""
274 '/// Checking Slidenumber checkbox
275 if Donotshowonfirstslide.exists = TRUE AND Donotshowonfirstslide.isVisible = TRUE then
279 if Slidenumber.IsChecked then
280 printlog " Slidenumber-checkbox works"
282 warnlog " Something wrong with the slidenumber-checkbox!"
285 warnlog " Do not show on first slide doesnt exist or is not visible!"
288 '/// Checking if Slidenumber gets saved.
292 if Slidenumber.IsChecked then
293 printlog " Slidenumber setting is remembered."
295 warnlog " Slidenumber setting is not remembered!"
298 '/// Checking "Do not show on first slide" checkbox
299 if Donotshowonfirstslide.exists = TRUE AND Donotshowonfirstslide.isVisible = TRUE then
300 Donotshowonfirstslide.UnCheck
302 Donotshowonfirstslide.Check
303 if Donotshowonfirstslide.IsChecked then
304 printlog " Do not show on first slide-checkbox works"
306 errorlog " Something wrong with the Do not show on first slide-checkbox!"
309 warnlog " Do not show on first slide doesnt exist or is not visible!"
312 '/// Checking if Do not show on first slide is saved.
316 if Donotshowonfirstslide.IsChecked then
317 printlog " Do not show on first slide setting is saved."
319 warnlog " Do not show on first slide setting is not saved!"
322 '/// Closing dialog with cancel
324 TabHeaderFooterSlide.Cancel
326 kontext "drawimpress"
334 '----------------------------------------------------------------------------
336 testcase tiHeaderFooterNotesHandout
337 '/// This part checks the second Tabpage of the Header and Footer Dialog for notes and handout
339 Call hNewDocument '/// Open New document
340 kontext "drawimpress"
342 ViewHeaderAndFooter '/// View - Header And Footer
345 warnlog " Could'nt open ViewHeaderAndFooter!" '/// Warnlog for not opening dialog
346 endcatch 'goto endcase
347 kontext " TabHeaderFooterSlide"
349 '/// Change tabpage to HeaderFooterNotesHandout
350 printlog " Testing TabHeaderFooterNotesHandout."
353 active.setpage TabHeaderFooterNotesHandout
355 kontext "TabHeaderFooterNotesHandout"
357 '/// Checking Header checkbox
358 if Header.exists = TRUE AND Header.isVisible = TRUE then
364 if Header.isChecked then
365 printlog " Header-checkbox works."
367 warnlog " Header-checkbox doesn't work!"
371 warnlog " Header doesnt exist or is not visible!"
374 '/// Checking if Header setting is saved.
379 active.setpage TabHeaderFooterNotesHandout
380 kontext "TabHeaderFooterNotesHandout"
382 if Header.IsChecked then
383 warnlog " Header should not be checked!"
385 printlog " Header not checked."
389 '/// Checking if header text can be inserted
390 if HeaderFixedText.exists = TRUE AND HeaderFixedText.isVisible = TRUE then
391 HeaderFixedText.settext "lalala"
394 if HeaderFixedText.gettext <> "lalala" then
395 warnlog " HeaderFixedText is wrong!"
397 printlog " HeaderFixedText works."
400 warnlog " HeaderFixedText doesnt exist or is not visible!"
403 '/// Checking if text is saved.
407 active.setpage TabHeaderFooterNotesHandout
408 kontext "TabHeaderFooterNotesHandout"
409 if HeaderFixedText.gettext <> "lalala" then
410 warnlog " HeaderFixedText does not get saved!"
412 printlog " HeaderFixedText gets saved."
414 HeaderFixedText.SetText ""
416 '/// Checking Date And Time checkbox
417 if DateTime.exists = TRUE AND DateTime.isVisible = TRUE then
423 if DateTime.isChecked then
424 printlog " DateAndTime-checkbox works."
426 warnlog " DateAndTime-checkbox doesnt work!"
430 warnlog " DateTime doesnt exist or is not visible!"
433 '/// Checking if Date and Time setting is saved.
438 active.setpage TabHeaderFooterNotesHandout
439 kontext "TabHeaderFooterNotesHandout"
441 if DateTime.IsChecked then
442 warnlog " DateTime is not saved!"
444 printlog " DateTime gets saved."
448 '/// Check DateTimeFixed can be checked/unchecked
449 if DateTimeFixed.exists = TRUE AND DateTimeFixed.isVisible = TRUE then
451 if DateTimeFixed.isChecked then
452 errorlog "DateTimeFixed shouldnt be checked at this point"
453 DateTimeVariable.check
456 printlog " DateTimeFixed not checked."
459 if DateTimeFixed.isChecked then
460 warnlog " Datetimefixed-checkbox doesnt work!"
463 if DateTimeFixed.isChecked then
464 printlog " Datetimefixed checkbox works."
466 warnlog " DateTimeFixed is not checked!"
470 warnlog " DateTimeFixed doesnt exist or is not visible!"
473 '/// Can text be inserted in the "fixed"-field?
474 if DateTimeFixedText.exists = TRUE AND DateTimeFixedText.isVisible = TRUE then
475 DateTimeFixedText.settext "lalala"
477 if DateTimeFixedText.gettext <> "lalala" then
478 errorlog " Error with writing in the DateTimeFixedText-field!"
480 printlog " DateTimeFixedText works."
483 '/// Checking if DateTimeFixedText gets saved.
487 active.setpage TabHeaderFooterNotesHandout
488 kontext "TabHeaderFooterNotesHandout"
490 if DateTimeFixedText.GetText <> "lalala" then
491 warnlog " DateTimeFixedText does not get saved!"
493 printlog " DateTimeFixedText gets saved."
497 warnlog "DateTimeFixedText doesnt exist or is not visible"
500 '/// Can it be changed to "Variable" and checked?
501 if DateTimeVariable.exists = TRUE AND DateTimeVariable.isVisible = TRUE then
502 DateTimeVariable.Check
505 if DateTimeVariable.IsChecked AND DateTimeFixed.IsChecked = FALSE then
506 printlog " DateTimeVariable-checkbox works."
508 warnlog " Something wrong with the DateTimeVariable-checkbox or DateTimeFormat is checked!"
511 '/// Checking if DateTimeVariable setting gets saved.
515 active.setpage TabHeaderFooterNotesHandout
516 kontext "TabHeaderFooterNotesHandout"
518 if DateTimeVariable.IsChecked then
519 printlog " Variable setting gets saved."
521 warnlog " Variable setting does not get saved!"
525 warnlog " DateTimeVariable doesnt exist or is not visible"
528 '/// Checking format dropdown box
529 numbervalue1 = DateTimeFormat.getitemcount '/// Get the number of choices
530 printlog " DateTimeFormat equals: " + numbervalue1
531 value2 = DateTimeFormat.getseltext '/// Get the text for the choosen entry
532 printlog " Tries to get ", numbervalue1
534 if DateTimeFormat.exists = TRUE AND DateTimeFormat.isVisible = TRUE then
535 DateTimeFormat.select ( numbervalue1 - 1 ) '/// Select the last entry
536 value3 = DateTimeFormat.getseltext '/// Get the text for the last entry
537 printlog " DateTimeFormat is: " + value3
539 if value2 = value3 then
540 errorlog " More options for Date should exist." '/// Check if the first and last are the same.
541 DateTimeFormat.select value2 '/// Choose the original state
543 printlog " DateTimeFormat works."
546 '/// Checking if DateTimeFormat setting gets saved.
550 active.setpage TabHeaderFooterNotesHandout
551 kontext "TabHeaderFooterNotesHandout"
553 if DateTimeFormat.GetSelText = value3 then
554 printlog " DateTimeFormat setting gets saved."
556 warnlog " DateTimeFormat setting does not get saved!"
560 warnlog "DateTimeFormat does not exist or is not visible."
563 if DateTimeLanguage.exists = TRUE AND DateTimeLanguage.isVisible = TRUE then
564 numbervalue1 = DateTimeLanguage.getitemcount '/// Get the number of choices
565 DateTimeFormat.select 1 '/// Choose the first entry
566 value2 = DateTimeLanguage.getseltext '/// Get the text for the choosen entry
567 DateTimeLanguage.select ( numbervalue1 - 1 ) '/// Select the last entry
568 value3 = DateTimeLanguage.getseltext '/// Get the text for the last entry
570 if value2 = value3 then
571 errorlog " More options for Date should exist!" '/// Check if the first and last are the same.
573 printlog " Footer works."
576 '/// Checking if DateTimeLanguage setting gets saved.
580 active.setpage TabHeaderFooterNotesHandout
581 kontext "TabHeaderFooterNotesHandout"
583 if DateTimeLanguage.GetSelText = value3 then
584 printlog " DateTimeLanguage setting gets saved."
586 warnlog " DateTimeLanguage setting does not get saved!"
589 warnlog " DateTimeLanguage does not exist!"
592 '/// Checking Footer checkbox.
593 if Footer.exists = TRUE AND Footer.isVisible = TRUE then
597 warnlog " Footer does not exists!"
600 if Footer.IsChecked = TRUE then
601 warnlog "Footer should NOT be checked at this point"
606 '///Check if Footer setting is saved.
611 active.setpage TabHeaderFooterNotesHandout
612 kontext "TabHeaderFooterNotesHandout"
614 if Footer.IsChecked then
615 warnlog " Footer should not be checked!"
617 printlog " Footer is not checked."
623 '/// Checking if Footer text can be inserted
624 if FooterFixedText.exists = TRUE AND FooterFixedText.isVisible = TRUE then
625 FooterFixedText.SetText "lalala"
628 if FooterFixedText.GetText <> "lalala" then
629 errorlog " Could'nt write a text to the FooterFixedText-field!"
631 printlog " FooterFixedText works."
635 warnlog " FooterFixedText does not exists!"
638 '///Checking if Footer text is saved.
642 active.setpage TabHeaderFooterNotesHandout
643 kontext "TabHeaderFooterNotesHandout"
645 if FooterFixedText.GetText <> "lalala" then
646 warnlog " FooterFixedText does not get saved!"
648 printlog " FooterFixedText gets saved."
651 '/// Checking Slidenumber checkbox
652 if Slidenumber.exists = TRUE AND Slidenumber.isVisible = TRUE then
656 if Slidenumber.IsChecked = TRUE then
657 warnlog " Slidenumber should NOT be checked at this point!"
662 '/// Checking if Slidenumber setting is saved.
666 active.setpage TabHeaderFooterNotesHandout
667 kontext "TabHeaderFooterNotesHandout"
669 if Slidenumber.IsChecked then
670 printlog " Slidenumber setting get saved."
672 warnlog " Slidenumber setting does not get saved!"
676 warnlog " Slidenumber does'nt exist or is not visible!"
679 '/// Close dialog with cancel
681 TabHeaderFooterNotesHandout.Cancel
683 kontext "drawimpress"
691 '-------------------------------------------------------------------------------