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_borders_lines.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_borders_lines.inc - A library for automation of tab-pages Borders and Lines
46 ' NOTE: Internal both tab-pages are identical
47 ' This Include contains a set of functions to modify the controls of these tab-pages.
48 ' All functions are designed to return error-codes depending on the behaviour of the action applied.
51 ' Error 1: The basic action beeing applied caused a serious problem, e.g. a crash.
52 ' Error 2 TO 9: A functional problem occured.
53 ' Error 11 TO 19: Wrong marginal conditions end up in Failure, e.g. control not visible.
54 ' NOTE: This errors can also be used for 'negative' testing.
55 ' Error 42: Wrong input. Probably only of interest during test development .
56 ' Error 99: Unexpected behaviour - Shouldn't normally occur.
58 ' Only Errors 42 and 99 throw 'warnlogs'.
59 ' All other errors are silent.
60 ' They only throw QAErrorlogs the give a hint what probably went wrong.
61 ' Expected Errors MUST exclusivly be handled by the calling routine.
63 '--------------------------------------------------------------------
65 function fInvokeTabLine() as INTEGER
67 ' Function to invoke the Borders or Line tab page in several dialogs
71 ' 1 := Serious problem trying to invoke the page
72 ' 2 := Failure (Page not present after invocation)
73 '99 := Unexpected error
75 printlog "** Invoking 'Line' or 'Borders' tab page"
76 '/// Try to change to 'Line' or 'Borders' tab page
79 active.setPage TabFormatChartLine
81 qaErrorLog "Error 1: Invoking tab page 'Line' or 'Borders' failed"
86 '/// Lookup if call was successful
87 Kontext "TabFormatChartLine"
88 if TabFormatChartLine.exists(2) then
89 printlog ">> Tab page 'Line' or 'Borders' is visible now."
92 qaErrorLog "Error 2: OOPS, calling Tab page 'Line' or 'Borders' didn't cause any problem ..."
93 qaErrorLog "..., BUT the page doesn't seem to be visible"
97 if fInvokeTabLine = 99 then
98 warnlog "Error 99: Something unexpected happened!!"
102 '--------------------------------------------------------------------
104 function fCloseTabLineOK() as INTEGER
106 ' Function to close a dialog using OK button while tab page 'Line' or 'Borders' is visible
108 ' Returns error-code:
110 ' 1 := Serious problem trying to Close the page
111 ' 2 := Failure (Page present after applying OK button)
112 '15 := Page not present before closing
113 '99 := Unexpected error
114 printlog "** Closing 'Line' or 'Borders' tab page"
115 Kontext "TabFormatChartLine"
116 '/// Check existence of 'Line' or 'Borders' tab page
117 if TabFormatChartLine.exists(2) then
118 printlog ">> 'Line' or 'Borders' tab page is visible as expected."
120 ' Return Error 15 and quit if page not found
121 qaErrorLog "Error 15: OOPS,'Line' or 'Borders' tab page should be visible ..."
122 qaErrorLog "... this is a BUG or a scripting error -> Check this out!"
126 '/// Click OK button in 'Line' or 'Borders' tab page
128 TabFormatChartLine.OK
130 qaErrorLog "Error 1: Closing the 'Line' or 'Borders' tab page seems to have a serious problem -> Check this out!"
134 '/// Check that the 'Line' or 'Borders' tab page is not available anymore.
135 Kontext "TabFormatChartLine"
136 if TabFormatChartLine.exists(2) then
137 ' Return Error 2 if still present
138 qaErrorLog "Error 2: 'Line' or 'Borders' tab page should be invisible now ..."
139 qaErrorLog "... closing the dialog doesn't seem to work -> Check this out!"
142 printlog ">> Closing 'Line' or 'Borders' tab page seems to work as expected"
146 if fCloseTabLineOK = 99 then
147 warnlog "Error 99: Something unexpected happened!!"