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 2000, 2010 Oracle and/or its affiliates.
7 ' OpenOffice.org - a multi-platform office productivity suite
9 ' This file is part of OpenOffice.org.
11 ' OpenOffice.org is free software: you can redistribute it and/or modify
12 ' it under the terms of the GNU Lesser General Public License version 3
13 ' only, as published by the Free Software Foundation.
15 ' OpenOffice.org is distributed in the hope that it will be useful,
16 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ' GNU Lesser General Public License version 3 for more details
19 ' (a copy is included in the LICENSE file that accompanied this code).
21 ' You should have received a copy of the GNU Lesser General Public License
22 ' version 3 along with OpenOffice.org. If not, see
23 ' <http://www.openoffice.org/license.html>
24 ' for a copy of the LGPLv3 License.
26 '/************************************************************************
28 '* owner : oliver.craemer@oracle.com
30 '* short description : Tool library for Borders and Lines tab-page
32 '**************************************************************************************************
37 '\************************************************************************************************
39 ' ch_tools_tab_borders_lines.inc - A library for automation of tab-pages Borders and Lines
40 ' NOTE: Internal both tab-pages are identical
41 ' This Include contains a set of functions to modify the controls of these tab-pages.
42 ' All functions are designed to return error-codes depending on the behaviour of the action applied.
45 ' Error 1: The basic action beeing applied caused a serious problem, e.g. a crash.
46 ' Error 2 TO 9: A functional problem occured.
47 ' Error 11 TO 19: Wrong marginal conditions end up in Failure, e.g. control not visible.
48 ' NOTE: This errors can also be used for 'negative' testing.
49 ' Error 42: Wrong input. Probably only of interest during test development .
50 ' Error 99: Unexpected behaviour - Shouldn't normally occur.
52 ' Only Errors 42 and 99 throw 'warnlogs'.
53 ' All other errors are silent.
54 ' They only throw QAErrorlogs the give a hint what probably went wrong.
55 ' Expected Errors MUST exclusivly be handled by the calling routine.
57 '--------------------------------------------------------------------
59 function fInvokeTabLine() as INTEGER
61 ' Function to invoke the Borders or Line tab page in several dialogs
65 ' 1 := Serious problem trying to invoke the page
66 ' 2 := Failure (Page not present after invocation)
67 '99 := Unexpected error
69 printlog "** Invoking 'Line' or 'Borders' tab page"
70 '/// Try to change to 'Line' or 'Borders' tab page
73 active.setPage TabFormatChartLine
75 qaErrorLog "Error 1: Invoking tab page 'Line' or 'Borders' failed"
80 '/// Lookup if call was successful
81 Kontext "TabFormatChartLine"
82 if TabFormatChartLine.exists(2) then
83 printlog ">> Tab page 'Line' or 'Borders' is visible now."
86 qaErrorLog "Error 2: OOPS, calling Tab page 'Line' or 'Borders' didn't cause any problem ..."
87 qaErrorLog "..., BUT the page doesn't seem to be visible"
91 if fInvokeTabLine = 99 then
92 warnlog "Error 99: Something unexpected happened!!"
96 '--------------------------------------------------------------------
98 function fCloseTabLineOK() as INTEGER
100 ' Function to close a dialog using OK button while tab page 'Line' or 'Borders' is visible
102 ' Returns error-code:
104 ' 1 := Serious problem trying to Close the page
105 ' 2 := Failure (Page present after applying OK button)
106 '15 := Page not present before closing
107 '99 := Unexpected error
108 printlog "** Closing 'Line' or 'Borders' tab page"
109 Kontext "TabFormatChartLine"
110 '/// Check existence of 'Line' or 'Borders' tab page
111 if TabFormatChartLine.exists(2) then
112 printlog ">> 'Line' or 'Borders' tab page is visible as expected."
114 ' Return Error 15 and quit if page not found
115 qaErrorLog "Error 15: OOPS,'Line' or 'Borders' tab page should be visible ..."
116 qaErrorLog "... this is a BUG or a scripting error -> Check this out!"
120 '/// Click OK button in 'Line' or 'Borders' tab page
122 TabFormatChartLine.OK
124 qaErrorLog "Error 1: Closing the 'Line' or 'Borders' tab page seems to have a serious problem -> Check this out!"
128 '/// Check that the 'Line' or 'Borders' tab page is not available anymore.
129 Kontext "TabFormatChartLine"
130 if TabFormatChartLine.exists(2) then
131 ' Return Error 2 if still present
132 qaErrorLog "Error 2: 'Line' or 'Borders' tab page should be invisible now ..."
133 qaErrorLog "... closing the dialog doesn't seem to work -> Check this out!"
136 printlog ">> Closing 'Line' or 'Borders' tab page seems to work as expected"
140 if fCloseTabLineOK = 99 then
141 warnlog "Error 99: Something unexpected happened!!"