'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"
'///+
'///+- Goto first cell and insert the correct value
'///+- Press RETURN
'///+- No warning or information message should appear
'///+- Enter the incorrect value
'///+
- Press RETURN
'///+- A warning or information message should appear
'///+
'///+ Cell address | correct value | incorrect value |
'///+ B4 | 3 | 8 |
call check_message(sMType, "B4", "3", "8")
'///+ B5 | 9 | 10 |
call check_message(sMType, "B5", "9", "10")
'///+ B6 | 28 | 25 |
call check_message(sMType, "B6", "28", "25")
'///+ B7 | 10 | 12 |
call check_message(sMType, "B7", "10", "12")
'///+ B8 | 11 | 9 |
call check_message(sMType, "B8", "11", "9")
'///+ B9 | 5 | 3 |
call check_message(sMType, "B9", "5", "3")
'///+ B10 | 1 | 6 |
call check_message(sMType, "B10", "1", "6")
'///+ B11 | 1 | 6 |
call check_message(sMType, "B11", "1", "6")
'///+ B17 | 3,14 | 3,15 |
call check_message(sMType, "B17", "3,14", "3,15")
'///+ B18 | 10,14 | 10,16 |
call check_message(sMType, "B18", "10,14", "10,16")
'///+ B19 | 25,10 | 25,09 |
call check_message(sMType, "B19", "25,10", "25,09")
'///+ B20 | 10,5 | 10,7 |
call check_message(sMType, "B20", "10,5", "10,7")
'///+ B21 | 11,9 | 10 |
call check_message(sMType, "B21", "11,9", "10")
'///+ B22 | 3,145 | 3,14 |
call check_message(sMType, "B22", "3,145", "3,14")
'///+ B23 | 1,45 | 1,38 |
call check_message(sMType, "B23", "1,45", "1,38")
'///+ B24 | 2,03 | 2,15 |
call check_message(sMType, "B24", "2,03", "2,15")
'///+ E4 | 13.12.99 | 13.11.99 |
call check_message(sMType, "E4", "13.12.99", "13.11.99")
'///+ E5 | 12.12.99 | 13.12.99 |
call check_message(sMType, "E5", "12.12.99", "13.12.99")
'///+ E6 | 14.12.99 | 13.12.99 |
call check_message(sMType, "E6", "14.12.99", "13.12.99")
'///+ E7 | 13.12.99 | 14.12.99 |
call check_message(sMType, "E7", "13.12.99", "14.12.99")
'///+ E8 | 13.12.99 | 12.12.99 |
call check_message(sMType, "E8", "13.12.99", "12.12.99")
'///+ E9 | 13.11.99 | 13.12.99 |
call check_message(sMType, "E9", "13.11.99", "13.12.99")
'///+ E10 | 23.12.99 | 12.12.99 |
call check_message(sMType, "E10", "23.12.99", "12.12.99")
'///+ E11 | 24.12.99 | 23.12.99 |
call check_message(sMType, "E11", "24.12.99", "23.12.99")
'///+ E17 | 13:15 | 13:16 |
call check_message(sMType, "E17", "13:15", "13:16")
'///+ E18 | 10:15 | 14:16 |
call check_message(sMType, "E18", "10:15", "14:16")
'///+ E19 | 23:10 | 12:09 |
call check_message(sMType, "E19", "23:10", "12:09")
'///+ E20 | 13:15 | 13:16 |
call check_message(sMType, "E20", "13:15", "13:16")
'///+ E21 | 13:15 | 13:14 |
call check_message(sMType, "E21", "13:15", "13:14")
'///+ E22 | 13:16 | 13:15 |
call check_message(sMType, "E22", "13:16", "13:15")
'///+ E23 | 13:15 | 23:13 |
call check_message(sMType, "E23", "13:15", "23:13")
'///+ E24 | 12:59 | 13:00 |
call check_message(sMType, "E24", "12:59", "13:00")
'///+ H4 | abc | abcd |
call check_message(sMType, "H4", "abc", "abcd")
'///+ H5 | abcdefgrd | aderfgtzjm |
call check_message(sMType, "H5", "abcdefgrd", "aderfgtzjm")
'///+ H6 | rftgzhujikolmnbvcxyaswqepk | ftgzhnujikm,lopredswqayx |
call check_message(sMType, "H6", "rftgzhujikolmnbvcxyaswqepk", "ftgzhnujikm,lopredswqayx")
'///+ H7 | asweqrfvbg | edcvfrtgbnh |
call check_message(sMType, "H7", "asweqrfvbg", "edcvfrtgbnh")
'///+ H8 | edcswxyaqtgb | ujnmkipztr |
call check_message(sMType, "H8", "edcswxyaqtgb", "ujnmkipztr")
'///+ H9 | sdxc | tgb |
call check_message(sMType, "H9", "sdxc", "tgb")
'///+ H10 | rfvbj | dfcvgb |
call check_message(sMType, "H10", "rfvbj", "dfcvgb")
'///+ H11 | g | we |
call check_message(sMType, "H11", "g", "we")
'///+ New featurs OpenOffice 2.0 |
'///+ B30 | February | January |
call check_message(sMType, "B30", "February", "January")
'///+ B31 | May | February |
call check_message(sMType, "B31", "May", "February")
'///+ B32 | June | January |
call check_message(sMType, "B32", "June", "January")
'///+ B33 | August | November |
call check_message(sMType, "B33", "August", "November")
'///+ B34 | September | December |
call check_message(sMType, "B34", "September", "December")
'///+ B35 | October | March |
call check_message(sMType, "B35", "October", "March")
'///+ B36 | July | August |
call check_message(sMType, "B36", "July", "August")
'///+ B37 | April | October |
call check_message(sMType, "B37", "April", "October")
'///+ B38 | Name03 | Name07 |
call check_message(sMType, "B38", "Name03", "Name07")
'///+ E30 | alpha | omega |
call check_message(sMType, "E30", "alpha", "omega")
'///+ E31 | beta | zeta |
call check_message(sMType, "E31", "beta", "zeta")
'///+ E32 | gamma | psi |
call check_message(sMType, "E32", "gamma", "psi")
'///+ E33 | delta | pi/2 |
call check_message(sMType, "E33", "delta", "pi/2")
'///+
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"
'///+
'///+- Goto first cell and insert the correct value
'///+- Press RETURN
'///+- No warning or information message should appear
'///+- Enter the incorrect value
'///+
- Press RETURN
'///+- A warning or information message should appear
'///+
'///+ Cell address | correct value | incorrect value |
'///+ B4 | 3 | 8 |
call check_message(sMType, "B4", "3", "8")
'///+ B5 | 9 | 10 |
call check_message(sMType, "B5", "9", "10")
'///+ B6 | 28 | 25 |
call check_message(sMType, "B6", "28", "25")
'///+ B7 | 10 | 12 |
call check_message(sMType, "B7", "10", "12")
'///+ B8 | 11 | 9 |
call check_message(sMType, "B8", "11", "9")
'///+ B9 | 5 | 3 |
call check_message(sMType, "B9", "5", "3")
'///+ B10 | 1 | 6 |
call check_message(sMType, "B10", "1", "6")
'///+ B11 | 1 | 6 |
call check_message(sMType, "B11", "1", "6")
'///+ B17 | 3,14 | 3,15 |
call check_message(sMType, "B17", "3" & sdecimalseperator & "14", "3" & sdecimalseperator & "15")
'///+ B18 | 10,14 | 10,16 |
call check_message(sMType, "B18", "10" & sdecimalseperator & "14", "10" & sdecimalseperator & "16")
'///+ B19 | 25,10 | 25,09 |
call check_message(sMType, "B19", "25" & sdecimalseperator & "10", "25" & sdecimalseperator & "09")
'///+ B20 | 10,5 | 10,7 |
call check_message(sMType, "B20", "10" & sdecimalseperator & "5", "10" & sdecimalseperator & "7")
'///+ B21 | 11,9 | 10 |
call check_message(sMType, "B21", "11" & sdecimalseperator & "9", "10")
'///+ B22 | 3,145 | 3,14 |
call check_message(sMType, "B22", "3" & sdecimalseperator & "145", "3" & sdecimalseperator & "14")
'///+ B23 | 1,45 | 1,38 |
call check_message(sMType, "B23", "1" & sdecimalseperator & "45", "1" & sdecimalseperator & "38")
'///+ B24 | 2,03 | 2,15 |
call check_message(sMType, "B24", "2" & sdecimalseperator & "03", "2" & sdecimalseperator & "15")
'///+ E4 | 13.12.99 | 13.11.99 |
call check_message(sMType, "E4", "13.12.99", "13.11.99")
'///+ E5 | 12.12.99 | 13.12.99 |
call check_message(sMType, "E5", "12.12.99", "13.12.99")
'///+ E6 | 14.12.99 | 13.12.99 |
call check_message(sMType, "E6", "14.12.99", "13.12.99")
'///+ E7 | 13.12.99 | 14.12.99 |
call check_message(sMType, "E7", "13.12.99", "14.12.99")
'///+ E8 | 13.12.99 | 12.12.99 |
call check_message(sMType, "E8", "13.12.99", "12.12.99")
'///+ E9 | 13.11.99 | 13.12.99 |
call check_message(sMType, "E9", "13.11.99", "13.12.99")
'///+ E10 | 23.12.99 | 12.12.99 |
call check_message(sMType, "E10", "23.12.99", "12.12.99")
'///+ E11 | 24.12.99 | 23.12.99 |
call check_message(sMType, "E11", "24.12.99", "23.12.99")
'///+ E17 | 13:15 | 13:16 |
call check_message(sMType, "E17", "13:15", "13:16")
'///+ E18 | 10:15 | 14:16 |
call check_message(sMType, "E18", "10:15", "14:16")
'///+ E19 | 23:10 | 12:09 |
call check_message(sMType, "E19", "23:10", "12:09")
'///+ E20 | 13:15 | 13:16 |
call check_message(sMType, "E20", "13:15", "13:16")
'///+ E21 | 13:15 | 13:15 |
call check_message(sMType, "E21", "13:15", "13:14")
'///+ E22 | 13:16 | 13:15 |
call check_message(sMType, "E22", "13:16", "13:15")
'///+ E23 | 13:15 | 23:13 |
call check_message(sMType, "E23", "13:15", "23:13")
'///+ E24 | 12:59 | 13:00 |
call check_message(sMType, "E24", "12:59", "13:00")
'///+ H4 | abc | abcd |
call check_message(sMType, "H4", "abc", "abcd")
'///+ H5 | abcdefgrd | aderfgtzjm |
call check_message(sMType, "H5", "abcdefgrd", "aderfgtzjm")
'///+ H6 | rftgzhujikolmnbvcxyaswqepk | ftgzhnujikm,lopredswqayx |
call check_message(sMType, "H6", "rftgzhujikolmnbvcxyaswqepk", "ftgzhnujikm,lopredswqayx")
'///+ H7 | asweqrfvbg | edcvfrtgbnh |
call check_message(sMType, "H7", "asweqrfvbg", "edcvfrtgbnh")
'///+ H8 | edcswxyaqtgb | ujnmkipztr |
call check_message(sMType, "H8", "edcswxyaqtgb", "ujnmkipztr")
'///+ H9 | sdxc | tgb |
call check_message(sMType, "H9", "sdxc", "tgb")
'///+ H10 | rfvbj | dfcvgb |
call check_message(sMType, "H10", "rfvbj", "dfcvgb")
'///+ H11 | g | we |
call check_message(sMType, "H11", "g", "we")
'///+ New featurs OpenOffice 2.0 |
we
'///+ B30 | February | January |
call check_message(sMType, "B30", "February", "January")
'///+ B31 | May | February |
call check_message(sMType, "B31", "May", "February")
'///+ B32 | June | January |
call check_message(sMType, "B32", "June", "January")
'///+ B33 | August | November |
call check_message(sMType, "B33", "August", "November")
'///+ B34 | September | December |
call check_message(sMType, "B34", "September", "December")
'///+ B35 | October | March |
call check_message(sMType, "B35", "October", "March")
'///+ B36 | July | August |
call check_message(sMType, "B36", "July", "August")
'///+ B37 | April | October |
call check_message(sMType, "B37", "April", "October")
'///+ B38 | Name03 | Name07 |
call check_message(sMType, "B38", "Name03", "Name07")
'///+ E30 | alpha | omega |
call check_message(sMType, "E30", "alpha", "omega")
'///+ E31 | beta | zeta |
call check_message(sMType, "E31", "beta", "zeta")
'///+ E32 | gamma | psi |
call check_message(sMType, "E32", "gamma", "psi")
'///+ E33 | delta | pi/2 |
call check_message(sMType, "E33", "delta", "pi/2")
'///+
next iCount
'/// File / Close
call hCloseDocument
endcase