diff options
Diffstat (limited to 'testautomation/spreadsheet/optional/includes')
10 files changed, 3233 insertions, 0 deletions
diff --git a/testautomation/spreadsheet/optional/includes/arrayconstants/c_arrayconstants.inc b/testautomation/spreadsheet/optional/includes/arrayconstants/c_arrayconstants.inc new file mode 100644 index 000000000000..6d57e1f13fcf --- /dev/null +++ b/testautomation/spreadsheet/optional/includes/arrayconstants/c_arrayconstants.inc @@ -0,0 +1,312 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/*********************************************************************** +'* +'* owner : oliver.craemer@oracle.com +'* +'* short description : calc arrayconstants level2 test +'* +'************************************************************************ +'* +' #1 tArrayconstants01 ' Direct input and OASIS format +' #1 tArrayconstants02 ' Import / Export to MSExcel +'* +'\*********************************************************************** + +testcase tArrayconstants01 + + dim sFunctionTRUE as string + dim sFunctionFALSE as string + dim sFunctionSIN as string + dim sError512 as string + dim sError533 as string + dim sdecimalseperator as string + dim sLocalFile as string + dim sCellcontent as string + + sFunctionTRUE = fFunctionName ("TRUE") + sFunctionFALSE = fFunctionName ("FALSE") + sFunctionSIN = fFunctionName ("SIN") + sError512 = fError_l10n ("512") + sError533 = fError_l10n ("533") + sDecimalseperator = GetDecimalSeperator + sLocalFile = convertpath ( gOfficepath & "user/work/arrayconstants.ods" ) + + '///Open new spreadsheet document + printlog "Open new spreadsheet document" + call hNewDocument + + '///In cell A1 enter "={1;2;3}" + printlog "In cell A1 enter ""={1;2;3}""" + call fCalcSelectRange ("A1") + kontext "DocumentCalc" + DocumentCalc.TypeKeys ("={1;2;3} <RETURN>") + '///Check that the cellvalue is "1" + printlog "Check that the cellvalue is ""1""" + call fCalcCompareCellValue ("A1","1") + + '///In cell A2 enter "={1;2;3|4;5;6}" + printlog "In cell A2 enter ""={1;2;3|4;5;6}""" + call fCalcSelectRange ("A2") + kontext "DocumentCalc" + DocumentCalc.TypeKeys ("={1;2;3|4;5;6} <RETURN>") + '///Check that the cellvalue is "1" + printlog "Check that the cellvalue is ""1""" + call fCalcCompareCellValue ("A2","1") + + '///In cell A3 enter "={0;1;2|False;TRUE;"two"}" + printlog "In cell A3 enter ""={0;1;2|" & sFunctionFALSE & ";" & sFunctionTRUE & ";""two""}""" + call fCalcSelectRange ("A3") + kontext "DocumentCalc" + DocumentCalc.TypeKeys ("={0;1;2|" & sFunctionFALSE & ";" & sFunctionTRUE & ";""two""} <RETURN>") + '///Check that the cellvalue is "0" + printlog "Check that the cellvalue is ""0""" + call fCalcCompareCellValue ("A3","0") + + '///Multiselect cells A4:C4, type "=sin({1;2;3})" and press <ctrl shift enter> + printlog "Multiselect cells A4:C4, type ""=sin({1;2;3})"" and press <ctrl shift enter>" + call fCalcSelectRange ("A4:C4") + kontext "DocumentCalc" + DocumentCalc.TypeKeys ("=" & sFunctionSIN & "({1;2;3}) <MOD1 SHIFT RETURN>") + '///Check that the cellvalue of A4 is "0.84" + printlog "Check that the cellvalue of A4 is ""0.8414709848""" + call fCalcSelectRange ("A5") + kontext "DocumentCalc" + DocumentCalc.TypeKeys "=A4<TAB>=B4<TAB>=C4<RETURN>" 'because a part of a matrix is protected we need a helpcell with only the values + call fCalcCompareCellValue ("A5","0" & sDecimalseperator & "8414709848") + '///Check that the cell contents of B4 is "0.91" + printlog "Check that the cell contents of B4 is ""0.9092974268""" + call fCalcCompareCellValue ("B5","0" & sDecimalseperator & "9092974268") + '///Check that the cell contents of C4 is "0.14" + printlog "Check that the cell contents of C4 is ""0.1411200081""" + call fCalcCompareCellValue ("C5","0" & sDecimalseperator & "1411200081") + + '///In cell A6 enter "={1;2|4;5;6}" + printlog "In cell A6 enter ""={1;2|4;5;6}""" + call fCalcSelectRange ("A6") + kontext "DocumentCalc" + DocumentCalc.TypeKeys ("={1;2|4;5;6} <RETURN>") + '///Check that the cellvalue is "Err:512" + printlog "Check that the cellvalue is ""Err:512""" + call fCalcCompareCellValue ("A6",sError512) + + '///In cell A7 enter "={1;2+3}" + printlog "In cell A7 enter ""={1;2+3}""" + call fCalcSelectRange ("A7") + kontext "DocumentCalc" + DocumentCalc.TypeKeys ("={1;2+3} <RETURN>") + '///Check that the cellvalue is "Err:512" + printlog "Check that the cellvalue is ""Err:512""" + call fCalcCompareCellValue ("A7",sError512) + + '///In cell A8 enter "={1;2;{3;4;5}}" + printlog "In cell A8 enter ""={1;2;{3;4;5}}""" + call fCalcSelectRange ("A8") + kontext "DocumentCalc" + DocumentCalc.TypeKeys ("={1;2;{3;4;5}} <RETURN>") + kontext + '///Cancel appearing MsgBox for correction of a wrong formular + if active.exists then + active.no + end if + '///Check that the cellvalue is "Err:533" + printlog "Check that the cellvalue is ""Err:533""" + call fCalcCompareCellValue ("A8",sError533) + + '///In cell A9 enter "={-1;2;3}" + printlog "In cell A9 enter ""={-1;2;3}""" + call fCalcSelectRange ("A9") + kontext "DocumentCalc" + DocumentCalc.TypeKeys ("={-1;2;3} <RETURN>") + '///Check that the cellvalue is "-1" + printlog "Check that the cellvalue is ""-1""" + call fCalcCompareCellValue ("A9",-1) + + '///Save document + printlog "Save document" + call hFileSaveAsKill ( slocalfile ) + + '/// Close document + printlog "Close document" + call hCloseDocument + + '/// Load Document + printlog "Load Document" + call hFileOpen ( slocalfile ) + sleep (2) + + '///Check that all formulars are the same as before. + printlog "Check that all formulars are the same as before." + + '///+Check that the editline shows "={1;2;3}" for cell A1 + printlog " Check that the editline shows ""={1;2;3}"" for cell A1" + scellcontent = "={1;2;3}" + call fCalcCompareCellFormular ("A1",scellcontent) + + '///+Check that the editline shows "={1;2;3|4;5;6}" for cell A2 + printlog " Check that the editline shows ""={1;2;3|4;5;6}"" for cell A2" + scellcontent = "={1;2;3|4;5;6}" + call fCalcCompareCellFormular ("A2",scellcontent) + + '///+Check that the editline shows "={0;1;2|False;TRUE;"two"}" for cell A3 + printlog " Check that the editline shows ""={0;1;2|" & sFunctionFALSE & ";" & sFunctionTRUE & ";""two""}"" for cell A3" + scellcontent = "={0;1;2|" & sFunctionFALSE & ";" & sFunctionTRUE & ";""two""}" + call fCalcCompareCellFormular ("A3",scellcontent) + + '///+Check that the editline shows "=SIN({1;2;3})" for cell A4:C4 + printlog " Check that the editline shows ""=" & sFunctionSIN & "({1;2;3})"" for cell A4:C4" + scellcontent = "=" & sFunctionSIN & "({1;2;3})" + call fCalcCompareCellFormular ("A4:C4",scellcontent) + + '///+Check that the editline shows "={1;2|4;5;6}" for cell A6 + printlog " Check that the editline shows ""={1;2|4;5;6}"" for cell A6" + scellcontent = "={1;2|4;5;6}" + call fCalcCompareCellFormular ("A6",scellcontent) + + '///+Check that the editline shows "={1;2+3}" for cell A7 + printlog " Check that the editline shows ""={1;2+3}"" for cell A7" + scellcontent = "={1;2+3}" + call fCalcCompareCellFormular ("A7",scellcontent) + + '///+Check that the editline shows "={1;2;{3;4;5}}" for cell A8 + printlog " Check that the editline shows ""={1;2;{3;4;5}}"" for cell A8" + scellcontent = "={1;2;{3;4;5}}" + call fCalcCompareCellFormular ("A8",scellcontent) + + '///+Check that the editline shows "={-1;2;3}" for cell A9 + printlog " Check that the editline shows ""={-1;2;3}"" for cell A9" + scellcontent = "={-1;2;3}" + call fCalcCompareCellFormular ("A9",scellcontent) + + '///Close Document + printlog "Close Document" + call hCloseDocument + hFileDelete( sLocalFile ) + +endcase +' +'-------------------------------------------------------------------- +' +testcase tArrayconstants02 + + Dim sImportFile as string + Dim sFunctionSUM as string + Dim sFunctionMDETERM as string + Dim sCellcontent as string + + sImportFile = convertpath ( gTesttoolpath & "spreadsheet/optional/input/arrayconstants.xls" ) + sFunctionSUM = fFunctionName ("SUM") + sFunctionMDETERM = fFunctionName ("MDETERM") + + '///Load xls testdocument <i>gTestToolPath</i>/spreadsheet/optional/input/arrayconstants.xls + printlog "Load xls testdocument <i>gTestToolPath</i>/spreadsheet/optional/input/arrayconstants.xls" + call hFileOpenLocally( sImportFile ) + + '///Check that the cell contents of B4 is 1 + printlog "Check that the cell contents of B4 is 1" + call fCalcCompareCellValue ("F4","1") + '///Check that the cell contents of C5 is 4 + printlog "Check that the cell contents of C5 is 4" + call fCalcCompareCellValue ("G5","4") + '///Check that the editline shows "={1;2|3;4}" for cell B4 + printlog "Check that the editline shows ""={1;2|3;4}"" for cell B4" + scellcontent = "={1;2|3;4}" + call fCalcCompareCellFormular ("B4:C5",scellcontent) + '///Check that the cell contents of B8 is 10 + printlog "Check that the cell contents of B8 is 10" + call fCalcCompareCellValue ("B8","10") + '///Check that the editline for cell B8 is "=SUM({1;2|3;4})" + printlog "Check that the editline for cell B8 is ""=SUM({1;2|3;4})""" + scellcontent = "=" & sFunctionSUM & "({1;2|3;4})" + call fCalcCompareCellFormular ("B8",scellcontent) + '///Check that the cell contents of B11 is -2 + printlog "Check that the cell contents of B11 is -2" + call fCalcCompareCellValue ("B11","-2") + '///Check that the editline for cell B11 is "=MDETERM({1;2|3;4})" + printlog "Check that the editline for cell B11 is ""=MDETERM({1;2|3;4})""" + scellcontent = "=" & sFunctionMDETERM & "({1;2|3;4})" + call fCalcCompareCellFormular ("B11",scellcontent) + '///Check that the cell contents of B14 is 1 + printlog "Check that the cell contents of B14 is 1" + call fCalcCompareCellValue ("F14","1") + '///Check that the editline for cell B14 is "{=name}" + printlog "Check that the editline for cell B14 is ""=name""" + scellcontent = "=name" + call fCalcCompareCellFormular ("B14:C15",scellcontent) + + '/// Save document back to xls locally + printlog "Save document back to xls locally" + call hFileSaveAsKill ( gLastWorkFile ) + + '/// Close document + printlog "Close document" + call hCloseDocument + + '/// Load Document + printlog "Load Document" + call hFileOpen ( gLastWorkFile ) + sleep (2) + + '///Check that all cellvalues are the same as before + printlog "Check that all cellvalues are the same as before" + '///+Check that the cell contents of B4 is 1 + printlog "Check that the cell contents of B4 is 1" + call fCalcCompareCellValue ("F4","1") + '///+Check that the cell contents of C5 is 4 + printlog "Check that the cell contents of C5 is 4" + call fCalcCompareCellValue ("G5","4") + '///+Check that the editline shows "={1;2|3;4}" for cell B4 + printlog "Check that the editline shows ""={1;2|3;4}"" for cell B4" + scellcontent = "={1;2|3;4}" + call fCalcCompareCellFormular ("B4:C5",scellcontent) + '///+Check that the cell contents of B8 is 10 + printlog "Check that the cell contents of B8 is 10" + call fCalcCompareCellValue ("B8","10") + '///+Check that the editline for cell B8 is "=SUM({1;2|3;4})" + printlog "Check that the editline for cell B8 is ""=SUM({1;2|3;4})""" + scellcontent = "=" & sFunctionSUM & "({1;2|3;4})" + call fCalcCompareCellFormular ("B8",scellcontent) + '///+Check that the cell contents of B11 is -2 + printlog "Check that the cell contents of B11 is -2" + call fCalcCompareCellValue ("B11","-2") + '///+Check that the editline for cell B11 is "=MDETERM({1;2|3;4})" + printlog "Check that the editline for cell B11 is ""=MDETERM({1;2|3;4})""" + scellcontent = "=" & sFunctionMDETERM & "({1;2|3;4})" + call fCalcCompareCellFormular ("B11",scellcontent) + '///+Check that the cell contents of B14 is 1 + printlog "Check that the cell contents of B14 is 1" + call fCalcCompareCellValue ("F14","1") + '///+Check that the editline for cell B14 is "{=name}" + printlog "Check that the editline for cell B14 is ""=name""" + scellcontent = "=name" + call fCalcCompareCellFormular ("B14:C15",scellcontent) + + '///Close document + printlog "Close document" + call hCloseDocument + hFileDelete( gLastWorkFile ) + +endcase diff --git a/testautomation/spreadsheet/optional/includes/getpivotdata/c_getpivotdata.inc b/testautomation/spreadsheet/optional/includes/getpivotdata/c_getpivotdata.inc new file mode 100644 index 000000000000..e5f5e406ce60 --- /dev/null +++ b/testautomation/spreadsheet/optional/includes/getpivotdata/c_getpivotdata.inc @@ -0,0 +1,318 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/*********************************************************************** +'* +'* owner : oliver.craemer@oracle.com +'* +'* short description : level 2 test for the getpivotdata function +'* +'************************************************************************ +'* +' #1 tgetpivotdata_function_wizard ' Testcase for manually input of the function +' #1 tgetpivotdata_xls_filter ' Testcase for import/export of the function +'* +'\*********************************************************************** + +testcase tgetpivotdata_function_wizard + + dim stestdocument as string + dim slocalfile as string + dim sfunctionstring as string + dim sfunctionname as string + dim sfunctionwithparameter as string + + stestdocument = Convertpath (gTesttoolPath + "spreadsheet\optional\input\datapilot.ods" ) + slocalfile = Convertpath ( gOfficePath + "user\work\datapilot.ods" ) + setclipboard = "" + + '/// Get localised string for function GETPIVOTDATA by fFunctionname + printlog "Get localised string for function GETPIVOTDATA by fFunctionname" + sfunctionname = fFunctionname("GETPIVOTDATA") + + '/// Load testdocument <i>gTestToolPath</i>/spreadsheet/optional/input/datapilot.ods + printlog "Load testdocument datapilot.ods" + call hFileOpenLocally( stestdocument ) + + '/// Select cell I8 and open function wizard by INSERT FUNCTION + printlog "Select cell I8 and open function wizard by INSERT FUNCTION" + call fGotoCell ( "I8" ) + InsertFunction + kontext ( "FunctionWizard" ) + '/// Select category SPREADSHEET (11th category in listbox) + printlog "Select category SPREADSHEET (11th category in listbox)" + CategoryLB.select 11 + '/// Select the function GETPIVOTDATA in the now filtered function list + printlog "Select the function GETPIVOTDATA in the now filtered function list" + try + FunctionLB.select sfunctionname + printlog " Function " & sfunctionname & " selected in category SPREADSHEET" + catch + warnlog "The function is not available under category SPREADSHEET" + endcatch + CategoryLB.select 2 + try + FunctionLB.select sfunctionname + catch + warnlog "The function is generally not available" + FunctionWizard.OK + call hCloseDocument + goto endsub + endcatch + '/// Press NEXT button + printlog "Press NEXT button" + Forward.click + '/// Enter 2000 for parameter Data Field + printlog "Enter 2000 for parameter Data Field" + kontext "FunctionWizard" + Editfield1.settext "2000" + '/// Enter C29 for parameter DataPilot + printlog "Enter C29 for parameter DataPilot" + Editfield2.settext "C29" + '/// Enter C3 for parameter Field Name / Item 1 + printlog "Enter C3 for parameter Field Name / Item 1" + Editfield3.settext "C3" + '/// Enter C16 for parameter Field Name / Item 2 + printlog "Enter C16 for parameter Field Name / Item 2" + Editfield4.settext "C16" + '/// Scroll down to enable the next field + printlog "Scroll down to enable the next field" + Editfield4.TypeKeys "<DOWN>" + '/// Enter C26 for parameter Field Name / Item 3 + printlog "Enter C26 for parameter Field Name / Item 3" + Editfield4.settext "C26" + '/// Scroll down to enable the next field + printlog "Scroll down to enable the next field" + Editfield4.TypeKeys "<DOWN>" + '/// Enter F27 for parameter Field Name / Item 4 + printlog "Enter F27 for parameter Field Name / Item 4" + Editfield4.settext "F27" + '/// Close functionwizard by pressing OK button + printlog "Close functionwizard by pressing OK button" + FunctionWizard.OK + '/// Memorize cellcontent + kontext ( "RechenleisteCalc" ) + EingabeZeileCalc.TypeKeys ("<f2><mod1 a>") + editcopy + sfunctionwithparameter = GetClipboardText () + '/// Press twice <ESCAPE> to leave the cell + printlog "Press twice <ESCAPE> to leave the cell" + kontext ( "DocumentCalc" ) + DocumentCalc.TypeKeys "<ESCAPE>" , 2 + '/// Verify that the function result is 100000 + printlog "Verify that the function result is 100000" + call fCalcCompareCellValue ( "I8",100000 ) + '/// Save the document again + printlog "Save the document again" + if NOT hFileSaveAsKill (slocalfile) then + warnlog "Saving test document localy failed -> Aborting" + call hCloseDocument + goto endsub + else + printlog " File saved successfully." + end if + '/// Close the file with File/close + printlog "Close the file with File/close" + call hCloseDocument + sleep(3) + '/// Load localy saved document + printlog "Load localy saved document" + call hFileOpen ( slocalfile ) + '/// Verify that cell I8 still shows 100000 + printlog "Verify that cell I8 still shows 100000" + call fCalcCompareCellValue ( "I8",100000 ) + '/// Verify that the function in cell I8 is still =GETPIVOTDATA("2000";C29;C3;C16;C26;F27) + printlog "Verify that the function in cell I8 is still " & sfunctionwithparameter + kontext ( "RechenleisteCalc" ) + EingabeZeileCalc.TypeKeys ("<f2><mod1 a>") + editcopy + if GetClipboardText () = sfunctionwithparameter then + printlog " The function was successfully saved and reloaded" + else warnlog "The function is not " & sfunctionwithparameter & ", it is " & GetClipboardText () + end if + '/// Press twice <ESCAPE> to leave the cell + printlog "Press twice <ESCAPE> to leave the chart object" + kontext "DocumentCalc" + DocumentCalc.TypeKeys "<ESCAPE>" , 2 + '/// Close document + printlog "Close document" + call hCloseDocument + sleep(3) +'/// +endcase +' +'--------------------------------------------------------------------------- +' +testcase tgetpivotdata_xls_filter + + dim stestdocument as string + dim slocalfile as string + dim sfunctionparameter as string + dim sfunctionname as string + dim sfunctionwithparameter as string + dim sdecimalseperator as string + + stestdocument = Convertpath (gTesttoolPath + "spreadsheet\optional\input\getpivotdata2.xls" ) + 'stestdocument = Convertpath ( gOfficePath + "user\work\test.ods" ) + slocalfile = Convertpath ( gOfficePath + "user\work\getpivotdata2.xls" ) + sdecimalseperator = GetDecimalSeperator + setclipboard = "" + sfunctionname = fFunctionname("GETPIVOTDATA") + + '/// Load testdocument <i>gTestToolPath</i>/spreadsheet/optional/input/getpivotdata2.xls + printlog "Load testdocument getpivotdata2.xls" + call hFileOpenLocally( stestdocument ) + '/// Verify that Cell G12 shows 2.5 + printlog "Verify that Cell G12 shows 2" & sdecimalseperator & "5" + call fCalcCompareCellValue ("G12","2" & sdecimalseperator & "5") + '/// Verify that the function is =GETPIVOTDATA("val";$F$5;"col1";"a";"col2";"x") + printlog "Verify that the function is =GETPIVOTDATA(""val"";$F$5;""col1"";""a"";""col2"";""x"")" + kontext ( "RechenleisteCalc" ) + EingabeZeileCalc.TypeKeys ("<f2><mod1 a>") + editcopy + sfunctionwithparameter = GetClipboardText () + '/// Press twice <ESCAPE> to leave the cell + 'printlog "Press twice <ESCAPE> to leave the cell" + kontext ( "DocumentCalc" ) + DocumentCalc.TypeKeys "<ESCAPE>" , 2 + if sfunctionwithparameter = "=" & sfunctionname & "(""val"";$F$5;""col1"";""a"";""col2"";""x"")" then + printlog " The function is correct" + else + warnlog "The function is " & sfunctionwithparameter & " instead of =GETPIVOTDATA(""val"";$F$5;""col1"";""a"";""col2"";""x"")" + end if + + '/// Verify that Cell G27 shows 0.05 + printlog "Verify that Cell G27 shows 0" & sdecimalseperator & "05" + call fCalcCompareCellValue ("G27","0" & sdecimalseperator & "05") + '/// Verify that the function is =GETPIVOTDATA("val";$F$19;"col1";"a";"col2";"y") + printlog "Verify that the function is =GETPIVOTDATA(""val"";$F$19;""col1"";""a"";""col2"";""y"")" + kontext ( "RechenleisteCalc" ) + EingabeZeileCalc.TypeKeys ("<f2><mod1 a>") + editcopy + sfunctionwithparameter = GetClipboardText () + '/// Press twice <ESCAPE> to leave the cell + 'printlog "Press twice <ESCAPE> to leave the cell" + kontext ( "DocumentCalc" ) + DocumentCalc.TypeKeys "<ESCAPE>" , 2 + if sfunctionwithparameter = "=" & sfunctionname & "(""val"";$F$19;""col1"";""a"";""col2"";""y"")" then + printlog " The function is correct" + else + warnlog "The function is " & sfunctionwithparameter & " instead of =GETPIVOTDATA(""val"";$F$19;""col1"";""a"";""col2"";""y"")" + end if + + '/// Verify that Cell G43 shows 3 + printlog "Verify that Cell G43 shows 3" + call fCalcCompareCellValue ("G43","3") + '/// Verify that the function is =GETPIVOTDATA("val";$F$33;"col1";"a";"col2";"z";"col3";"p")) + printlog "Verify that the function is =GETPIVOTDATA(""val"";$F$33;""col1"";""a"";""col2"";""z"";""col3"";""p"")" + kontext ( "RechenleisteCalc" ) + EingabeZeileCalc.TypeKeys ("<f2><mod1 a>") + editcopy + sfunctionwithparameter = GetClipboardText () + '/// Press twice <ESCAPE> to leave the cell + 'printlog "Press twice <ESCAPE> to leave the cell" + kontext ( "DocumentCalc" ) + DocumentCalc.TypeKeys "<ESCAPE>" , 2 + if sfunctionwithparameter = "=" & sfunctionname & "(""val"";$F$33;""col1"";""a"";""col2"";""z"";""col3"";""p"")" then + printlog " The function is correct" + else + warnlog "The function is " & sfunctionwithparameter & " instead of =GETPIVOTDATA(""val"";$F$33;""col1"";""a"";""col2"";""z"";""col3"";""p"")" + end if + + '/// Save document back to xls locally + printlog "Save document back to xls locally" + call hFileSaveAsKill ( slocalfile ) + + '/// Close document + printlog "Close document" + call hCloseDocument + + '/// Load Document + printlog "Load Document" + call hFileOpen ( slocalfile ) + sleep (2) + +'/// Verify that Cell G12 shows 2.5 + printlog "Verify that Cell G12 shows 2" & sdecimalseperator & "5" + call fCalcCompareCellValue ("G12","2" & sdecimalseperator & "5") + '/// Verify that the function is =GETPIVOTDATA("val";$F$5;"col1";"a";"col2";"x") + printlog "Verify that the function is =GETPIVOTDATA(""val"";$F$5;""col1"";""a"";""col2"";""x"")" + kontext ( "RechenleisteCalc" ) + EingabeZeileCalc.TypeKeys ("<f2><mod1 a>") + editcopy + sfunctionwithparameter = GetClipboardText () + '/// Press twice <ESCAPE> to leave the cell + 'printlog " Press twice <ESCAPE> to leave the cell" + kontext ( "DocumentCalc" ) + DocumentCalc.TypeKeys "<ESCAPE>" , 2 + if sfunctionwithparameter = "=" & sfunctionname & "(""val"";$F$5;""col1"";""a"";""col2"";""x"")" then + printlog " The function is correct" + else + warnlog "The function is " & sfunctionwithparameter & " instead of =GETPIVOTDATA(""val"";$F$5;""col1"";""a"";""col2"";""x"")" + end if + + '/// Verify that Cell G27 shows 0.05 + printlog "Verify that Cell G27 shows 0" & sdecimalseperator & "05" + call fCalcCompareCellValue ("G27","0" & sdecimalseperator & "05") + '/// Verify that the function is =GETPIVOTDATA("val";$F$19;"col1";"a";"col2";"y") + printlog "Verify that the function is =GETPIVOTDATA(""val"";$F$19;""col1"";""a"";""col2"";""y"")" + kontext ( "RechenleisteCalc" ) + EingabeZeileCalc.TypeKeys ("<f2><mod1 a>") + editcopy + sfunctionwithparameter = GetClipboardText () + '/// Press twice <ESCAPE> to leave the cell + 'printlog " Press twice <ESCAPE> to leave the cell" + kontext ( "DocumentCalc" ) + DocumentCalc.TypeKeys "<ESCAPE>" , 2 + if sfunctionwithparameter = "=" & sfunctionname & "(""val"";$F$19;""col1"";""a"";""col2"";""y"")" then + printlog " The function is correct" + else + warnlog "The function is " & sfunctionwithparameter & " instead of =GETPIVOTDATA(""val"";$F$19;""col1"";""a"";""col2"";""y"")" + end if + + '/// Verify that Cell G43 shows 3 + printlog "Verify that Cell G43 shows 3" + call fCalcCompareCellValue ("G43","3") + '/// Verify that the function is =GETPIVOTDATA("val";$F$33;"col1";"a";"col2";"z";"col3";"p")) + printlog "Verify that the function is =GETPIVOTDATA(""val"";$F$33;""col1"";""a"";""col2"";""z"";""col3"";""p"")" + kontext ( "RechenleisteCalc" ) + EingabeZeileCalc.TypeKeys ("<f2><mod1 a>") + editcopy + sfunctionwithparameter = GetClipboardText () + '/// Press twice <ESCAPE> to leave the cell + 'printlog " Press twice <ESCAPE> to leave the cell" + kontext ( "DocumentCalc" ) + DocumentCalc.TypeKeys "<ESCAPE>" , 2 + if sfunctionwithparameter = "=" & sfunctionname & "(""val"";$F$33;""col1"";""a"";""col2"";""z"";""col3"";""p"")" then + printlog "The function is correct" + else + warnlog "The function is " & sfunctionwithparameter & " instead of =GETPIVOTDATA(""val"";$F$33;""col1"";""a"";""col2"";""z"";""col3"";""p"")" + end if + + '/// Close document + printlog "Close document" + call hCloseDocument + sleep(3) +endcase diff --git a/testautomation/spreadsheet/optional/includes/import_general/c_import_general.inc b/testautomation/spreadsheet/optional/includes/import_general/c_import_general.inc new file mode 100644 index 000000000000..a12fbb764115 --- /dev/null +++ b/testautomation/spreadsheet/optional/includes/import_general/c_import_general.inc @@ -0,0 +1,171 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'** +'** owner : oliver.craemer@oracle.com +'** +'** short description : Imports every Document from a given path (gsSourcePath variable) +'** +'************************************************************************* +'** +' #1 tLoadAllDocuments (gsSourcePath as string ) +' #1 tLoadSpreadsheetDocument +' #1 fCalcFileOpen +'** +'\******************************************************************* + +sub tLoadAllDocuments ( gsSourcePath as string ) + Dim i as integer + Dim x as integer + + dim gsSourceDocument( 50 ) as string + + printlog "Source path: " & gsSourcePath + 'Get the files into a list. + Call GetAllFileList(gsSourcePath, "*.*" , gsSourceDocument()) + x = ListCount(gsSourceDocument()) + printlog "- " + x + " steps will be done" + for i = 1 to x + printlog "(" & i & "/" & x & "): " & gsSourceDocument(i) + Call tLoadSpreadsheetDocument(gsSourceDocument(i)) + sleep(5) + next i +end sub +' +'------------------------------------------------------------------------------- +' +testcase tLoadSpreadsheetDocument (SourceFile) + + Dim sOnlyFileName as string + Dim sOnlyFileExtension as string + Dim sTempFileName as String + Dim i as integer + + sTempFileName = SourceFile + sOnlyFileName = DateiOhneExt(DateiExtract(SourceFile) + sOnlyFileExtension = GetExtention(sTempFileName) + + select case ( sOnlyFileName ) + case "so3tmpl", "so4tmpl", "so5tmpl" : printlog "Test case: " & sOnlyFileName & "." & sOnlyFileExtension + case else : printlog "Test case: " & sOnlyFileName & "." & sOnlyFileExtension + end select + + 'Maybe file name is empty + if sOnlyFileName > "" then + 'Some extensions make no sense to load + if sOnlyFileExtension <> "so" AND sOnlyFileExtension <> "tmp" AND sOnlyFileExtension <> "dbt" then + if fCalcFileOpen(SourceFile) then + if (hIsNamedDocLoaded (SourceFile)) then + printlog "- loaded" + sleep(15) + Call hCloseDocument + else + warnlog sOnlyFileName + " document has not been loaded correctly [hIsNamedDocLoaded]!" + hFileCloseAll() + endif + else + warnlog sOnlyFileName + " document has not been loaded correctly [fCalcFileOpen; IsItLoaded]!" + hFileCloseAll() + endif + else + printlog "(" + sOnlyFileName + "." + sOnlyFileExtension + ") won't be loaded because of excluded extensions .so and .tmp." + hFileCloseAll() + endif + endif +endcase +' +'------------------------------------------------------------------------------- +' +function fCalcFileOpen (sDocName as string, optional bLinked as boolean) as boolean + Dim sSourceFile as String + 'Loads the spreadsheet documents like hLoadDocument but with special handling of + 'spreadsheet import filter dialogs, like ASCII, Lotus, dBase, CSV, ... + sSourceFile = ConvertPath ( sDocName ) + + fCalcFileOpen = TRUE + if FileExists (sSourceFile) = FALSE then + warnlog "fCalcFileOpen: '" + sSourceFile + "' does not exists!" + fCalcFileOpen = FALSE + else + 'Slot: FileOpen + FileOpen + sleep (1) + Kontext "OeffnenDlg" + Dateiname.SetText(sSourceFile) + sleep (3) + Oeffnen.Click + sleep (20) + + 'If .txt ASCII-filter dialog will come up. + Kontext "AsciiFilterOptionen" + if AsciiFilterOptionen.Exists(1) then + printlog "- ASCII filter dialog is up!" + AsciiFilterOptionen.Ok + endif + + 'If Lotus 1-2-3 or dBase files will be opend the import characters + 'dialog will come up + Kontext "ExportCalc" + if ExportCalc.Exists(1) then + printlog "- Import character set selection dialog is up!" + ExportCalc.Ok + endif + + 'Importing detected (e.g. extension .csv) CSV files will bring + ' up the Text import dialog + Kontext "TextImport" + if TextImport.Exists(1) then + printlog "- Text import dialog is up!" + TextImport.OK + endif + + Kontext "Active" + if Active.Exists(3) then + if IsMissing(bLinked) then + warnlog "fCalcFileOpen: " + Active.GetText + else + printlog "fCalcFileOpen: " + Active.GetText + end if + try + Active.OK + catch + if IsMissing(bLinked) then + 'e.g. Links won't be updated + Active.No + else + 'e.g. Links will be updated + Active.Yes + end if + endcatch + Kontext "OeffnenDlg" + if OeffnenDlg.Exists(1) then + OeffnenDlg.Cancel + fCalcFileOpen = FALSE + Warnlog "fCalcFileOpen: The File-Open-Dialog is open!" + end if + end if + end if +end function diff --git a/testautomation/spreadsheet/optional/includes/namedrange/c_namedrange.inc b/testautomation/spreadsheet/optional/includes/namedrange/c_namedrange.inc new file mode 100755 index 000000000000..25926d626bd4 --- /dev/null +++ b/testautomation/spreadsheet/optional/includes/namedrange/c_namedrange.inc @@ -0,0 +1,188 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : oliver.craemer@oracle.com +'* +'* short description : calc named range level 2 test +'* +'************************************************************************* +'* +' #1 c_namedrange ' Initial routine +' #1 tAssignRangeName +' #1 tCheckErrorInvalidRangeName +' #1 tCheckErrorInvalidRangeSelected +'* +'\************************************************************************ +'TODO: add some old features + +sub cNamedRange + +Printlog Chr(13) + "--------- named range ---------" + + call tAssignRangeName + call tCheckErrorInvalidRangeName + call tCheckErrorInvalidRangeSelected +End sub +' +'--------------------------------------------------------------------------- + +testcase tAssignRangeName + + dim sInputFile as string + sInputFile = convertpath(gTesttoolPath & "spreadsheet/optional/input/namedrange.sxc") + dim sOutputFile as String + sOutputFile = convertpath(gOfficePath & "user/work/assignrangename." & sDefaultExtension) + + + printlog "Assign range names in name box" + + printlog " Load testdocument and save locally with current filter" + call hFileOpen (sInputFile) + if NOT hFileSaveAsWithFilterKill (sOutputFile , "calc8") then + warnlog "Saving test document localy failed -> Aborting" + call hCloseDocument + goto endsub + end if + + printlog " Select range C2:F10" + call fCalcSelectRange("C2:F10") + printlog " Assign name 'FirstRange'" + call fCalcNameRange("FirstRange") + printlog " Select range X31996:AB32005" + call fCalcSelectRange("X31996:AB32005") + printlog " Assign name 'SecondRange'" + call fCalcNameRange("SecondRange") + printlog " Select range IT65533:IU65535" + call fCalcSelectRange("IT65533:IU65535") + printlog " Assign name 'ThördRänge' (Special Characters ;-)" + call fCalcNameRange("ThördRänge") + printlog " Select cell J333" + call fCalcSelectRange("J333") + printlog " Assign name 'OneCell'" + call fCalcNameRange("OneCell") + printlog " Save changes and reload" + FileSave + call hCloseDocument + call hFileOpen (sOutputFile) + printlog " Select range C2:F10" + call fCalcSelectRange("C2:F10") + printlog " Check for formula bar visibility" + Kontext "RechenleisteCalc" + if not RechenleisteCalc.isvisible then + warnlog "Formula bar was expected to be visible" + ViewToolbarsFormulaBar + end if + sleep(2) + printlog " Check name box for 'FirstRange'" + Kontext "RechenleisteCalc" + if Bereich.GetSelText = "FirstRange" then + printlog "Correct name assigned for 'C2:F10'" + else + warnlog "Name for 'C2:F10' is " & Bereich.GetSelText & " instead of 'FirstRange'" + end if + printlog " Select range X31996:AB32005" + call fCalcSelectRange("X31996:AB32005") + printlog " Check name box for 'SecondRange'" + Kontext "RechenleisteCalc" + if Bereich.GetSelText = "SecondRange" then + printlog "Correct name assigned for 'X31996:AB32005'" + else + warnlog "Name for 'X31996:AB32005' is " & Bereich.GetSelText & " instead of 'SecondRange'" + end if + printlog " Select range IT65533:IU65535" + call fCalcSelectRange("IT65533:IU65535") + printlog " Check name box for 'ThördRänge'" + Kontext "RechenleisteCalc" + if Bereich.GetSelText = "ThördRänge" then + printlog "Correct name assigned for 'IT65533:IU65535'" + else + warnlog "Name for 'IT65533:IU65535' is " & Bereich.GetSelText & " instead of 'ThördRänge'" + end if + printlog " Select cell J333" + call fCalcSelectRange("J333") + printlog " Check name box for 'OneCell'" + Kontext "RechenleisteCalc" + if Bereich.GetSelText = "OneCell" then + printlog "Correct name assigned for 'J333'" + else + warnlog "Name for 'J333' is " & Bereich.GetSelText & " instead of 'OneCell'" + end if + printlog " Close document and finish test</ul>" + sleep(2) + call hCloseDocument + + endcase +' +'--------------------------------------------------------------------------- +' +testcase tCheckErrorInvalidRangeName + + printlog "Check for error messages when assigning invalid range name" + printlog " New calc document" + call hNewDocument + printlog " Select range C2:F10" + call fCalcSelectRange("C2:F10") + printlog " Try to assign name '%FirstRange'" + printlog " and check for failture" + if fCalcNameRange("%FirstRange") then + warnlog "OOPS, assigning invalid range name '%FirstRange' should fail!" + else + printlog "Invalid name was not accepted" + end if + printlog " Close document and finish test</ul>" + call hCloseDocument +endcase +' +'--------------------------------------------------------------------------- +' +testcase tCheckErrorInvalidRangeSelected + + printlog "Check for error messages when assigning invalid range name" + printlog " New calc document" + call hNewDocument + printlog " Select range C2:F10" + call fCalcSelectRange("C2:D3") + printlog " Change calc selection mode" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys ("<SHIFT F8>") + printlog " Add random cell to selection" + Kontext "DocumentCalc" + call gMouseClick (90,90) + printlog " Try to assign valid name 'FirstRange'" + printlog " and check for failture" + if fCalcNameRange("FirstRange") then + warnlog "OOPS, assigning invalid range selected with 'FirstRange' should fail!" + else + printlog "Invalid selection was not accepted" + end if + Kontext "DocumentCalc" + printlog " Reset calc selection mode" + DocumentCalc.TypeKeys ("<SHIFT F8>") + printlog " Close document and finish test" + call hCloseDocument +endcase + diff --git a/testautomation/spreadsheet/optional/includes/printrange/c_printrange.inc b/testautomation/spreadsheet/optional/includes/printrange/c_printrange.inc new file mode 100755 index 000000000000..6bfa955a483a --- /dev/null +++ b/testautomation/spreadsheet/optional/includes/printrange/c_printrange.inc @@ -0,0 +1,923 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : oliver.craemer@oracle.com +'* +'* short description : spreadsheet printrange test +'* +'************************************************************************* +'* +' #1 tDefinePrintRange +' #1 tAddPrintRange +' #1 tRemovePrintRangeByContext +' #1 tRemovePrintRangeByMenu +' #1 tNamedRangeToPrintRange +' #1 tEntireSheet +' #1 tPrintRangeMouseSelection +' #1 tEmptyRangeMessagebox +'* +'\************************************************************************ +'TODO: three test cases to go + +sub c_printrange + +Printlog Chr(13) + "--------- printrange ---------" + + call tDefinePrintRange + call tAddPrintRange + call tRemovePrintRangeByContext + call tRemovePrintRangeByMenu + call tNamedRangeToPrintRange + call tEntireSheet + call tPrintRangeMouseSelection + call tEmptyRangeMessagebox + +End sub +' +'--------------------------------------------------------------------------- + +testcase tDefinePrintRange + + dim sRangeFile as string + dim sLocalFile as string + + sRangeFile = convertpath ( gTesttoolpath & "spreadsheet/optional/input/printrange.sxc" ) + sLocalFile = convertpath ( gOfficepath & "user/work/defineprintrange." & sDefaultExtension ) + + printlog " Load testdocument and save locally with current filter" + call hFileOpen ( sRangeFile ) + if not hFileSaveAsWithFilterKill( sLocalFile , sDefaultCalcFilter ) then + warnlog "Saving test document localy failed -> Aborting" + call hCloseDocument + goto endsub + end if + + printlog " Select area B2:E5" + call fCalcSelectRange("B2:E5") + printlog " Define print range by menu Format-Print Ranges-Define" + FormatPrintRangesDefine + printlog " Activate Page Preview (File-Page Preview)" + FilePageView + sleep(2) + printlog " Check if there is only one page as output" + Kontext "Previewbar" + 'now all navigation buttons should be deactivated + 'if this is true there's only one page to print + 'that's what we check now + printlog "Check if all navigation buttons do not work" + printlog "True -> Only one page to print (expected result)" + printlog "False -> BUG" + Kontext "Previewbar" + try + OL_SEITENANSICHT_NaechsteSeiteCalc + warnlog "+ There seems to be more than one page -> BUG!?" + catch + printlog " + OK, 'next page' button does not work" + endcatch + Kontext "Previewbar" + try + OL_SEITENANSICHT_VorherigeSeiteCalc + warnlog "+ There seems to be more than one page -> BUG!?" + catch + printlog " + OK, 'previous page' button does not work" + endcatch + Kontext "Previewbar" + try + OL_SEITENANSICHT_ErsteSeiteCalc + warnlog "+ There seems to be more than one page -> BUG!?" + catch + printlog " + OK, 'first page' button does not work" + endcatch + Kontext "Previewbar" + try + OL_SEITENANSICHT_LetzteSeiteCalc + warnlog "+ There seems to be more than one page -> BUG!?" + catch + printlog " + OK, 'last page' button does not work" + endcatch + printlog " Close page preview" + FilePageView + printlog " Enable View-Page Break Preview" + ViewPageBreakPreview + printlog " Select area A1:C10" + call fCalcSelectRange("A1:C10") + printlog " Call context Define Print Range" + Kontext "DocumentCalc" + DocumentCalc.MouseMove(5,5) + sleep(2) + DocumentCalc.OpenContextMenu + sleep(2) + 'Because of the SunSearchToolbar, which is not available on OOo by default the count of + 'entries in the context could vary, therefor the desired entry must be searched. + if hMenuFindSelect(26602, true, 3) = false then + Warnlog "Context-Menu-entry `Define Print Range` was not found. Therefore the test ends." + Call hCloseDocument + Goto Endsub + end if + printlog "+ 'Define Print Range' was selected in context menu" + printlog " Activate Page Preview (File-Page Preview)" + FilePageView + sleep(2) + '///+ Check if there is only one page as output</li> + Kontext "Previewbar" + 'now all navigation buttons should be deactivated + 'if this is true there's only one page to print + 'that's what we check now + printlog "Check if all navigation buttons do not work" + printlog "True -> Only one page to print (expected result)" + printlog "False -> BUG" + Kontext "Previewbar" + try + OL_SEITENANSICHT_NaechsteSeiteCalc + warnlog "+ There seems to be more than one page -> BUG!?" + catch + printlog " + OK, 'next page' button does not work" + endcatch + Kontext "Previewbar" + try + OL_SEITENANSICHT_VorherigeSeiteCalc + warnlog "+ There seems to be more than one page -> BUG!?" + catch + printlog " + OK, 'previous page' button does not work" + endcatch + Kontext "Previewbar" + try + OL_SEITENANSICHT_ErsteSeiteCalc + warnlog "+ There seems to be more than one page -> BUG!?" + catch + printlog " + OK, 'first page' button does not work" + endcatch + Kontext "Previewbar" + try + OL_SEITENANSICHT_LetzteSeiteCalc + warnlog "+ There seems to be more than one page -> BUG!?" + catch + printlog " + OK, 'last page' button does not work" + endcatch + printlog " Close page preview" + FilePageView + printlog " At last check if the expected print range is selected" + FormatPrintRangesEdit + Kontext "DruckbereicheBearbeiten" + if DruckBereich.GetText = "$A$1:$C$10" then + printlog " Print range selection as expected" + else + warnlog "Expected print range is <$A$1:$C$10>, but we got: " & DruckBereich.GetText + end if + DruckbereicheBearbeiten.Cancel + sleep(2) + call hCloseDocument +endcase + +' +'--------------------------------------------------------------------------- +' +testcase tAddPrintRange + + dim sRangeFile as string + dim sLocalFile as string + + sRangeFile = convertpath ( gTesttoolpath & "spreadsheet/optional/input/printrange.sxc" ) + sLocalFile = convertpath ( gOfficepath & "user/work/addprintrange" & sDefaultExtension ) + + printlog " Load testdocument printrange.sxc and save locally with current filter" + call hFileOpen ( sRangeFile ) + if ( not hFileSaveAsWithFilterKill( sLocalFile , sDefaultCalcFilter ) ) then + warnlog "Saving test document localy failed -> Aborting" + call hCloseDocument + goto endsub + end if + + printlog " Select area H11:J15" + ViewPageBreakPreview + call fCalcSelectRange("H11:J15") + printlog " Define print range by menu Format-Print Ranges-Define" + FormatPrintRangesDefine + printlog " Select area E41:H55" + call fCalcSelectRange("E41:H55") + printlog " Add print range by menu Format-Print Ranges-Add" + FormatPrintRangesAdd + printlog " Select area A1:F15" + call fCalcSelectRange("A1:F20") + printlog " Call context Add Print Range" + Kontext "DocumentCalc" + DocumentCalc.MouseMove(5,5) + sleep(2) + DocumentCalc.OpenContextMenu + sleep(2) + 'Because of the SunSearchToolbar, which is not available on OOo by default the count of + 'entries in the context could vary, therefor the desired entry must be searched. + if hMenuFindSelect(26651, true, 3) = false then + Warnlog "Context-Menu-entry `Add Print Range` was not found. Therefore the test ends." + Call hCloseDocument + Goto Endsub + end if + printlog "+ <Add Print Range> was selected in context menu" + sleep(2) + printlog " Save and Reload" + FileSave + sleep(5) + FileReload + sleep(10) + printlog " Check if the expected print range is selected" + FormatPrintRangesEdit + Kontext "DruckbereicheBearbeiten" + if DruckBereich.GetText = "$H$11:$J$15;$E$41:$H$55;$A$1:$F$20" then + printlog "Print range selection as expected" + else + warnlog "Expected print range is <$H$11:$J$15;$E$41:$H$55;$A$1:$F$20>, but we got: " & DruckBereich.GetText + end if + DruckbereicheBearbeiten.Cancel + sleep(1) + printlog " Check if the expected number of pages will be print" + FilePrint + kontext "Active" + if Active.exists( 2 ) then + Active.ok + end if + + Kontext "Printing" + Kontext "TabPrintGeneral" + PrintPages.check + if PageRange.GetText = "1-3" then + printlog "+ Pages to print as expected" + else + warnlog "Expected pages to print are <1-3>, but we got: " & PageRange.GetText + end if + Kontext "Printing" + Printing.Cancel + sleep(2) + call hCloseDocument +endcase + +' +'--------------------------------------------------------------------------- +' +testcase tRemovePrintRangeByContext + + dim sRangeFile as string + dim sLocalFile as string + + sRangeFile = convertpath ( gTesttoolpath & "spreadsheet/optional/input/printranges_3defined.ods" ) + sLocalFile = convertpath ( gOfficepath & "user/work/removeprintrange." & sDefaultExtension ) + + printlog " Open test document '.../spreadsheet/optional/input/printranges_3defined.ods'" + call hFileOpen ( sRangeFile ) + printlog " Save file locally '.../user/work/removeprintrange.ods'" + if ( not hFileSaveAsWithFilterKill( sLocalFile , sDefaultCalcFilter ) ) then + warnlog "Saving test document localy failed -> Aborting" + call hCloseDocument + goto endsub + end if + + printlog " Invoke Format::Print Ranges::Edit" + FormatPrintRangesEdit + Kontext "DruckbereicheBearbeiten" + printlog " Check if print range is '$H$11:$J$15;$E$41:$H$55;$A$1:$F$20'" + if DruckBereich.GetText = "$H$11:$J$15;$E$41:$H$55;$A$1:$F$20" then + printlog "+ Print range selection as expected" + else + warnlog "Expected print range is <$H$11:$J$15;$E$41:$H$55;$A$1:$F$20>, but we got: " & DruckBereich.GetText + end if + printlog " Cancel print range dialog" + DruckbereicheBearbeiten.Cancel + + Kontext "DocumentCalc" + printlog " Click in right buttom corner" + call gMouseClick ( 95, 95 ) + sleep(2) + printlog " Open context menu" + DocumentCalc.OpenContextMenu + sleep(2) + printlog " Select 'Undo Print Range' in context menu" + 'Because of the SunSearchToolbar, which is not available on OOo by default the count of + 'entries in the context could vary, therefor the desired entry must be searched. + if hMenuFindSelect(26603, true, 3) = false then + warnlog "Context-Menu-entry `Undo Print Range` was not found. Therefore the test ends." + call hCloseDocument + goto endsub + end if + printlog "+ <Undo Print Range> was selected in context menu" + + printlog " Invoke Format::Print Ranges::Edit" + FormatPrintRangesEdit + Kontext "DruckbereicheBearbeiten" + printlog " Check if no print range is defined" + if DruckBereich.GetText = "" then + printlog "+ No print range selected as expected" + else + warnlog "Expected print range is <EMPTY>, but we got: " & DruckBereich.GetText + end if + DruckbereicheBearbeiten.Cancel + + sleep(2) + printlog " Close document" + call hCloseDocument + +endcase + +' +'--------------------------------------------------------------------------- +' +testcase tRemovePrintRangeByMenu + + dim sRangeFile as string + dim sLocalFile as string + + sRangeFile = convertpath ( gTesttoolpath & "spreadsheet/optional/input/printranges_3defined.ods" ) + sLocalFile = convertpath ( gOfficepath & "user/work/removeprintrange." & sDefaultExtension ) + + printlog " Open test document '.../spreadsheet/optional/input/printranges_3defined.ods'" + call hFileOpen ( sRangeFile ) + printlog " Save file locally '.../user/work/removeprintrange.ods'" + if ( not hFileSaveAsWithFilterKill( sLocalFile , sDefaultCalcFilter ) ) then + warnlog "Saving test document localy failed -> Aborting" + call hCloseDocument + goto endsub + end if + + printlog "Invoke Format::Print Ranges::Edit" + FormatPrintRangesEdit + Kontext "DruckbereicheBearbeiten" + printlog " Check if print range is '$H$11:$J$15;$E$41:$H$55;$A$1:$F$20'" + if DruckBereich.GetText = "$H$11:$J$15;$E$41:$H$55;$A$1:$F$20" then + printlog "+ Print range selection as expected" + else + warnlog "Expected print range is <$H$11:$J$15;$E$41:$H$55;$A$1:$F$20>, but we got: " & DruckBereich.GetText + end if + printlog "Cancel print range dialog" + DruckbereicheBearbeiten.Cancel + + Kontext "DocumentCalc" + printlog " Invoke Format::Print Ranges::Remove" + FormatPrintRangesRemove + printlog " Invoke Format::Print Ranges::Edit" + FormatPrintRangesEdit + printlog " Check if no print range is defined" + Kontext "DruckbereicheBearbeiten" + if DruckBereich.GetText = "" then + printlog "+ No print range selected as expected" + else + warnlog "Expected print range is <EMPTY>, but we got: " & DruckBereich.GetText + end if + printlog " Cancel print range dialog" + DruckbereicheBearbeiten.Cancel + printlog " Undo removal" + EditUndo + + printlog " Invoke Format::Print Ranges::Edit" + FormatPrintRangesEdit + Kontext "DruckbereicheBearbeiten" + printlog " Check if print range is '$H$11:$J$15;$E$41:$H$55;$A$1:$F$20'" + if DruckBereich.GetText = "$H$11:$J$15;$E$41:$H$55;$A$1:$F$20" then + printlog "+ Print range selection as expected" + else + warnlog "Expected print range is <$H$11:$J$15;$E$41:$H$55;$A$1:$F$20>, but we got: " & DruckBereich.GetText + end if + printlog " Cancel print range dialog" + DruckbereicheBearbeiten.Cancel + printlog " Redo removal" + EditRedo + printlog " Invoke Format::Print Ranges::Edit" + FormatPrintRangesEdit + Kontext "DruckbereicheBearbeiten" + printlog " Check if no print range is defined" + if DruckBereich.GetText = "" then + printlog "+ No print range selected as expected" + else + warnlog "Expected print range is <EMPTY>, but we got: " & DruckBereich.GetText + end if + printlog " Cancel print range dialog" + DruckbereicheBearbeiten.Cancel + printlog " Undo removal" + EditUndo + printlog " File::Save" + FileSave + + sleep(2) + printlog " Close document" + call hCloseDocument + printlog " Re-open document" + call hFileOpen ( sLocalFile ) + printlog " Invoke Format::Print Ranges::Edit" + FormatPrintRangesEdit + Kontext "DruckbereicheBearbeiten" + printlog " Check if print range is '$H$11:$J$15;$E$41:$H$55;$A$1:$F$20'" + if DruckBereich.GetText = "$H$11:$J$15;$E$41:$H$55;$A$1:$F$20" then + printlog "+ Print range selection as expected" + else + warnlog "Expected print range is <$H$11:$J$15;$E$41:$H$55;$A$1:$F$20>, but we got: " & DruckBereich.GetText + end if + + DruckbereicheBearbeiten.Cancel + printlog " Cancel print range dialog" + sleep(2) + printlog " Close document" + call hCloseDocument + +endcase + +' +'--------------------------------------------------------------------------- +' +testcase tNamedRangeToPrintRange + + dim sLocalFile as STRING + sLocalFile = convertpath ( gOfficepath & "user/work/namedRange." & sDefaultExtension ) + dim sAnotherFile as STRING + sAnotherFile = convertpath ( gOfficepath & "user/work/namedRange1." & sDefaultExtension ) + dim sLocalFileXLS as STRING + sLocalFileXLS = convertpath ( gOfficepath & "user/work/namedRange.xls" ) + dim sFormatXLS as STRING + sFormatXLS = "MS Excel 97" + dim sRangeToSelect as STRING + sRangeToSelect = "$B$3:$D$5" + dim sRangeName as STRING + sRangeName = "NamedRange" + dim sNewRangeToSelect as STRING + sNewRangeToSelect = "$C$4:$E$6" + + printlog "Use named range as print range" + + printlog " Open new document" + call hNewDocument + printlog " Select range '$B$3:$D$5'" + fCalcSelectRange ( sRangeToSelect ) + printlog " Name this range 'NamedRange'" + fCalcNameRange ( sRangeName ) + printlog " Invoke Insert::Names::Define" + InsertNamesDefine + sleep 1 + Kontext "NamenFestlegen" + printlog " Select previously defined range" + BereichsName.typekeys "N" + sleep 1 + printlog " Click 'More' button" + Zusaetze.Click + printlog " Check 'Print range'" + Druckbereich.Check + printlog " Click OK" + NamenFestlegen.OK + printlog " Invoke Format::Print Ranges::Edit" + FormatPrintRangesEdit + Kontext "DruckbereicheBearbeiten" + printlog " Select 'NamedRange' as print range" + DruckbereichListe.select ( sRangeName ) + printlog " Check if this is item no.5" + if NOT DruckbereichListe.getSelIndex = 5 then + warnlog "Unexpected selection for 'print range' listbox" + end if + printlog " Check if the according string is '$B$3:$D$5'" + if Druckbereich.getText <> sRangeToSelect then + warnlog "Unexpected string in 'print range' textbox" + end if + printlog " Click OK" + DruckbereicheBearbeiten.OK + printlog " Save file locally '.../user/work/namedRange.ods'" + if ( not hFileSaveAsWithFilterKill( sLocalFile , sDefaultCalcFilter ) ) then + warnlog "Saving test document localy failed -> Aborting" + call hCloseDocument + goto endsub + end if + printlog " Close document" + call hCloseDocument + printlog " Open document" + call hFileOpen ( sLocalFile ) + printlog " Invoke Format::Print Ranges::Edit" + FormatPrintRangesEdit + Kontext "DruckbereicheBearbeiten" + printlog " Check if item no.5 is selected as print range" + if DruckbereichListe.getSelIndex <> 5 then + warnlog "Unexpected selection for 'print range' listbox" + end if + printlog " Check if 'NamedRange' is selected as print range" + if DruckbereichListe.getSelText <> sRangeName then + warnlog "Unexpected selection for 'print range' listbox" + end if + printlog " Check if the according string is '$B$3:$D$5'" + if Druckbereich.getText <> sRangeToSelect then + warnlog "Unexpected string in 'print range' textbox" + end if + printlog " Cancel print range dialog" + DruckbereicheBearbeiten.Cancel + printlog " Save filein Excel97/2000/XP format '.../user/work/namedRange.xls'" + if NOT hFileSaveAsWithFilterKill ( sLocalFileXLS , sFormatXLS ) then + warnlog "Saving test document localy failed -> Aborting" + call hCloseDocument + goto endsub + end if + printlog " Close document" + call hCloseDocument + printlog " Open document" + call hFileOpen ( sLocalFileXLS ) + printlog " Invoke Format::Print Ranges::Edit" + FormatPrintRangesEdit + Kontext "DruckbereicheBearbeiten" + printlog " Check if item no.5 is selected as print range" + if DruckbereichListe.getSelIndex <> 5 then + warnlog "Unexpected selection for 'print range' listbox" + end if + printlog " Check if the according string is '$B$3:$D$5'" + if Druckbereich.getText <> sRangeToSelect then + warnlog "Unexpected string in 'print range' textbox" + end if + printlog " Cancel print range dialog" + DruckbereicheBearbeiten.Cancel + printlog " Invoke Insert::Names::Define" + InsertNamesDefine + sleep 1 + Kontext "NamenFestlegen" + printlog " Select entry 'NamedRange'" + BereichsName.typekeys "N" + sleep 1 + printlog " Assign new range, '$C$4:$E$6'" + ZugeordnetZu.SetText ( sNewRangeToSelect ) + printlog " Click 'More'" + Zusaetze.Click + printlog " Check 'Print range'" + Druckbereich.Check + printlog " Click OK" + NamenFestlegen.OK + printlog " Invoke Format::Print Ranges::Edit" + FormatPrintRangesEdit + Kontext "DruckbereicheBearbeiten" + printlog " Select 'NamedRange' as print range" + DruckbereichListe.select ( sRangeName ) + printlog " Check if this is item no.6" + if NOT DruckbereichListe.getSelIndex = 6 then + warnlog "Unexpected selection for 'print range' listbox" + end if + printlog " Check if the according string is '$C$4:$E$6'" + if Druckbereich.getText <> sNewRangeToSelect then + warnlog "Unexpected string in 'print range' textbox" + end if + printlog " Click OK" + DruckbereicheBearbeiten.OK + printlog " Save file locally '.../user/work/namedRange1.ods'" + if NOT hFileSaveAsWithFilterKill ( sAnotherFile , sDefaultCalcFilter ) then + warnlog "Saving test document localy failed -> Aborting" + call hCloseDocument + goto endsub + end if + printlog " Close document" + call hCloseDocument + printlog " Open document again" + call hFileOpen ( sAnotherFile ) + printlog " Invoke Format::Print Ranges::Edit" + FormatPrintRangesEdit + Kontext "DruckbereicheBearbeiten" + printlog " Check if item no.6 is selected as print range" + if DruckbereichListe.getSelIndex <> 6 then + warnlog "Unexpected selection for 'print range' listbox" + end if + printlog " Check if 'NamedRange' is selected as print range" + if DruckbereichListe.getSelText <> sRangeName then + warnlog "Unexpected selection for 'print range' listbox" + end if + printlog " Check if the according string is '$C$4:$E$6'" + if Druckbereich.getText <> sNewRangeToSelect then + warnlog "Unexpected string in 'print range' textbox" + end if + printlog " Cancel print range dialog" + DruckbereicheBearbeiten.Cancel + printlog " Close document" + call hCloseDocument + +endcase + +' +'--------------------------------------------------------------------------- +' +testcase tEntireSheet + + dim sRangeFile as STRING + sRangeFile = convertpath ( gTesttoolpath & "spreadsheet/optional/input/printrange.xls" ) + dim sLocalFile as STRING + sLocalFile = convertpath ( gOfficepath & "user/work/entireSheet." & sDefaultExtension ) + dim sLocalFileXLS as STRING + sLocalFileXLS = convertpath ( gOfficepath & "user/work/entireSheet.xls" ) + dim sFormatXLS as STRING + sFormatXLS = "MS Excel 97" + + printlog " Open test document '.../spreadsheet/optional/input/printrange.xls'" + call hFileOpen ( sRangeFile ) + printlog " Save file locally '.../user/work/entireSheet.ods'" + if NOT hFileSaveAsWithFilterKill ( sLocalFile , sDefaultCalcFilter ) then + warnlog "Saving test document localy failed -> Aborting" + call hCloseDocument + goto endsub + end if + printlog " Select second sheet" + if NOT fCalcSelectSheet ( 2 ) then + warnlog "Selecting sheet no. 2 failed -> Aborting" + call hCloseDocument + goto endsub + end if + printlog " Invoke Format::Print Ranges::Edit" + FormatPrintRangesEdit + Kontext "DruckbereicheBearbeiten" + printlog " Check if item no.2 (should be 'entire sheet') is selected in print range listbox" + if DruckbereichListe.getSelIndex = 2 then + printlog "+ OK, print range is '- entire sheet -'" + else + warnlog "Unexpected print range defined -> Check this out!" + end if + printlog " Cancel print range dialog" + DruckbereicheBearbeiten.Cancel + printlog " Close document" + call hCloseDocument + printlog " Open document" + call hFileOpen ( sLocalFile ) + printlog " Select second sheet" + if NOT fCalcSelectSheet ( 2 ) then + warnlog "Selecting sheet no. 2 failed -> Aborting" + call hCloseDocument + goto endsub + end if + printlog " Invoke Format::Print Ranges::Edit" + FormatPrintRangesEdit + Kontext "DruckbereicheBearbeiten" + printlog " Check if item no.2 (should be 'entire sheet') is selected in print range listbox" + if DruckbereichListe.getSelIndex = 2 then + printlog "+ OK, print range is '- entire sheet -'" + else + warnlog "Unexpected print range defined -> Check this out!" + end if + printlog " Cancel print range dialog" + DruckbereicheBearbeiten.Cancel + printlog " Save filein Excel97/2000/XP format '.../user/work/entireSheet.xls'" + if NOT hFileSaveAsWithFilterKill ( sLocalFileXLS , sFormatXLS ) then + warnlog "Saving test document localy failed -> Aborting" + call hCloseDocument + goto endsub + end if + printlog " Close document" + call hCloseDocument + printlog " Open document again" + call hFileOpen ( sLocalFileXLS ) + printlog " Select second sheet" + if NOT fCalcSelectSheet ( 2 ) then + warnlog "Selecting sheet no. 2 failed -> Aborting" + call hCloseDocument + goto endsub + end if + printlog " Invoke Format::Print Ranges::Edit" + FormatPrintRangesEdit + Kontext "DruckbereicheBearbeiten" + printlog " Check if item no.2 (should be 'entire sheet') is selected in print range listbox" + if DruckbereichListe.getSelIndex = 2 then + printlog "+ OK, print range is '- entire sheet -'" + else + warnlog "Unexpected print range defined -> Check this out!" + end if + printlog " Cancel print range dialog" + DruckbereicheBearbeiten.Cancel + printlog " Close document" + call hCloseDocument + +endcase + +' +'--------------------------------------------------------------------------- +' +testcase tPrintRangeMouseSelection + + dim sLocalFile as STRING + sLocalFile = convertpath ( gOfficepath & "user/work/mouseSelection." & sDefaultExtension ) + dim sSelectedRange as STRING + dim sSelectedRows as STRING + dim sSelectedColumns as STRING + + printlog " Open new document" + call hNewDocument + printlog " Invoke Format::Print Ranges::Edit" + FormatPrintRangesEdit + printlog " Check if all settings are in initial state" + Kontext "DruckbereicheBearbeiten" + if NOT DruckbereichListe.getSelIndex = 1 then + warnlog "Unexpected selection for 'print range' listbox" + end if + if NOT WiederholungszeileListe.getSelIndex = 1 then + warnlog "Unexpected selection for 'rows to repeat' listbox" + end if + if NOT WiederholungsspalteListe.getSelIndex = 1 then + warnlog "Unexpected selection for 'columns to repeat' listbox" + end if + if Druckbereich.getText <> "" then + warnlog "Unexpected string in 'print range' textbox" + end if + if Wiederholungszeile.getText <> "" then + warnlog "Unexpected string in 'rows to repeat' textbox" + end if + if Wiederholungsspalte.getText <> "" then + warnlog "Unexpected string in 'columns to repeat' textbox" + end if + sleep(1) + printlog " Click print range button to shrink dialog" + DruckbereichButton.typekeys "<RETURN>" + sleep(1) + Kontext "DocumentCalc" + printlog " Select print range using mouse" + DocumentCalc.MouseDown ( 20 , 20 ) + DocumentCalc.MouseMove ( 60 , 60 ) + DocumentCalc.MouseUp ( 60 , 60 ) + sleep(1) + Kontext "DruckbereicheBearbeiten" + printlog " Click print range button to unshrink dialog again" + DruckbereichButton.typekeys "<RETURN>" + printlog " Rember to selection for later comparisson" + sleep(1) + sSelectedRange = Druckbereich.getText + printlog " Click 'rows to repeat' button to shrink dialog" + WiederholungszeileButton.typekeys "<RETURN>" + sleep(1) + Kontext "DocumentCalc" + printlog " Select 'rows to repeat' using mouse" + DocumentCalc.MouseDown ( 10 , 10 ) + DocumentCalc.MouseMove ( 15 , 30 ) + DocumentCalc.MouseUp ( 15 , 30 ) + sleep(1) + Kontext "DruckbereicheBearbeiten" + printlog " Click 'rows to repeat' button to unshrink dialog again" + WiederholungszeileButton.typekeys "<RETURN>" + sleep(1) + printlog " Remember to selection for later comparisson" + sSelectedRows = Wiederholungszeile.getText + printlog " Click 'columns to repeat' button to shrink dialog" + WiederholungsspalteButton.typekeys "<RETURN>" + sleep(1) + Kontext "DocumentCalc" + printlog " Select 'columns to repeat' using mouse" + DocumentCalc.MouseDown ( 10 , 10 ) + DocumentCalc.MouseMove ( 50 , 15 ) + DocumentCalc.MouseUp ( 50 , 15 ) + sleep(1) + Kontext "DruckbereicheBearbeiten" + printlog " Click 'columns to repeat' button to unshrink dialog again" + WiederholungsspalteButton.typekeys "<RETURN>" + sleep(1) + printlog " Rember to selection for later comparisson" + sSelectedColumns = Wiederholungsspalte.getText + sleep(1) + printlog " Click OK" + DruckbereicheBearbeiten.OK + sleep(1) + printlog " Save file locally '.../user/work/mouseSelection.ods'" + if not hFileSaveAsWithFilterKill( sLocalFile , sDefaultCalcFilter ) then + warnlog "Saving test document localy failed -> Aborting" + call hCloseDocument + goto endsub + end if + sleep(2) + printlog " Close document" + call hCloseDocument + printlog " Open document again" + call hFileOpen ( sLocalFile ) + printlog " Invoke Format::Print Ranges::Edit" + FormatPrintRangesEdit + Kontext "DruckbereicheBearbeiten" + printlog " Check persistance of all settings" + if NOT DruckbereichListe.getSelIndex = 3 then + warnlog "Unexpected selection for 'print range' listbox: Item No. " & DruckbereichListe.getSelIndex + end if + if NOT WiederholungszeileListe.getSelIndex = 2 then + warnlog "Unexpected selection for 'rows to repeat' listbox: Item No. " & WiederholungszeileListe.getSelIndex + end if + if NOT WiederholungsspalteListe.getSelIndex = 2 then + warnlog "Unexpected selection for 'columns to repeat' listbox: Item No. " & WiederholungsspalteListe.getSelIndex + end if + if Druckbereich.getText <> sSelectedRange then + warnlog "Unexpected selection in 'print range' textbox" + qaErrorLog "Found: " & Druckbereich.getText + qaErrorLog "Should: " & sSelectedRange + end if + if Wiederholungszeile.getText <> sSelectedRows then + warnlog "Unexpected selection in 'rows to repeat' textbox" + qaErrorLog "Found: " & Wiederholungszeile.getText + qaErrorLog "Should: " & sSelectedRows + end if + if Wiederholungsspalte.getText <> sSelectedColumns then + warnlog "Unexpected selection in 'columns to repeat' textbox" + qaErrorLog "Found: " & Wiederholungsspalte.getText + qaErrorLog "Should: " & sSelectedColumns + end if + printlog " Cancel print range dialog" + DruckbereicheBearbeiten.Cancel + printlog " Close document" + call hCloseDocument + +endcase + +' +'--------------------------------------------------------------------------- +' +testcase tEmptyRangeMessagebox + + printlog "If the printrange or sheet is empty there should be a messagebox which says that there is nothing to print" + printlog " Open new document" + call hNewDocument + + printlog " Print empty document by pressing standardbar button" + kontext "Standardbar" + Drucken.click + + printlog " Check that there is a messagebox" + kontext + if Active.Exists(2) then + if Active.GetRT = 304 then + printlog "+ The messagebox " & Active.GetText & " has appeared" + Active.OK + else + warnlog "Unexpected objekt: " & Active.GetText & " found!" + try + Active.OK + catch + Active.Yes + endcatch + end if + else + warnlog "There is no messagebox (#i106423#)" + kontext "DocumentCalc" + call hCloseDocument + goto endsub + end if + + Kontext "Printing" + if Printing.Exists( 2 ) then + Printing.Cancel + end if + sleep 2 + + printlog " Enter 1 in A1" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "1 <RETURN>" + + printlog " Select cell A5" + if fGotoCell ( "A5" ) <> 0 then + warnlog "Could not select cell I2" + hCloseDocument + goto endsub + end if + + printlog " Define print range by menu FORMAT / PRINT RANGES / DEFINE" + kontext "DocumentCalc" + FormatPrintRangesDefine + + printlog " Print empty range by pressing standardbar button" + kontext "Standardbar" + Drucken.click + + printlog " Check that there is a messagebox" + kontext + if Active.Exists(2) then + if Active.GetRT = 304 then + printlog "+ The messagebox " & Active.GetText & " has appeared" + Active.OK + else + warnlog "Unexpected objekt: " & Active.GetText & " found!" + try + Active.OK + catch + Active.Yes + endcatch + end if + else + warnlog "There is no messagebox" + kontext "DocumentCalc" + call hCloseDocument + goto endsub + end if + + kontext "Printing" + if Printing.Exists( 2 ) then + Printing.Cancel + end if + printlog "Close document" + call hCloseDocument + +endcase + diff --git a/testautomation/spreadsheet/optional/includes/printscale/c_print_scale.inc b/testautomation/spreadsheet/optional/includes/printscale/c_print_scale.inc new file mode 100755 index 000000000000..301bac08a49c --- /dev/null +++ b/testautomation/spreadsheet/optional/includes/printscale/c_print_scale.inc @@ -0,0 +1,299 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : oliver.craemer@oracle.com +'* +'* short description : Check correct print scaling settings +'* +'************************************************************************************************* +'* +' #1 subPrintScaling +' #1 tPrintScaling +'* +'\************************************************************************************************* +sub subPrintScaling + printLog Chr(13) + "--------- Print scaling settings ----------" + + call tPrintScaling + +end sub +'************************************************************************************************* +testcase tPrintScaling +printlog "Check correct print scaling settings" +printlog " " + +dim iIndex as INTEGER + +dim sOutputFile as STRING + sOutputFile = gOfficePath & ConvertPath( "user\work\printScaling.ods" ) + +dim sNameSheet1 as STRING + sNameSheet1 = "Ten" +dim sNameSheet2 as STRING + sNameSheet2 = "Moves" +dim sNameSheet3 as STRING + sNameSheet3 = "Ahead" + +dim sNameStyle1 as STRING + sNameStyle1 = "1stStyle" +dim sNameStyle2 as STRING + sNameStyle2 = "2ndStyle" +dim sNameStyle3 as STRING + sNameStyle3 = "3rdStyle" + +dim sPagesToPrint as STRING + + printlog "Open test document" + Call hNewDocument + sleep(2) + + printlog "Add minimal content to all sheets" + for iIndex = 1 to 3 + Kontext "RechenleisteCalc" + if not RechenleisteCalc.isvisible then + ViewToolbarsFormulaBar + end if + sleep(1) + printlog "* Create simple data area on sheet" & iIndex + Kontext "RechenleisteCalc" + Bereich.TypeKeys "<MOD1 A>" + if iIndex = 1 then + Bereich.TypeKeys "A1:B2" + printlog "* Type 'A1:B2' in Name Box to select area" + else + Bereich.TypeKeys "A1:AF400" + printlog "* Type 'A1:AF400' in Name Box to select area" + end if + sleep(1) + printlog "* Press <RETURN>" + Bereich.TypeKeys "<RETURN>" + Kontext "DocumentCalc" + printlog "* Fill area with '13' by typing 13<SHIFT MOD1 RETURN>" + DocumentCalc.TypeKeys "=13<SHIFT MOD1 RETURN>" + sleep(1) + printlog "* Assign specific name for sheet to avoid language dependencies by Format - Sheet - Rename" + FormatSheetRename + Kontext "TabelleUmbenennen" + select case iIndex + case 1 : Tabellenname.SetText sNameSheet1 + case 2 : Tabellenname.SetText sNameSheet2 + case 3 : Tabellenname.SetText sNameSheet3 + end select + TabelleUmbenennen.OK + sleep(1) + + printlog "* Switch to next sheet by Edit - Sheet - Select" + EditSheetSelect + Kontext "SelectSheets" + if iIndex = 3 then + printlog "* At the end return to the first sheet" + SheetSelectionBox.Select sNameSheet1 + else + SheetSelectionBox.Select ( iIndex + 1 ) + end if + SelectSheets.OK + sleep(1) + next iIndex + + printlog "Invoke Style catalog" + FormatStylesCatalog + Kontext "Vorlagenkatalog" + printlog "Switch to Pagestyles" + Vorlagen.select ( 2 ) + sleep(1) + printlog "Create three styles using different page scaling features" + for iIndex = 1 to 3 + Kontext "Vorlagenkatalog" + printlog "* Click new" + Neu.Click + Kontext + printlog "* (Page format dialog should appear)" + printlog "* Select Page 'Organizer'" + active.SetPage TabVerwalten + printlog "* Close MsgBox when appeared" + if Active.Exists(2) then + if Active.GetRT = 304 then + Printlog Active.GetText + Active.Yes + end if + end if + Kontext "TabVerwalten" + printlog "* Assign name for each style" + select case iIndex + case 1 : VorlagenName.setText sNameStyle1 + case 2 : VorlagenName.setText sNameStyle2 + case 3 : VorlagenName.setText sNameStyle3 + end select + Kontext + printlog "* Select Page 'Sheet'" + active.SetPage TabTabelleCalc + Kontext "TabTabelleCalc" + printlog "* For all three styles use different page scaling features" + scalingMode.Select ( iIndex ) + select case iIndex + case 1 : SkalierungProzent.setText "444%" + printlog "* Scale size to 444%" + printlog "* NOTE: Maximum scale is 400%! Entering 444% should be decreased to 400%." + case 2 : ScalePageWidth.setText "3" + ScalePageHeight.setText "3" + printlog "* Scale output to 3 pages wide and 3 pages high" + case 3 : AnzahlMaxSeiten.setText "4" + printlog "* Scale output to a total of 4 pages" + end select + printlog "* Leave page format dialog using OK" + TabTabelleCalc.OK + next iIndex + printlog "Close style catalog using OK" + Kontext "Vorlagenkatalog" + Vorlagenkatalog.OK + sleep(2) + printlog "Assign the three styles created to the three sheets in document" + for iIndex = 1 to 3 + printlog "* Select sheet" & iIndex & " by Edit - Sheet - Select" + EditSheetSelect + Kontext "SelectSheets" + SheetSelectionBox.Select ( iIndex ) + SelectSheets.OK + sleep(1) + printlog "* Open the stylist if it is not opened" + Kontext "Gestalter" + if NOT Gestalter.exists(2) then + FormatStylist + end if + printlog "* Assign style" & iIndex & " using the stylist" + Kontext "Gestalter" + Seitenvorlagen.Click + Kontext "Vorlagenliste" + Vorlagenliste.TypeKeys "<HOME>" + sleep (2) + Vorlagenliste.Select ( iIndex ) + Vorlagenliste.TypeKeys "<RETURN>" + next iIndex + printlog "Close stylist" + Kontext "Gestalter" + if Gestalter.exists(2) then + FormatStylist + end if + + printlog "Save in current default format" + if hFileSaveAsWithFilterKill ( sOutputFile , "calc8" ) = FALSE then + warnlog "Saving " & sOutputFile & " failed! -> Exiting test!" + call hCloseDocument + else + printlog "... and close" + call hCloseDocument + sleep(2) + printlog "Reopen document" + call hFileOpen ( sOutputFile ) + sleep(2) + printlog "Invoke File - Print" + FilePrint + Kontext "Active" + Sleep 1 + printlog "Check if a MsgBox pops up due to misconfigured printer settings" + if Active.Exists(2) then + if Active.GetRT = 304 then + qaErrorlog "OOPS, are you sure that a printer is configured at all?" + try + Active.Ok + catch + Active.Yes + endcatch + end if + end if + printlog "Check if print dialog exists" + Kontext "Printing" + if Printing.Exists(2) then + Kontext "TabPrintGeneral" + PrintPages.check + printlog "Check for string '1-4' in pages textbox" + sPagesToPrint = PageRange.getText + if sPagesToPrint = "1-4" then + printlog " OK, expected number of pages for output" + else + warnlog "Unexpected number of pages for print output: " & sPagesToPrint & " -> Check this out!" + end if + Kontext "Printing" + Printing.Cancel + else + qaErrorlog "OOPS, are you sure that a printer is configured at all?" + end if + printlog "For all sheets ..." + for iIndex = 1 to 3 + printlog "* ... select currently desired one" + EditSheetSelect + Kontext "SelectSheets" + SheetSelectionBox.Select ( iIndex ) + SelectSheets.OK + sleep(1) + printlog "* Invoke Format - Page..." + FormatPageCalc + Kontext + printlog "* Select Page 'Sheet'" + active.SetPage TabTabelleCalc + printlog "* Close MsgBox when appeared" + if Active.Exists(2) then + if Active.GetRT = 304 then + Printlog Active.GetText + Active.Yes + end if + end if + Kontext "TabTabelleCalc" + if scalingMode.GetSelIndex = iIndex then + printlog "* Check if styles for print scaling have be appropriately assign" + select case iIndex + case 1 + if SkalierungProzent.GetText <> "400%" then + warnlog "Unexpected scaling factor detected -> Check this out!" + end if + printlog "* Correct scaling mode selected" + case 2 + if ScalePageWidth.GetText <> "3" then + warnlog "Unexpected page width detected -> Check this out!" + end if + if ScalePageHeight.GetText <> "3" then + warnlog "Unexpected page height detected -> Check this out!" + end if + printlog "* Correct scaling mode selected" + case 3 + if AnzahlMaxSeiten.GetText <> "4" then + warnlog "Unexpected page height detected -> Check this out!" + end if + printlog "* Correct scaling mode selected" + end select + else + warnlog "Unexpected scaling mode found -> Check this out!" + end if + printlog "* Quit dialog" + TabTabelleCalc.Cancel + next iIndex + printlog "Close document" + call hCloseDocument + + end if +endcase + diff --git a/testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_ibis.inc b/testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_ibis.inc new file mode 100644 index 000000000000..f55bd6318ffd --- /dev/null +++ b/testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_ibis.inc @@ -0,0 +1,218 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'** +'** owner : oliver.craemer@Sun.COM +'** +'** short description : Test IBIS bug fixes +'** +'************************************************************************ +' ** +' #1 tIBIS111099 ' Disable design mode of form controls after loading excel file +' #1 tIBIS111158 ' Lost properties of form controls +' #1 tIBIS111711 ' Crash when deleting chart in Menu->Window->New Window +' ** +'\*********************************************************************** + +testcase tIBIS111099 + + Dim testdoc as string + testdoc = convertpath( gTesttoolpath & "spreadsheet\optional\input\111099.xls" ) + + printlog " Open the test document" + hFileOpenLocally(testdoc) + + printlog " Select formcontrols toolbar" + Call hToolbarSelect("CONTROLS", true) + sleep(2) + Kontext "FormControls" + if SwitchControlDesignMode.IsEnabled then + if SwitchControlDesignMode.getState(2) = 0 then + printlog "OK, design mode is disabled" + else + warnlog "#i108315# Document is opened in design mode -> #111099#" + end if + else + printlog "Form controls toolbar was not enabled." + end if + call hCloseDocument + hDeleteFile( gLastWorkFile ) +endcase + +'------------------------------------------------------------------------- + +testcase tIBIS111158 + + Dim testdoc as string + Dim testString as string + testdoc = convertpath( gTesttoolpath & "spreadsheet\optional\input\111158.xls" ) + + printlog " Open the test document" + hFileOpenLocally(testdoc) + + Kontext "Standardbar" + '/// If 'Form Controls' toolbar is not visible: View / Toolbars / Form Controls + Call hToolbarSelect("CONTROLS", true) + sleep(2) + Kontext "FormControls" + try + if SwitchControlDesignMode.GetState(2) = 0 then + '/// Click on 'Design Mode on/off' button on 'Form Controls'-toolbar + SwitchControlDesignMode.click + sleep(2) + end if + catch + warnlog "Form controls toolbar was not enabled, maybe the doc is writeprotected." + Call hToolbarSelect("CONTROLS", false) + call hCloseDocument + goto endsub + endcatch + '/// Click on 'Form Design' button on 'Form Controls'-toolbar + FormDesignTools.Click + sleep(2) + Kontext "FormDesignTools" + if FormDesignTools.Exists(2) then + If ShowFmExplorer.IsEnabled then + '/// Show Form Navigator + ShowFmExplorer.Click + else + warnlog "Button was not enabled!" + end if + else + warnlog "'Form Design'-toolbar did not come up." + Call hCloseDocument + goto endsub + end if + + '/// Select the first 'ComboxBox' (9th entry from the top) + '/// Open context menu + Kontext "FormularNavigator" + Liste.TypeKeys "<HOME>" , true + sleep(1) + Liste.TypeKeys "<DOWN>" , 9 , true + sleep(1) + Liste.OpenContextmenu + sleep(2) + '/// Open 'Properties' (last entry) + hMenuSelectNr(5) + sleep(2) + Kontext "ControlPropertiesDialog" + Kontext "ControlPropertiesTabControl" + ControlPropertiesTabControl.SetPage TabGeneralControl + Kontext "TabGeneralControl" + '/// Enter in 'Help URL' as value exactly 'HID:123456' + TabGeneralControl.TypeKeys "<TAB>" , true + HelpURL.setText "customcontrol1" + HelpURL.TypeKeys "<RETURN>",true + if HelpURL.GetText <> "customcontrol1" then + warnlog "'customcontrol1' has not been accepted as 'Help URL' value." + end if + + Kontext "ControlPropertiesDialog" + hCloseDialog( ControlPropertiesDialog, "close" ) + + Kontext "FormularNavigator" + hCloseDialog( FormularNavigator, "close" ) + + Kontext "FormDesignTools" + hCloseDialog( FormDesignTools, "close" ) + + Kontext "FormControls" + '/// Switch back from the design mode + SwitchControlDesignMode.click + hCloseDialog( FormControls, "close" ) + + '/// Check for right initial string ('Please select one:')in control + Kontext "MSC_Special_Dialog" + if MSC_Special_Dialog.Exists(3) then + testString = MSC_Special_Dialog.getSelText + if testString = "Please select one:" then + printlog "OK, the right string was found in control" + else + warnlog "Wrong string found in Control: " & testString + end if + else + warnlog "The control seems to be not named in the document?! Verify! If Solaris: #i100870#" + end if + call hCloseDocument + hFileDelete( gLastWorkFile ) +endcase + +'------------------------------------------------------------------------- + +testcase tIBIS111711 + printlog "iBIS Task 111711" + + printlog " Create a new document" + call hNewDocument + printlog " Enter some numbers as content" + Kontext "DocumentCalc" + DocumentCalc.typekeys "1<RETURN>2<RETURN><UP>" + sleep(2) + + '/// create a chart from the content + '/// + NOTE: Do NOT leave the Implace mode + InsertChartCalc + '/// The Chart wizard occours + Kontext "ChartWizard" + '/// On the chart wizard press OK button + if ChartWizard.Exists(2) then + printlog "Create chart" + ChartWizard.OK + sleep(2) + else + warnlog "Chart wizard did not occour! Exiting test case." + call hCloseDocument + goto endsub + end if + '/// Call slot Window->New Window + Kontext "DocumentCalc" + DocumentCalc.typekeys "<ESCAPE>" + WindowNewWindow + sleep(2) + call gMouseClick(95,95) + + '/// Select chart in new window + Kontext "DocumentCalc" + call fselectFirstOLE + sleep(2) + + '/// Delete chart in new window ... + '/// ... and check for crash + Kontext "DocumentCalc" + try + DocumentCalc.typekeys "<DELETE>" + sleep (2) + printlog "OK, there are still " & GetDocumentCount & " documents open" + catch + warnlog "Probably the office did crash -> #111711#" + call hCloseDocument + goto endsub + endcatch + call hCloseDocument +endcase + + diff --git a/testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_iz.inc b/testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_iz.inc new file mode 100644 index 000000000000..873ca1bddabc --- /dev/null +++ b/testautomation/spreadsheet/optional/includes/so7pp1/c_so7_pp1_iz.inc @@ -0,0 +1,211 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'** +'** owner : joerg.sievers@Sun.COM +'** +'** short description : Test Issuezilla bug fixes +'** +'************************************************************************ +' ** +' #1 tIZ19381 ' I/O error when OLE object is thrown out of undo/redo buffer +' #1 tIZ21036 ' Crash after shifting cells with paste special +' ** +'\*********************************************************************** + +testcase tIZ19381 + Dim sOutputFile as string + Dim i as integer + + sOutputFile = convertpath(gOfficepath & "user/work/i19381.ods") + printlog "IssueZilla Task 19381" + + '/// File / New / Spreadsheet + call hNewDocument + sleep(2) + '/// Enter 1 [RETURN] + '/// Enter 2 [RETURN] + '/// Enter [UP] + Kontext "DocumentCalc" + DocumentCalc.typekeys "1<RETURN>2<RETURN><UP>" + sleep(2) + '/// Insert / Chart + InsertChartCalc + Kontext "ChartWizard" + '/// On the chart wizard press OK button + if ChartWizard.Exists(2) then + printlog "Create chart" + ChartWizard.OK + sleep(2) + else + warnlog "Chart wizard did not occour! Exiting test case." + call hCloseDocument + goto endsub + end if + Kontext "DocumentCalc" + '/// Type [ESCAPE] + DocumentCalc.typekeys "<Escape>" + sleep(2) + '/// File Save As <i>gOfficepath</i>user/work/i19381.ods + if NOT hFileSaveAsWithFilterKill (sOutputFile, "calc8") then + warnlog "Saving test document localy failed -> Aborting" + call hCloseDocument + goto endsub + end if + sleep(2) + '/// File / Close + call hCloseDocument + sleep(2) + '/// Open the saved document + if hFileOpen(sOutputFile) then + Kontext "DocumentCalc" + '/// Click into the chart + call gMouseClick(95,95) + Kontext "DocumentCalc" + '/// Press [F5] to open the Navigator + '/// Select the first Chart/OLE object in the navigator + call fselectFirstOLE + '/// Edit / Cut + sleep(2) + EditCut + sleep(2) + Kontext "DocumentCalc" + '/// Type [ESCAPE] twice + DocumentCalc.TypeKeys "<ESCAPE>" , 2 + '/// Edit / Paste + EditPaste + sleep(2) + Kontext "DocumentCalc" + '/// press [CTRL+S] to save the document again + DocumentCalc.typekeys "<MOD1 S>" + sleep(2) + Kontext + if Active.exists(2) then + if gPlatGroup = "w95" then + warnlog "REGRESSION! #i41751# - Saving after Cut&Paste of OLE fails on windows!" + else + warnlog "OOPS, found unexpected MsgBox -> Check this out!" + end if + Active.OK + call hCloseDocument + goto endsub + end if + Kontext "DocumentCalc" + '/// Type [ESCAPE] + DocumentCalc.TypeKeys "<ESCAPE>" + '/// Go to cell E42 + call fCalcSelectRange("E42") + for i = 1 to 21 + Kontext "DocumentCalc" + '/// Enter 1 and [RETURN] 21 times + '///+ as changes to get chart cut/paste out of the undo buffer + DocumentCalc.typekeys "1<Return>" + next i + Kontext "DocumentCalc" + '/// Type [CTRL + S] to save the document again + DocumentCalc.typekeys "<MOD1 S>" + '/// check for error message + Kontext + if Active.Exists(2) then + if Active.GetRT = 304 then + printlog Active.GetText + warnlog "REGRESSION! Issue 19381 seems to occur again!" + Active.OK + end if + else + printlog "No message box is in the way!" + end if + '/// File / Close + call hCloseDocument + else + warnlog "It was not possible to open the saved document again!" + end if +endcase + +'------------------------------------------------------------------------- + +testcase tIZ21036 + + printlog "IssueZilla Task 21036" + + '/// open new document + call hNewDocument + sleep(2) + + '/// select a whole row (e.g. A1:IV1) + Kontext "DocumentCalc" + DocumentCalc.typekeys "<SHIFT MOD1 RIGHT>" + sleep(2) + + '/// cut selection + try + EditCut + catch + QAErrorLog "Is this a crash?? Please check it out!" + goto endsub + endcatch + sleep(2) + + '/// go to A2 + Kontext "DocumentCalc" + call fCalcSelectRange("A2") + sleep(2) + Kontext "DocumentCalc" + '/// call edit->paste special + EditPasteSpecialCalc + sleep(2) + + '/// check shift cells->right + Kontext "InhalteEinfuegenCalc" + NachRechts.Check + + '/// OK + InhalteEinfuegenCalc.OK + + '/// confirm MsgBox + Kontext "Active" + if Active.Exists(2) then + if Active.GetRT = 304 then + printlog Active.GetText + Active.OK + sleep(2) + end if + else + warnlog "No message box came up!" + goto endsub + end if + + '/// check for crash + try + printlog "OK, there are still " & GetDocumentCount & " documents open" + catch + warnlog "Probably the office did crash -> #I21036#" + goto endsub + endcatch + + call hCloseDocument +endcase + diff --git a/testautomation/spreadsheet/optional/includes/solver/c_solver.inc b/testautomation/spreadsheet/optional/includes/solver/c_solver.inc new file mode 100644 index 000000000000..74db821e9275 --- /dev/null +++ b/testautomation/spreadsheet/optional/includes/solver/c_solver.inc @@ -0,0 +1,221 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/*********************************************************************** +'* +'* owner : oliver.craemer@oracle.com +'* +'* short description : Functionality Test - Solver +'* +'************************************************************************ +'* +' #1 tExampleCalculation +' #1 tExampleCalculation2 +'* +'\*********************************************************************** + +testcase tExampleCalculation + + dim sdecimalseperator as string + + sDecimalseperator = GetDecimalSeperator + + printlog " Open testdocument 'gTesttoolPath + spreadsheet\optional\input\Solver_testdoc01.ods'" + hFileOpenLocally( gTesttoolPath & "spreadsheet\optional\input\Solver_testdoc01.ods" ) + printlog " Tools - Solver" + ToolsSolver + Kontext "Solver" + printlog " Set target cell to $E$15" + TargetCell.SetText "$E$15" + printlog " Set Optimize result to Minimum" + OptimizeMinimum.Check + printlog " Set 'By changing cells' to $G$13:$G$14" + ChangingCells.SetText "$G$13:$G$14" + printlog " Set the first cell reference under 'Limiting conditions' to $C$15, the first Operator to '<=' and the first Value to 4" + CellReference1.SetText "$C$15" + Operator1.Select 1 + Value1.SetText "4" + printlog " Set the second cell reference under 'Limiting conditions' to $D$15, the second Operator to '>=' and the second Value to 10" + CellReference2.SetText "$D$15" + Operator2.Select 3 + Value2.SetText "10" + printlog " Set the third cell reference under 'Limiting conditions' to $G$15, the third Operator to '=' and the third Value to 300." + CellReference3.SetText "$G$15" + Operator3.Select 2 + Value3.SetText "300" + printlog " Click on Solve" + Solve.Click + printlog " A new dialog opens informing you that a result was found." + Kontext "SolvingResult" + if not SolvingResult.exists then + warnlog "Normally there should be a Success dialog, but there is none" + Kontext "NoSolution" + if NoSolution.exists then + NoSolution.OK + Kontext "Solver" + Solver.Cancel + Call hCloseDocument + goto endsub + else + Kontext "Solver" + Solver.Cancel + Call hCloseDocument + goto endsub + end if + end if + printlog " Click on the 'Restore Previous' Button. The Solver dialog is shown again." + SolvingResult.Cancel + Kontext "Solver" + printlog " Press ALT+S . The Solved dialog opens again. Press the Enter key." + Solve.Click + Kontext "SolvingResult" + SolvingResult.OK + Kontext "DocumentCalc" + printlog " C15 must show 4.0000 mg, D15 must show 18.0000 mg, E15 must show 22.0000 ct, G13 is set to 120, G14 shows 180 and therefore G15 300." + call fCalcCompareCellValue ("C15","4" & sDecimalseperator & "0000 mg") + call fCalcCompareCellValue ("D15","18" & sDecimalseperator & "0000 mg") + call fCalcCompareCellValue ("E15","22" & sDecimalseperator & "0000 ct") + call fCalcCompareCellValue ("G13","120") + call fCalcCompareCellValue ("G14","180") + call fCalcCompareCellValue ("G15","300") + printlog " Tools - Solver" + ToolsSolver + Kontext "Solver" + printlog " Change limitatation value 3 from 300 to 500" + Value3.SetText "500" + printlog " Press ALT+S to solve the problem and keep the results." + Solve.Click + Kontext "SolvingResult" + SolvingResult.OK + Kontext "DocumentCalc" + printlog " The results should be :C15 must show 4.0000 mg, D15 must show 51.3333 mg, E15 must show 68.6667 ct, G13 is set to 520, G14 shows -20 and therefore G15 500" + call fCalcCompareCellValue ("C15","4" & sDecimalseperator & "0000 mg") + call fCalcCompareCellValue ("D15","51" & sDecimalseperator & "3333 mg") + call fCalcCompareCellValue ("E15","68" & sDecimalseperator & "6667 ct") + call fCalcCompareCellValue ("G13","520") + call fCalcCompareCellValue ("G14","-20") + call fCalcCompareCellValue ("G15","500") + printlog " So the solution found is correct but not usefull. Let's limit the lemonade to positive values by adding a new limitation." + printlog " Tools - Solver" + ToolsSolver + kontext "Solver" + printlog " Set the fourth cell reference under 'Limiting conditions' to $G$14, the fourth Operator to '>=' and the fourth Value to 0." + CellReference4.SetText "$G$14" + Operator4.Select 3 + Value4.SetText "0" + printlog " Click on Solve." + Solve.Click + printlog " The No Solution dialog opens, telling you that the model is not solvable with the given limiting conditions." + Kontext "NoSolution" + if not NoSolution.exists then + warnlog "Normally the NoSolution dialog appears, but there is none" + end if + printlog " Click on Ok at this dialog, the Solver dialog should be shown." + NoSolution.OK + Kontext "Solver" + Solver.Close + printlog " Close document" + Call hCloseDocument + +endcase + +'----------------------------------------------------------- + +testcase tExampleCalculation2 + + printlog " Open testdocument 'gTesttoolPath + spreadsheet\optional\input\stest_large.ods'" + hFileOpenLocally( gTesttoolPath & "spreadsheet\optional\input\stest_large.ods" ) + printlog " Tools - Solver" + ToolsSolver + Kontext "Solver" + printlog " Target Cell: $Y$2" + TargetCell.SetText "$Y$2" + printlog " Optimize to: Maximum" + OptimizeMaximum.Check + printlog " Changing cells: $B$5:$B$134" + ChangingCells.SetText "$B$5:$B$134" + printlog " Limiting Conditions: Cell reference: $D$2:$W$2 Operator : <= Value: $D$3:$W$3" + CellReference1.SetText "$D$2:$W$2" + Operator1.Select 1 + Value1.SetText "$D$3:$W$3" + printlog " Copy the following String to the second cell reference input line: $D$2:$W$2 <= $D$3:$W$3" + CellReference2.SetText "$D$2:$W$2" + Operator1.Select 2 + Value2.SetText "$D$3:$W$3" + printlog " Click on Solve" + Solve.Click + printlog " You get a new Warning dialog talking about Invalid condition." + Kontext "NoSolution" + if not NoSolution.exists then + warnlog "Normally there should be a No Solution dialog" + end if + NoSolution.OK + Kontext "Solver" + printlog " Click on the remove Button next to the second Value field to remove the faulty condition." + Remove2.Click + if Value2 = "$D$3:$W$3" then + warnlog "The condition was not removed" + end if + printlog " Click on Options button, the Options dialog opens" + Options.Click + Kontext "SolverOptions" + if not SolverOptions.exists then + warnlog "The Options dialog is not open" + end if + printlog " Tag 'Assume variables as integer'" + SolverSettings.Select (1) + SolverSettings.TypeKeys "<SPACE>" + printlog " Tag 'Assume variables not negative'" + SolverSettings.Select (2) + SolverSettings.TypeKeys "<SPACE>" + printlog " Select SolvingTime" + SolverSettings.Select (5) + printlog " Click on Edit button to open the Editdialog" + SolverSettingsEdit.Click + Kontext "SolverEditSetting" + printlog " Set time to 10 and close editdialog by OK" + SolverNumeric.SetText "10" + SolverEditSetting.OK + Kontext "SolverOptions" + printlog " Click OK on SolverOptionsdialog" + SolverOptions.OK + Kontext "Solver" + printlog " Click on Solve" + Solve.Click + printlog " A new dialog named Solving... opens telling you about the time limit" + sleep (15) + printlog " After that a new dialog pops up saying 'No Solution was found. The time limit was reached.'" + Kontext "NoSolution" + printlog " Click the Ok button to close the No Solution dialog." + NoSolution.OK + printlog " Click close to leave the Solver dialog." + Kontext "Solver" + Solver.Close + printlog " Close document" + Call hCloseDocument + +endcase + + diff --git a/testautomation/spreadsheet/optional/includes/validity/c_validity.inc b/testautomation/spreadsheet/optional/includes/validity/c_validity.inc new file mode 100644 index 000000000000..f1f33573f66e --- /dev/null +++ b/testautomation/spreadsheet/optional/includes/validity/c_validity.inc @@ -0,0 +1,372 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'** +'** owner : oliver.craemer@Sun.COM +'** +'** 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 <i>gTesttoolPath</i>spreadsheet/optional/input/validity.ods" + call hFileOpen (sInputFile) + printlog " Save the document under <i>gOfficePath</i>user/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" + '///+<UL> + '///+<LI>Goto first cell and insert the <i>correct value</i></LI> + '///+<LI>Press RETURN</LI> + '///+<LI><UL><LI>No warning or information message should appear</LI></UL></LI> + '///+<LI>Enter the <i>incorrect value</I> + '///+<LI>Press RETURN</LI> + '///+<LI><UL><LI>A warning or information message should appear</LI></UL></LI> + '///+<LI><TABLE BORDER=1> + '///+ <TR><TH>Cell address</TH><TH>correct value</TH><TH>incorrect value</TH></TR> + '///+ <TR><TD>B4</TD><TD>3</TD><TD>8</TD></TR> + call check_message(sMType, "B4", "3", "8") + '///+ <TR><TD>B5</TD><TD>9</TD><TD>10</TD></TR> + call check_message(sMType, "B5", "9", "10") + '///+ <TR><TD>B6</TD><TD>28</TD><TD>25</TD></TR> + call check_message(sMType, "B6", "28", "25") + '///+ <TR><TD>B7</TD><TD>10</TD><TD>12</TD></TR> + call check_message(sMType, "B7", "10", "12") + '///+ <TR><TD>B8</TD><TD>11</TD><TD>9</TD></TR> + call check_message(sMType, "B8", "11", "9") + '///+ <TR><TD>B9</TD><TD>5</TD><TD>3</TD></TR> + call check_message(sMType, "B9", "5", "3") + '///+ <TR><TD>B10</TD><TD>1</TD><TD>6</TD></TR> + call check_message(sMType, "B10", "1", "6") + '///+ <TR><TD>B11</TD><TD>1</TD><TD>6</TD></TR> + call check_message(sMType, "B11", "1", "6") + '///+ <TR><TD>B17</TD><TD>3,14</TD><TD>3,15</TD></TR> + call check_message(sMType, "B17", "3,14", "3,15") + '///+ <TR><TD>B18</TD><TD>10,14</TD><TD>10,16</TD></TR> + call check_message(sMType, "B18", "10,14", "10,16") + '///+ <TR><TD>B19</TD><TD>25,10</TD><TD>25,09</TD></TR> + call check_message(sMType, "B19", "25,10", "25,09") + '///+ <TR><TD>B20</TD><TD>10,5</TD><TD>10,7</TD></TR> + call check_message(sMType, "B20", "10,5", "10,7") + '///+ <TR><TD>B21</TD><TD>11,9</TD><TD>10</TD></TR> + call check_message(sMType, "B21", "11,9", "10") + '///+ <TR><TD>B22</TD><TD>3,145</TD><TD>3,14</TD></TR> + call check_message(sMType, "B22", "3,145", "3,14") + '///+ <TR><TD>B23</TD><TD>1,45</TD><TD>1,38</TD></TR> + call check_message(sMType, "B23", "1,45", "1,38") + '///+ <TR><TD>B24</TD><TD>2,03</TD><TD>2,15</TD></TR> + call check_message(sMType, "B24", "2,03", "2,15") + '///+ <TR><TD>E4</TD><TD>13.12.99</TD><TD>13.11.99</TD></TR> + call check_message(sMType, "E4", "13.12.99", "13.11.99") + '///+ <TR><TD>E5</TD><TD>12.12.99</TD><TD>13.12.99</TD></TR> + call check_message(sMType, "E5", "12.12.99", "13.12.99") + '///+ <TR><TD>E6</TD><TD>14.12.99</TD><TD>13.12.99</TD></TR> + call check_message(sMType, "E6", "14.12.99", "13.12.99") + '///+ <TR><TD>E7</TD><TD>13.12.99</TD><TD>14.12.99</TD></TR> + call check_message(sMType, "E7", "13.12.99", "14.12.99") + '///+ <TR><TD>E8</TD><TD>13.12.99</TD><TD>12.12.99</TD></TR> + call check_message(sMType, "E8", "13.12.99", "12.12.99") + '///+ <TR><TD>E9</TD><TD>13.11.99</TD><TD>13.12.99</TD></TR> + call check_message(sMType, "E9", "13.11.99", "13.12.99") + '///+ <TR><TD>E10</TD><TD>23.12.99</TD><TD>12.12.99</TD></TR> + call check_message(sMType, "E10", "23.12.99", "12.12.99") + '///+ <TR><TD>E11</TD><TD>24.12.99</TD><TD>23.12.99</TD></TR> + call check_message(sMType, "E11", "24.12.99", "23.12.99") + '///+ <TR><TD>E17</TD><TD>13:15</TD><TD>13:16</TD></TR> + call check_message(sMType, "E17", "13:15", "13:16") + '///+ <TR><TD>E18</TD><TD>10:15</TD><TD>14:16</TD></TR> + call check_message(sMType, "E18", "10:15", "14:16") + '///+ <TR><TD>E19</TD><TD>23:10</TD><TD>12:09</TD></TR> + call check_message(sMType, "E19", "23:10", "12:09") + '///+ <TR><TD>E20</TD><TD>13:15</TD><TD>13:16</TD></TR> + call check_message(sMType, "E20", "13:15", "13:16") + '///+ <TR><TD>E21</TD><TD>13:15</TD><TD>13:14</TD></TR> + call check_message(sMType, "E21", "13:15", "13:14") + '///+ <TR><TD>E22</TD><TD>13:16</TD><TD>13:15</TD></TR> + call check_message(sMType, "E22", "13:16", "13:15") + '///+ <TR><TD>E23</TD><TD>13:15</TD><TD>23:13</TD></TR> + call check_message(sMType, "E23", "13:15", "23:13") + '///+ <TR><TD>E24</TD><TD>12:59</TD><TD>13:00</TD></TR> + call check_message(sMType, "E24", "12:59", "13:00") + '///+ <TR><TD>H4</TD><TD>abc</TD><TD>abcd</TD></TR> + call check_message(sMType, "H4", "abc", "abcd") + '///+ <TR><TD>H5</TD><TD>abcdefgrd</TD><TD>aderfgtzjm</TD></TR> + call check_message(sMType, "H5", "abcdefgrd", "aderfgtzjm") + '///+ <TR><TD>H6</TD><TD>rftgzhujikolmnbvcxyaswqepk</TD><TD>ftgzhnujikm,lopredswqayx</TD></TR> + call check_message(sMType, "H6", "rftgzhujikolmnbvcxyaswqepk", "ftgzhnujikm,lopredswqayx") + '///+ <TR><TD>H7</TD><TD>asweqrfvbg</TD><TD>edcvfrtgbnh</TD></TR> + call check_message(sMType, "H7", "asweqrfvbg", "edcvfrtgbnh") + '///+ <TR><TD>H8</TD><TD>edcswxyaqtgb</TD><TD>ujnmkipztr</TD></TR> + call check_message(sMType, "H8", "edcswxyaqtgb", "ujnmkipztr") + '///+ <TR><TD>H9</TD><TD>sdxc</TD><TD>tgb</TD></TR> + call check_message(sMType, "H9", "sdxc", "tgb") + '///+ <TR><TD>H10</TD><TD>rfvbj</TD><TD>dfcvgb</TD></TR> + call check_message(sMType, "H10", "rfvbj", "dfcvgb") + '///+ <TR><TD>H11</TD><TD>g</TD><TD>we</TD></TR> + call check_message(sMType, "H11", "g", "we") + '///+ <TR><TH>New featurs OpenOffice 2.0</TH></TR> + '///+ <TR><TD>B30</TD><TD>February</TD><TD>January</TD></TR> + call check_message(sMType, "B30", "February", "January") + '///+ <TR><TD>B31</TD><TD>May</TD><TD>February</TD></TR> + call check_message(sMType, "B31", "May", "February") + '///+ <TR><TD>B32</TD><TD>June</TD><TD>January</TD></TR> + call check_message(sMType, "B32", "June", "January") + '///+ <TR><TD>B33</TD><TD>August</TD><TD>November</TD></TR> + call check_message(sMType, "B33", "August", "November") + '///+ <TR><TD>B34</TD><TD>September</TD><TD>December</TD></TR> + call check_message(sMType, "B34", "September", "December") + '///+ <TR><TD>B35</TD><TD>October</TD><TD>March</TD></TR> + call check_message(sMType, "B35", "October", "March") + '///+ <TR><TD>B36</TD><TD>July</TD><TD>August</TD></TR> + call check_message(sMType, "B36", "July", "August") + '///+ <TR><TD>B37</TD><TD>April</TD><TD>October</TD></TR> + call check_message(sMType, "B37", "April", "October") + '///+ <TR><TD>B38</TD><TD>Name03</TD><TD>Name07</TD></TR> + call check_message(sMType, "B38", "Name03", "Name07") + '///+ <TR><TD>E30</TD><TD>alpha</TD><TD>omega</TD></TR> + call check_message(sMType, "E30", "alpha", "omega") + '///+ <TR><TD>E31</TD><TD>beta</TD><TD>zeta</TD></TR> + call check_message(sMType, "E31", "beta", "zeta") + '///+ <TR><TD>E32</TD><TD>gamma</TD><TD>psi</TD></TR> + call check_message(sMType, "E32", "gamma", "psi") + '///+ <TR><TD>E33</TD><TD>delta</TD><TD>pi/2</TD></TR> + call check_message(sMType, "E33", "delta", "pi/2") + '///+ </TABLE></LI></UL> + 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 <i>gTesttoolPath</i>/calc/special/input/validity.ods + printlog "Open <i>gTesttoolPath</i>/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 <i>gOfficePath</i>user/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" + '///+<UL> + '///+<LI>Goto first cell and insert the <i>correct value</i></LI> + '///+<LI>Press RETURN</LI> + '///+<LI><UL><LI>No warning or information message should appear</LI></UL></LI> + '///+<LI>Enter the <i>incorrect value</I> + '///+<LI>Press RETURN</LI> + '///+<LI><UL><LI>A warning or information message should appear</LI></UL></LI> + '///+<LI><TABLE BORDER=1> + '///+ <TR><TH>Cell address</TH><TH>correct value</TH><TH>incorrect value</TH></TR> + '///+ <TR><TD>B4</TD><TD>3</TD><TD>8</TD></TR> + call check_message(sMType, "B4", "3", "8") + '///+ <TR><TD>B5</TD><TD>9</TD><TD>10</TD></TR> + call check_message(sMType, "B5", "9", "10") + '///+ <TR><TD>B6</TD><TD>28</TD><TD>25</TD></TR> + call check_message(sMType, "B6", "28", "25") + '///+ <TR><TD>B7</TD><TD>10</TD><TD>12</TD></TR> + call check_message(sMType, "B7", "10", "12") + '///+ <TR><TD>B8</TD><TD>11</TD><TD>9</TD></TR> + call check_message(sMType, "B8", "11", "9") + '///+ <TR><TD>B9</TD><TD>5</TD><TD>3</TD></TR> + call check_message(sMType, "B9", "5", "3") + '///+ <TR><TD>B10</TD><TD>1</TD><TD>6</TD></TR> + call check_message(sMType, "B10", "1", "6") + '///+ <TR><TD>B11</TD><TD>1</TD><TD>6</TD></TR> + call check_message(sMType, "B11", "1", "6") + '///+ <TR><TD>B17</TD><TD>3,14</TD><TD>3,15</TD></TR> + call check_message(sMType, "B17", "3" & sdecimalseperator & "14", "3" & sdecimalseperator & "15") + '///+ <TR><TD>B18</TD><TD>10,14</TD><TD>10,16</TD></TR> + call check_message(sMType, "B18", "10" & sdecimalseperator & "14", "10" & sdecimalseperator & "16") + '///+ <TR><TD>B19</TD><TD>25,10</TD><TD>25,09</TD></TR> + call check_message(sMType, "B19", "25" & sdecimalseperator & "10", "25" & sdecimalseperator & "09") + '///+ <TR><TD>B20</TD><TD>10,5</TD><TD>10,7</TD></TR> + call check_message(sMType, "B20", "10" & sdecimalseperator & "5", "10" & sdecimalseperator & "7") + '///+ <TR><TD>B21</TD><TD>11,9</TD><TD>10</TD></TR> + call check_message(sMType, "B21", "11" & sdecimalseperator & "9", "10") + '///+ <TR><TD>B22</TD><TD>3,145</TD><TD>3,14</TD></TR> + call check_message(sMType, "B22", "3" & sdecimalseperator & "145", "3" & sdecimalseperator & "14") + '///+ <TR><TD>B23</TD><TD>1,45</TD><TD>1,38</TD></TR> + call check_message(sMType, "B23", "1" & sdecimalseperator & "45", "1" & sdecimalseperator & "38") + '///+ <TR><TD>B24</TD><TD>2,03</TD><TD>2,15</TD></TR> + call check_message(sMType, "B24", "2" & sdecimalseperator & "03", "2" & sdecimalseperator & "15") + '///+ <TR><TD>E4</TD><TD>13.12.99</TD><TD>13.11.99</TD></TR> + call check_message(sMType, "E4", "13.12.99", "13.11.99") + '///+ <TR><TD>E5</TD><TD>12.12.99</TD><TD>13.12.99</TD></TR> + call check_message(sMType, "E5", "12.12.99", "13.12.99") + '///+ <TR><TD>E6</TD><TD>14.12.99</TD><TD>13.12.99</TD></TR> + call check_message(sMType, "E6", "14.12.99", "13.12.99") + '///+ <TR><TD>E7</TD><TD>13.12.99</TD><TD>14.12.99</TD></TR> + call check_message(sMType, "E7", "13.12.99", "14.12.99") + '///+ <TR><TD>E8</TD><TD>13.12.99</TD><TD>12.12.99</TD></TR> + call check_message(sMType, "E8", "13.12.99", "12.12.99") + '///+ <TR><TD>E9</TD><TD>13.11.99</TD><TD>13.12.99</TD></TR> + call check_message(sMType, "E9", "13.11.99", "13.12.99") + '///+ <TR><TD>E10</TD><TD>23.12.99</TD><TD>12.12.99</TD></TR> + call check_message(sMType, "E10", "23.12.99", "12.12.99") + '///+ <TR><TD>E11</TD><TD>24.12.99</TD><TD>23.12.99</TD></TR> + call check_message(sMType, "E11", "24.12.99", "23.12.99") + '///+ <TR><TD>E17</TD><TD>13:15</TD><TD>13:16</TD></TR> + call check_message(sMType, "E17", "13:15", "13:16") + '///+ <TR><TD>E18</TD><TD>10:15</TD><TD>14:16</TD></TR> + call check_message(sMType, "E18", "10:15", "14:16") + '///+ <TR><TD>E19</TD><TD>23:10</TD><TD>12:09</TD></TR> + call check_message(sMType, "E19", "23:10", "12:09") + '///+ <TR><TD>E20</TD><TD>13:15</TD><TD>13:16</TD></TR> + call check_message(sMType, "E20", "13:15", "13:16") + '///+ <TR><TD>E21</TD><TD>13:15</TD><TD>13:15</TD></TR> + call check_message(sMType, "E21", "13:15", "13:14") + '///+ <TR><TD>E22</TD><TD>13:16</TD><TD>13:15</TD></TR> + call check_message(sMType, "E22", "13:16", "13:15") + '///+ <TR><TD>E23</TD><TD>13:15</TD><TD>23:13</TD></TR> + call check_message(sMType, "E23", "13:15", "23:13") + '///+ <TR><TD>E24</TD><TD>12:59</TD><TD>13:00</TD></TR> + call check_message(sMType, "E24", "12:59", "13:00") + '///+ <TR><TD>H4</TD><TD>abc</TD><TD>abcd</TD></TR> + call check_message(sMType, "H4", "abc", "abcd") + '///+ <TR><TD>H5</TD><TD>abcdefgrd</TD><TD>aderfgtzjm</TD></TR> + call check_message(sMType, "H5", "abcdefgrd", "aderfgtzjm") + '///+ <TR><TD>H6</TD><TD>rftgzhujikolmnbvcxyaswqepk</TD><TD>ftgzhnujikm,lopredswqayx</TD></TR> + call check_message(sMType, "H6", "rftgzhujikolmnbvcxyaswqepk", "ftgzhnujikm,lopredswqayx") + '///+ <TR><TD>H7</TD><TD>asweqrfvbg</TD><TD>edcvfrtgbnh</TD></TR> + call check_message(sMType, "H7", "asweqrfvbg", "edcvfrtgbnh") + '///+ <TR><TD>H8</TD><TD>edcswxyaqtgb</TD><TD>ujnmkipztr</TD></TR> + call check_message(sMType, "H8", "edcswxyaqtgb", "ujnmkipztr") + '///+ <TR><TD>H9</TD><TD>sdxc</TD><TD>tgb</TD></TR> + call check_message(sMType, "H9", "sdxc", "tgb") + '///+ <TR><TD>H10</TD><TD>rfvbj</TD><TD>dfcvgb</TD></TR> + call check_message(sMType, "H10", "rfvbj", "dfcvgb") + '///+ <TR><TD>H11</TD><TD>g</TD><TD>we</TD></TR> + call check_message(sMType, "H11", "g", "we") + '///+ <TR><TH>New featurs OpenOffice 2.0</TH></TR>we</TD></TR> + '///+ <TR><TD>B30</TD><TD>February</TD><TD>January</TD></TR> + call check_message(sMType, "B30", "February", "January") + '///+ <TR><TD>B31</TD><TD>May</TD><TD>February</TD></TR> + call check_message(sMType, "B31", "May", "February") + '///+ <TR><TD>B32</TD><TD>June</TD><TD>January</TD></TR> + call check_message(sMType, "B32", "June", "January") + '///+ <TR><TD>B33</TD><TD>August</TD><TD>November</TD></TR> + call check_message(sMType, "B33", "August", "November") + '///+ <TR><TD>B34</TD><TD>September</TD><TD>December</TD></TR> + call check_message(sMType, "B34", "September", "December") + '///+ <TR><TD>B35</TD><TD>October</TD><TD>March</TD></TR> + call check_message(sMType, "B35", "October", "March") + '///+ <TR><TD>B36</TD><TD>July</TD><TD>August</TD></TR> + call check_message(sMType, "B36", "July", "August") + '///+ <TR><TD>B37</TD><TD>April</TD><TD>October</TD></TR> + call check_message(sMType, "B37", "April", "October") + '///+ <TR><TD>B38</TD><TD>Name03</TD><TD>Name07</TD></TR> + call check_message(sMType, "B38", "Name03", "Name07") + '///+ <TR><TD>E30</TD><TD>alpha</TD><TD>omega</TD></TR> + call check_message(sMType, "E30", "alpha", "omega") + '///+ <TR><TD>E31</TD><TD>beta</TD><TD>zeta</TD></TR> + call check_message(sMType, "E31", "beta", "zeta") + '///+ <TR><TD>E32</TD><TD>gamma</TD><TD>psi</TD></TR> + call check_message(sMType, "E32", "gamma", "psi") + '///+ <TR><TD>E33</TD><TD>delta</TD><TD>pi/2</TD></TR> + call check_message(sMType, "E33", "delta", "pi/2") + '///+ </TABLE></LI></UL> + next iCount + '/// File / Close + call hCloseDocument +endcase + |