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: ch_tools_tab_pages.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-13 14:27:02 $
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 : Tool library for Borders and Lines tab-page
38 '**************************************************************************************************
43 '\************************************************************************************************
45 ' ch_tools_tab_pages.inc - Library for automation of tab pages
46 ' This Include contains a functions to handle tab-pages.
47 ' All functions are designed to return error-codes depending on the behaviour of the action applied.
50 ' Error 1: The basic action beeing applied caused a serious problem, e.g. a crash.
51 ' Error 2 TO 9: A functional problem occured.
52 ' Error 11 TO 19: Wrong marginal conditions end up in Failure, e.g. control not visible.
53 ' NOTE: This errors can also be used for 'negative' testing.
54 ' Error 42: Wrong input. Probably only of interest during test development .
55 ' Error 99: Unexpected behaviour - Shouldn't normally occur.
57 ' Only Errors 42 and 99 throw 'warnlogs'.
58 ' All other errors are silent.
59 ' They only throw QAErrorlogs the give a hint what probably went wrong.
60 ' Expected Errors MUST exclusivly be handled by the calling routine.
62 '--------------------------------------------------------------------
64 function fInvokeTabPage( oThisPage as OBJECT ) as INTEGER
66 ' Function to invoke a tab page
69 ' Tab page name in declaration
72 ' 1 := Serious problem trying to invoke the page
73 ' 2 := Failure (Page not present after invocation)
74 '99 := Unexpected error
76 printlog "** Invoking tab page"
77 '/// Try to invoke tab page
80 active.setPage oThisPage
82 qaErrorLog "Error 1: Invoking tab page failed"
87 '/// Lookup if call was successful
89 if oThisPage.exists(2) then
90 printlog ">> Tab page is visible now."
93 qaErrorLog "Error 2: OOPS, calling Tab page cause any problem ..."
94 qaErrorLog "..., BUT the page doesn't seem to be visible"
98 if fInvokeTabPage = 99 then
99 warnlog "Error 99: Something unexpected happened!!"
103 '--------------------------------------------------------------------
105 function fCloseTabPage( oThisPage as OBJECT ) as INTEGER
107 ' Function to close a tab page dialog using OK button
110 ' Tab page name in declaration
111 ' Returns error-code:
113 ' 1 := Serious problem trying to Close the page
114 ' 2 := Failure (Page present after applying OK button)
115 '15 := Page not present before closing
116 '99 := Unexpected error
117 printlog "** Closing tab page"
119 '/// Check existence of tab page
120 if oThisPage.exists(2) then
121 printlog ">> Tab page is visible as expected."
123 ' Return Error 15 and quit if page not found
124 qaErrorLog "Error 15: OOPS, tab page should be visible ..."
125 qaErrorLog "... this is a BUG or a scripting error -> Check this out!"
129 '/// Click OK button in tab page
133 qaErrorLog "Error 1: Closing tab page seems to have a serious problem -> Check this out!"
137 '/// Check that of tab page has been gone
139 if oThisPage.exists(2) then
140 ' Return Error 2 if still present
141 qaErrorLog "Error 2: Tab page should be invisible now ..."
142 qaErrorLog "... closing the dialog doesn't seem to work -> Check this out!"
145 printlog ">> Tab page seems to work as expected"
149 if fCloseTabPage = 99 then
150 warnlog "Error 99: Something unexpected happened!!"