'encoding UTF-8 Do not remove or change this line! '************************************************************************* ' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information ' regarding copyright ownership. The ASF licenses this file ' to you under the Apache License, Version 2.0 (the ' "License"); you may not use this file except in compliance ' with the License. You may obtain a copy of the License at ' ' http://www.apache.org/licenses/LICENSE-2.0 ' ' Unless required by applicable law or agreed to in writing, ' software distributed under the License is distributed on an ' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. ' '************************************************************************* '* '* short description : Complete test for data validity '* '\*********************************************************************** testcase tValidity_Check_Message printlog "This test checks, if an error messgae appears, when a wrong content is inserted into the appropriate cells" dim sInputFile as string dim sOutputFile as string dim sMType as string dim sInfoStr as string dim iCount as integer sInputFile = convertpath(gTesttoolPath & "spreadsheet/optional/input/validity.ods") sOutputFile = convertpath (gOfficepath & "user/work/validity.ods.ods)" printlog " Open document gTesttoolPathspreadsheet/optional/input/validity.ods" call hFileOpen (sInputFile) printlog " Save the document under gOfficePathuser/work/validity.ods" if NOT hFileSaveAsWithFilter ( sOutputFile, "calc8" ) then warnlog "Saving test document localy failed -> Aborting" call hCloseDocument goto endsub endif printlog " Do the following operations (see values in table) with every of the 4 sheets." printlog " Goto first cell and insert the correct value" printlog " Press RETURN" printlog " No warning or information message should appear" printlog " Enter the incorrect value" printlog " Press RETURN" printlog " A warning or information message should appear" for iCount = 1 to 4 select case iCount case 1 : sMType = "Stop" : sInfoStr = "First" case 2 : sMType = "Warning" : sInfoStr = "Second" case 3 : sMType = "Information" : sInfoStr = "Third" case 4 : sMType = "Macro" : sInfoStr = "Macro" end select call fCalcSelectSheet(sMType) printlog " *** " & sInfoStr & " it is checked, if the " & sMType & " messages appears, if wrong contents are inserted into the appropriate cells" '///+ next iCount '/// Close the document printlog "Close the document" call hCloseDocument endcase ' '------------------------------------------------------------------------------- ' testcase tValidity_Check_Excel '/// This test checks, if an error messgae appears, when a wrong content is inserted into the appropriate cells dim sInputFile as String dim sOutputFile as String dim sMType as String dim iCount as integer dim sInfoStr as String dim sdecimalseperator as string sDecimalseperator = GetDecimalSeperator sInputFile = convertpath(gTesttoolPath & "spreadsheet/optional/input/validity.ods") sOutputFile = convertpath(gOfficePath & "user/work/validity.xls") '/// Open gTesttoolPath/calc/special/input/validity.ods printlog "Open gTesttoolPath/calc/special/input/validity.ods" call hFileOpen (sInputFile) Kontext "SecurityWarning" '/// If security warning occours click on 'Enable Macros'. if SecurityWarning.exists(2) then SecurityWarning.OK endif sleep (2) '/// Save the document under gOfficePathuser/work/validity.xls (MS Excel 97 format) if NOT hFileSaveAsWithFilterKill ( sOutputFile, "MS Excel 97" ) then warnlog "Saving test document localy failed -> Aborting" call hCloseDocument goto endsub endif sleep (2) '/// Close the document call hCloseDocument sleep (2) '/// Open the exported document call hFileOpen ( sOutputFile ) sleep (2) printlog " Do the following operations (see values in table) with every of the 3 sheets." printlog " Goto first cell and insert the correct value" printlog " Press RETURN" printlog " No warning or information message should appear" printlog " Enter the incorrect value" printlog " Press RETURN" printlog " A warning or information message should appear" for iCount = 1 to 3 select case iCount case 1 : sMType = "Stop" : sInfoStr = "First" case 2 : sMType = "Warning" : sInfoStr = "Second" case 3 : sMType = "Information" : sInfoStr = "Third" end select '/// Do the following operations (see values in table) with every of the 3 sheets. call fCalcSelectSheet(sMType) printlog " *** " & sInfoStr & " it is checked, if the " & sMType & " messages appears, if wrong contents are " & "inserted into the appropriate cells" '///+ next iCount '/// File / Close call hCloseDocument endcase