diff options
Diffstat (limited to 'testautomation/chart2/optional/includes')
8 files changed, 3863 insertions, 0 deletions
diff --git a/testautomation/chart2/optional/includes/ch2_datadialogue.inc b/testautomation/chart2/optional/includes/ch2_datadialogue.inc new file mode 100644 index 000000000000..1b723c1479b7 --- /dev/null +++ b/testautomation/chart2/optional/includes/ch2_datadialogue.inc @@ -0,0 +1,328 @@ +'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 : Resource-test for the Chart Data Dialogue. +'* +'******************************************************************* +'* +' #1 tChartDataDialogueButtons +' #1 tChartDataDialogueFieldsUndo +'* +'\******************************************************************* + +testcase tChartDataDialogueButtons + '/// Create new impress document + printlog "Create new impress document" + call hNewDocument + Kontext "DocumentImpress" + '/// Insert a new Chart-object, via the Menu: 'Insert - Chart'. + Printlog " Insert a new Chart-object, via the Menu: 'Insert - Chart'." + InsertChart + WaitSlot() + Kontext "DocumentChart" + '/// Open context menu + printlog "Open context menu" + DocumentChart.OpenContextMenu + '/// Select the third entry + printlog "Select the third entry" + hMenuSelectNr (6) + sleep (1) + Kontext "Diagramdata" + call DialogTest ( Diagramdata ) + '/// Check if the diagram data dialogue came up + printlog "Check if the diagram data dialogue came up" + if Diagramdata.Exists then + printlog " Diagramdata came up just as expected." + else + warnlog " Diagramdata didnt come up as expected." + call hCloseDocument + goto endsub + end if + '/// Check if the 'Insert Row'-button is enabled. + printlog "Check if the 'Insert Row'-button is enabled." + if InsertRow.isEnabled then + printlog " InsertRow was correctly enabled." + else + warnlog " InsertRow wasnt enabled, but should have been." + end if + '/// Check if the 'Swap Columns'-button is disabled. + printlog "Check if the 'Swap Columns'-button is disabled." + if SwapColumns.isEnabled then + warnlog " SwapColumns was enabled, but should have been disabled." + else + printlog " SwapColumns was correctly disabled." + end if + '/// Check if the 'Swap Rows'-button is enabled. + printlog "Check if the 'Swap Rows'-button is enabled." + if SwapRows.isEnabled then + printlog " SwapRows was correctly enabled." + else + warnlog " SwapRows wasnt enabled, but should have been." + end if + '/// Check if the 'Delete Row'-button is enabled. + printlog "Check if the 'Delete Row'-button is enabled." + if DeleteRow.isEnabled then + printlog " DeleteRow was correctly enabled." + else + warnlog " DeleteRow wasnt enabled, but should have been." + end if + '/// Check if the 'Delete Column'-button is enabled. + printlog "Check if the 'Delete Column'-button is enabled." + if DeleteColumn.isEnabled then + warnlog " DeleteColumn was enabled, but should have been disabled." + else + printlog " DeleteColumn was correctly disabled." + end if + printlog "Check if the 'Insert Text Column'-button is enabled." + if InsertTextColumn.isEnabled then + printlog " Insert Text Column was correctly enabled." + else + warnlog " Insert Text Column wasnt enabled, but should have been." + end if + '/// Press 'TAB' to enter the Data-fields, followed by 'SHIFT TAB' end up in the first field. + printlog "Press 'TAB' to enter the Data-fields, followed by 'SHIFT TAB' end up in the first field." + Kontext "Diagramdata" + Diagramdata.TypeKeys "<TAB>", true + Diagramdata.TypeKeys "<SHIFT TAB>", true + '/// Set the text in the marked field to '111'. Then move to the next field by pressing 'TAB'. + printlog " Set the text in the marked field to '111'. Then move to the next field by pressing 'TAB'." + Tables.TypeKeys "111", true + Diagramdata.TypeKeys "<TAB>", true + '/// Set the text in the marked field to '222'. Then move to the next field by pressing 'TAB'. + printlog " Set the text in the marked field to '222'. Then move to the next field by pressing 'TAB'." + Tables.TypeKeys "222", true + Diagramdata.TypeKeys "<TAB>", true + '/// Set the text in the marked field to '333'. Then move to the next field by pressing 'TAB'. ///' + printlog " Set the text in the marked field to '333'. Then move back to the first field by pressing 'SHIFT TAB' twice." + Tables.TypeKeys "333", true + 'Do one more TAB, then three DOWNs, and check that the SwapColumn and SwapRow Icons are disabled. + Tables.TypeKeys "<TAB>", true + Tables.TypeKeys "<DOWN>", 3, true + if SwapColumns.isEnabled then + warnlog " SwapColumns was enabled, but should have been disabled." + else + printlog " SwapColumns was correctly disabled." + end if + if SwapRows.isEnabled then + warnlog " SwapRows should have been disabled, but was enabled." + else + printlog " SwapRows was correctly disabled." + end if + '/// Return to the upper left corner. + printlog "Return to the upper left corner." + Tables.TypeKeys "<SHIFT TAB>", 3, true + Tables.TypeKeys "<UP>", 3, true + '/// Click the button 'Insert Row'. + printlog " Click the button 'Insert Row'." + InsertRow.Click + '/// Click the second button of the six in the upper left corner: Insert Column + printlog " Click the button 'Insert Column'." + InsertColumn.Click + '/// Check if a new Column got inserted. And if it's unnamed. + Tables.TypeKeys "<TAB>", true + Tables.TypeKeys "<MOD1 C>", true + if GetClipboard <> "" then + warnlog " Inserting a new column in the DataTable didn't seem to work." + endif + Diagramdata.TypeKeys "<TAB>", 5, true + if DataSeriesLabel.GetText <> "" then + warnlog " Error when inserting a new Column: the Label for the Column doesn't appear to be clear. Was:" +DataSeriesLabel.GetText + endif + Tables.TypeKeys "<TAB>", true + '/// Click the third button of the six in the upper left corner: 'Delete Row'. ///' + printlog " Click the button 'Delete Row'." + DeleteRow.Click + Tables.TypeKeys "<SHIFT TAB>", true + Tables.TypeKeys "<MOD1 C>", true + if GetClipboard <> "" then + warnlog " Inserting a new column in the DataTable didn't seem to work." + endif + '/// Press 'TAB' three times to enter the column we wish to delete. ///' + printlog " Press 'TAB' three times to enter the column we wish to delete." + Tables.TypeKeys "<TAB>", 3, true + '/// Click the button 'Delete Column'. + printlog " Click the button 'Delete Column'." + DeleteColumn.Click + '/// Check if the Column got deleted. + printlog " Check if the Column got deleted." + Tables.TypeKeys "<TAB>", 2, true + Tables.TypeKeys "<MOD1 C>", true + if GetClipboard <> "" then + warnlog " Error when deleting a Column." + end if + Tables.TypeKeys "<SHIFT TAB>", 3, true + Tables.TypeKeys "<MOD1 C>", true + if GetClipboard = "2,4" OR GetClipboard = "2.4" then + printlog " DeleteColumn worked as expected." + else + warnlog " Error when deleting a Column." + end if + '/// Click the button 'Swap Columns'. + printlog " Click the button 'Swap Columns'." + SwapColumns.Click + Tables.TypeKeys "<SHIFT TAB>", true + Tables.TypeKeys "<MOD1 C>", true + if GetClipboard = "8,8" OR GetClipboard = "8.8" then + printlog " SwapColumns worked as expected." + else + warnlog " Error when Swapping a Column." + end if + '/// Click the button 'Swap Rows'. + printlog " Click the button 'Swap Rows'." + SwapRows.Click + '/// Check the result + Tables.TypeKeys "<SHIFT TAB>", 4, true + Tables.TypeKeys "<MOD1 C>", true + if GetClipboard = "1,5" OR GetClipboard = "1.5" then + printlog " SwapRows worked as expected." + else + warnlog " Error when Swapping a Row." + end if + printlog "Insert a text column" + InsertTextColumn.Click + '/// Close the dialogue + printlog " Close the dialogue." + Diagramdata.Close + '/// End of test. Close the document. + printlog " End of test. Closing the document." + Call hCloseDocument +endcase +' +'--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +' +testcase tChartDataDialogueFieldsUndo + printlog " tChartDataDialogueFieldsUndo starts" + Call hNewDocument + Kontext "DocumentImpress" + '/// Insert a new Chart-object, via the Menu: 'Insert - Chart'. + printlog " Insert a new Chart-object, via the Menu: 'Insert - Chart'." + InsertChart + WaitSlot() + Kontext "DocumentChart" + '/// Open context menu + printlog "Open context menu" + DocumentChart.OpenContextMenu + '/// Select third entry + printlog "Select third entry" + hMenuSelectNr (6) + sleep (1) + Kontext "Diagramdata" + call DialogTest ( Diagramdata ) + '/// Check if the dialogue came up. + printlog "Check if the dialogue came up." + if Diagramdata.Exists then + printlog " Diagramdata came up just as expected." + else + warnlog " Diagramdata didnt come up as expected. Please contact the test-administrator." + call hCloseDocument + goto endsub + end if + '/// Type the word 'Great' in the Label-textfield (for the Column). + printlog " Typing the word 'Great' in the Label-textfield (for the Column), and checking that it remained changed after leaving the field." + DataSeriesLabel.SetText "Great" + '/// Press 'TAB', followed by 'SHIFT TAB'. To jump from and back to the field. (and deselect and select it again). + printlog " Press 'TAB', followed by 'SHIFT TAB'. To jump from and back to the field. (and deselect and select it again)" + Diagramdata.TypeKeys "<TAB>" + Diagramdata.TypeKeys "<SHIFT TAB>" + '/// Compare the written text with what the field now contains. + printlog " Compare the written text with what the field now contains." + if DataSeriesLabel.GetText <> "Great" then + warnlog " The field 'DataSeriesLabel' didn't get set. Should be 'Great', but was '" + DataSeriesLabel.GetText + "'." + endif + '/// Inside the Tables: Press the 'TAB'-key seven times. + printlog " Inside the Tables: Press the 'TAB'-key seven times." + Tables.TypeKeys "<TAB>", 7 + '/// Inside the Tables: Check if you can type the numbers '774433', followed by 'TAB', and '774411'. + printlog " Inside the Tables: Check if you can type the numbers '774433', followed by 'TAB', and '774411'." + try + Tables.TypeKeys "774433", true + Tables.TypeKeys "<TAB>", true + Tables.TypeKeys "774411", true + Tables.TypeKeys "<SHIFT TAB>", true + Tables.TypeKeys "<MOD1 C>", true + if GetClipboard <> "774433" then + warnlog " Writing the value '774433' in the DataTable didn't seem to work." + endif + Tables.TypeKeys "<TAB>", true + Tables.TypeKeys "<MOD1 C>", true + if GetClipboard <> "774411" then + warnlog " Writing the value '774411' in the DataTable didn't seem to work." + endif + catch + warnlog " Either we're not at the right position, or the Table-fields doesn't become editable onto selection." + endcatch + '/// Close the dialogue + printlog " Close the dialogue." + Diagramdata.Close + '/// Try if we can Undo the changes with 'Edit - Undo'. + printlog "Try if we can Undo the changes with 'Edit - Undo'." + Kontext "DocumentImpress" + DatabaseUndo + '/// And then we enter the dialogue again, to check if the values has returned to what they were before we changed them. + printlog "And then we enter the dialogue again, to check if the values has returned to what they were before we changed them." + '/// Followed by one press on "RETURN" / "ENTER" to enter the Chart-Data-dialogue ///' + printlog " Click the button 'Return', to enter the Chart-Data-dialogue." + DocumentImpress.TypeKeys "<RETURN>" + Kontext "DocumentChart" + '/// Open context menu + printlog "Open context menu" + DocumentChart.OpenContextMenu + '/// Select third entry + printlog "Select third entry" + hMenuSelectNr (6) + sleep (1) + Kontext "Diagramdata" + '/// Inside the Tables: Press the 'TAB'-key 14 times. + printlog " Inside the Tables: Press the 'TAB'-key 14 times." + Tables.TypeKeys "<TAB>", 14 + '/// Inside the Tables: Check if the values has returned to what they were before changing them. + printlog " Inside the Tables: Check if the values has returned to what they were before changing them." + Tables.TypeKeys "<MOD1 C>", true + if GetClipboard <> "774433" then + if GetClipboard = "9,02" OR GetClipboard = "9.02" then + printlog " Edit-Undo worked fine." + else + warnlog " Edit-Undo didn't seem to work on the values in the Dialogue." + end if + else + warnlog " Edit-Undo didn't work on the values in the Dialogue." + end if + '/// Check if the Label we earlier named 'Great', now has changed back. + printlog " Check if the Label we earlier named 'Great', now has changed back." + if DataSeriesLabel.GetText = "Great" then + warnlog " The field 'DataSeriesLabel' didn't change back." + endif + '/// Close the dialogue + printlog " Close the dialogue." + Diagramdata.Close + '/// End of test. Close the document. + printlog " End of test. Closing the document." + Call hCloseDocument +endcase + diff --git a/testautomation/chart2/optional/includes/ch2_flexible_source_range_selection.inc b/testautomation/chart2/optional/includes/ch2_flexible_source_range_selection.inc new file mode 100644 index 000000000000..f2a6e24e45a2 --- /dev/null +++ b/testautomation/chart2/optional/includes/ch2_flexible_source_range_selection.inc @@ -0,0 +1,798 @@ +'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 : Updatetest for Flexible Source Range Selection in spreadsheets +'* +'************************************************************************ +'* +' #1 tDataRangeWizardCalc ' Updatetest for tabpage DataRange via chart wizard +' #1 tDataSeriesWizardCalc ' Updatetest for tabpage DataSeries via chart wizard +' #1 tDataRangeDialogCalc ' Updatetest for tabpage DataRange via data ranges dialog +' #1 tDataSeriesDialogCalc ' Updatetest for tabpage DataSeries via data ranges dialog +' #1 fOpenTestDocumentAndInsertChart ' Sub routine which is being used by two test cases +'* +'\*********************************************************************** + +testcase tDataRangeWizardCalc + dim sDataRange as string + dim sInputFile as string + sInputFile = convertpath(gTestToolPath & "chart2/required/input/ch_flexrange01.ods") + printlog "Open test document gtesttoolpath/chart2/required/input/ch_flexrange01.ods" + if fOpenTestDocumentAndInsertChart(sInputFile) then + Kontext "ChartType" + printlog "Choose the Chart type <i>bar</i> (should be the second in the top-down list)" + if fSetChartType( "bar" ) > 0 then + warnlog "Something went wrong setting chart type to BAR." + warnlog "Testcase aborted" + Kontext "ChartWizard" + ChartWizard.Cancel + call hCloseDocument + goto endsub + endif + printlog "Switch to tabpage Data Range" + Kontext "ChartWizard" + GoNext.Click + Kontext "TabChartTypeDataRange" + call DialogTest ( TabChartTypeDataRange ) + printlog "Check that the data range in edit field has the value $ChartFlexRange.$B$3:$E$6" + Kontext "TabChartTypeDataRange" + sDataRange = DataRange.GetText + if sDataRange <> "$ChartFlexRange.$B$3:$E$6" then + warnlog "This is not the expected datarange, it is " & sDataRange & " but should be $ChartFlexRange.$B$3:$E$6" + else + printlog " Datarange is correct" + endif + printlog "Check if -Data series in rows- is enabled" + if Rows.IsEnabled then + printlog " Data series in rows is enabled" + else + warnlog "Data series in rows is disabled" + endif + printlog "Check if Data series in columns- is enabled and chosen" + if Columns.IsEnabled then + printlog " Data series in columns is enabled" + if Columns.IsChecked then + printlog " and checked" + else + warnlog "Data series in columns is not checked" + endif + else + warnlog "Data series in columns is disabled" + endif + printlog "Check if -First row as label- is enabled and checked" + if FirstRowAsLabel.IsEnabled then + printlog " First row as label is enabled" + if FirstRowAsLabel.IsChecked then + printlog " and checked" + else + warnlog "First row as label is not checked" + endif + else + warnlog "First row as label is disabled" + endif + printlog "Check if -First column as label- is enabled and not checked" + if FirstColumnAsLabel.IsEnabled then + printlog " First column as label is enabled" + if FirstColumnAsLabel.IsChecked then + warnlog "First column as label is checked" + else + printlog " and not checked" + endif + else + warnlog "First column as label is disabled" + endif + printlog "Press button Range Chooser" + SelectDataRange.Click + printlog "Enter invalid range $ChartFlexRange.$B$3:$E$0 and close Range Chooser" + Kontext "AcceptOrRejectChangesArea" + AreaEditField.SetText "$ChartFlexRange.$B$3:$E$0" + ShrinkButton.Click + printlog "Check if -Data series in rows- is disabled" + Kontext "TabChartTypeDataRange" + if NOT Rows.IsEnabled then + printlog " Data series in rows is disabled" + else + warnlog "Data series in rows is enabled, but should be disabled" + endif + printlog "Check if -Data series in columns- is disabled" + if NOT Columns.IsEnabled then + printlog " Data series in columns is disabled" + else + warnlog "Data series in columns is enabled, but should be disabled" + endif + printlog "Check if -First row as label- is disabled" + if NOT FirstRowAsLabel.IsEnabled then + printlog " First row as label is disabled" + else + warnlog "First row as label is enabled, but should be disabled" + endif + printlog "Check if -First column as label- is disabled" + if NOT FirstColumnAsLabel.IsEnabled then + printlog " First Column as label is disabled" + else + warnlog "First Column as label is enabled, but should be disabled" + endif + printlog "Check if Back, Next and Finish does not work" + Kontext "ChartWizard" + GoBack.Click + Kontext "TabChartTypeDataRange" + if FirstColumnAsLabel.IsVisible then + printlog " Success: Back button does not work" + else + warnlog "Back button is not functionless" + Kontext "ChartWizard" + GoNext.Click + endif + printlog "Enter valid range $ChartFlexRange.$B$3:$E$6" + Kontext "TabChartTypeDataRange" + DataRange.SetText "$ChartFlexRange.$B$3:$E$6" + printlog "Check if -Data series in rows- is enabled" + if Rows.IsEnabled then + printlog " Data series in rows is enabled" + else + warnlog "Data series in rows is disabled" + endif + printlog "Check if -Data series in columns- is enabled and chosen" + if Columns.IsEnabled then + printlog " Data series in columns is enabled" + if Columns.IsChecked then + printlog " and checked" + else + warnlog "Data series in columns is not checked" + endif + else + warnlog "Data series in rows is disabled" + endif + printlog "Check if -First row as label- is enabled and checked" + if FirstRowAsLabel.IsEnabled then + printlog " First row as label is enabled" + if FirstRowAsLabel.IsChecked then + printlog " and checked" + else + warnlog "First row as label is not checked" + endif + else + warnlog "First row as label is disabled" + endif + printlog "Check if -First column as label- is enabled and not checked" + if FirstColumnAsLabel.IsEnabled then + printlog " First column as label is enabled" + if FirstColumnAsLabel.IsChecked then + warnlog "First column as label is checked" + else + printlog " and not checked" + endif + else + warnlog "First column as label is disabled" + endif + printlog "Press Cancel button" + Kontext "ChartWizard" + ChartWizard.Cancel + printlog "Close document" + Call hCloseDocument + else + warnlog "It was not possible to open the test document." + endif +endcase +' +'------------------------------------------------------------------------- +' +testcase tDataSeriesWizardCalc + dim sInputFile as string + dim iDataSeries as integer + dim sDataRanges as string + dim sRangeFor as string + dim sCategories as string + sInputFile = convertpath(gTestToolPath & "chart2/required/input/ch_flexrange02.ods") + printlog "Open test document gTestToolPath/chart2/required/input/ch_flexrange02.ods" + if fOpenTestDocumentAndInsertChart(sInputFile) then + Kontext "ChartType" + printlog "Choose the Chart type XY (SCATTER) (should be the second in the top-down list)" + if fSetChartType( "xy" ) > 0 then + warnlog "Something went wrong setting chart type to XY (SCATTER)." + Kontext "ChartWizard" + ChartWizard.Cancel + call hCloseDocument + goto endsub + endif + Kontext "ChartWizard" + printlog "Click on Next button" + GoNext.Click + printlog "Click on Next button" + GoNext.Click + Kontext "TabChartTypeDataSeries" + if RangeFor.IsVisible then + printlog " Switching to tabpage was successfull" + else + warnlog "Switching to tabpage Data Series failed" + Kontext "ChartWizard" + ChartWizard.Cancel + call hCloseDocument + goto endsub + endif + call DialogTest ( TabChartTypeDataSeries ) + printlog "Check if the data series listbox is enabled and contains three entries" + iDataSeries = DataSeries.GetItemCount + if iDataSeries = 4 then + printlog " All 4 data series are available" + else + warnlog "There are " & iDataSeries & " data series instead of 4" + endif + printlog "Check if the ADD button is enabled and click the button" + if AddButton.IsEnabled then + printlog " ADD button is enabled" + AddButton.Click + else + warnlog "ADD button is not enabled" + endif + printlog "Check if there are now four entries in the data series listbox" + iDataSeries = DataSeries.GetItemCount + if iDataSeries = 5 then + printlog " Adding a data series was successfull" + else + warnlog "There are " & iDataSeries & " data series instead of 5" + endif + printlog "Check if the second data series was added below the highlighted one" + if DataSeries.GetSelIndex = 2 then + printlog " The new data series was inserted below the highlighted (first) one" + else + warnlog "The new dataseries was not inserted below the highlighted one" + endif + printlog "Check if the REMOVE button is enabled and click the button" + if RemoveButton.IsEnabled then + printlog " REMOVE button is enabled" + RemoveButton.Click + else + warnlog "REMOVE button is not enabled" + endif + printlog "Check if there are now 4 entries in the data series listbox" + iDataSeries = DataSeries.GetItemCount + if iDataSeries = 4 then + printlog " Removing a data series was successfull" + else + warnlog "There are " & iDataSeries & " data series instead of 3" + endif + printlog "Use UP button on last data series and verify that it it disabled on first entry" + DataSeries.Select(3) + if MoveUp.IsEnabled then + printlog " The MoveUp button is enabled" + printlog "Click on Move Up button twice." + MoveUp.Click + MoveUp.Click + else + warnlog "The MoveUp button is disabled" + endif + if DataSeries.GetSelIndex = 1 then + printlog " Moving data series was successfull" + if MoveUp.IsEnabled then + warnlog "MoveUp button is not disabled on first entry" + else + printlog " and MoveUp button is disabled on first enty" + endif + else + warnlog "Moving data series was not successfull" + endif + printlog "Use DOWN button and verify that it is disabled on last entry" + DataSeries.Select(1) + if MoveDown.IsEnabled then + printlog " The MoveDown button is enabled" + printlog "Click Move Down button three times" + MoveDown.Click + MoveDown.Click + MoveDown.Click + else + warnlog "The MoveDown button is disabled" + endif + if DataSeries.GetSelIndex = 4 then + printlog " Moving data series was successfull" + if MoveDown.IsEnabled then + warnlog "MoveDown button is not disabled on first entry" + else + printlog " and MoveDown button is disabled on first enty" + endif + else + warnlog "Moving data series was not successfull" + endif + printlog "Select first entry in Data Ranges" + DataRanges.Select(1) + printlog "Verify that the range matches the one in edit field" + 'GetSelText(line,column) is a new parameter since CWS:SRC680gh13 + 'Instead of 1,2 there must be 1,4 used becqause there are two invisible + 'label-columns in that treelist-box + sDataRanges = DataRanges.GetSelText (1,4) + sRangeFor = RangeFor.GetText + if sDataRanges = sRangeFor then + printlog " Both ranges are matching" + else + warnlog "The ranges does not match: " & sDataRanges & sRangeFor + endif + printlog "Select second entry in Data Ranges" + DataRanges.Select(2) + printlog "Check that the range in the edit field has changed, too." + 'GetSelText(line,column) is a new parameter since CWS:SRC680gh13 + 'Instead of 1,2 there must be 1,4 used becqause there are two invisible + 'label-columns in that treelist-box + sDataRanges = DataRanges.GetSelText (1,4) + sRangeFor = RangeFor.GetText + if sDataRanges = sRangeFor then + printlog " Both ranges are matching" + else + warnlog "The ranges does not match" & sDataRanges & sRangeFor + endif + printlog "Change the range in edit field" + RangeFor.SetText "$ChartFlexRange.$D$5:$D$6;$ChartFlexRange.$D$8" + printlog "Check that the range in Data Ranges has changed, too" + 'GetSelText(line,column) is a new parameter since CWS:SRC680gh13 + 'Instead of 1,2 there must be 1,4 used becqause there are two invisible + 'label-columns in that treelist-box + sDataRanges = DataRanges.GetSelText (1,4) + if sDataRanges = "$ChartFlexRange.$D$5:$D$6;$ChartFlexRange.$D$8" then + printlog " The data range has also changed" + else + warnlog "The data range has not changed" + endif + printlog "Click on Range Chooser and change the range" + SelectRange.Click + Kontext "AcceptOrRejectChangesArea" + printlog "Enter $ChartFlexRange.$D$5:$D$6 in edit field" + AreaEditField.SetText "$ChartFlexRange.$D$5:$D$6" + printlog "Click on Shirnk button" + ShrinkButton.Click + printlog "Check if the range in Data ranges has changed" + Kontext "TabChartTypeDataSeries" + 'GetSelText(line,column) is a new parameter since CWS:SRC680gh13 + 'Instead of 1,2 there must be 1,4 used becqause there are two invisible + 'label-columns in that treelist-box + sDataRanges = DataRanges.GetSelText (1,4) + if sDataRanges = "$ChartFlexRange.$D$5:$D$6" then + printlog " The data range has also changed" + else + warnlog "The data range has not changed" + endif + printlog "Edit range for Data Labels" + printlog "Set text $ChartFlexRange.$C$15:$C$16 in categories" + Categories.SetText "$ChartFlexRange.$C$15:$C$16" + sCategories = Categories.GetText + printlog "Validate the changes have not been modified" + if sCategories = "$ChartFlexRange.$C$15:$C$16" then + printlog " The range has been modified" + else + warnlog "Modifiing the range was not successfull" + endif + printlog "Click on Range Chooser and change the range" + SelectCategories.Click + Kontext "AcceptOrRejectChangesArea" + printlog "Set text $ChartFlexRange.$C$5:$C$6 in the edit field" + AreaEditField.SetText "$ChartFlexRange.$C$5:$C$6" + printlog "Click on Shrink button" + ShrinkButton.Click + printlog "Verify that the range is taken" + Kontext "TabChartTypeDataSeries" + sCategories = Categories.GetText + if sCategories = "$ChartFlexRange.$C$5:$C$6" then + printlog " The range has been modified" + else + warnlog "Modifiing the range was not successfull" + endif + printlog "Enter invalid range $ChartFlexRange.$C$5:$C$" + Categories.SetText "$ChartFlexRange.$C$5:$C$" + Kontext "ChartWizard" + printlog "Click on the Back button" + GoBack.Click + Kontext "TabChartTypeDataSeries" + if Categories.IsVisible then + printlog " Success: Back button is disabled" + else + warnlog "Back button is not functionless" + Kontext "ChartWizard" + GoNext.Click + endif + printlog "Enter $ChartFlexRange.$C$5:$C$6 - a valid range" + Categories.SetText "$ChartFlexRange.$C$5:$C$6" + printlog "Press Range Chooser" + SelectCategories.Click + printlog "Press <END>-key" + Kontext "AcceptOrRejectChangesArea" + AreaEditField.TypeKeys "<END>" + printlog "Enter a semicolon and the second range $ChartFlexRange.$C$8" + AreaEditField.TypeKeys ";$ChartFlexRange.$C$8" + printlog "Close Range Chooser" + ShrinkButton.Click + printlog "Verify that there is a multiple range" + Kontext "TabChartTypeDataSeries" + sCategories = Categories.GetText + if sCategories = "$ChartFlexRange.$C$5:$C$6;$ChartFlexRange.$C$8" then + printlog " The range has been modified to a multiple range" + else + warnlog "Modifiing the range was not successfull" + endif + printlog "Press Cancel button" + Kontext "ChartWizard" + ChartWizard.Cancel + printlog "Close document" + Call hCloseDocument + else + warnlog "It was not possible to open the test document." + endif +endcase + +'------------------------------------------------------------------------- + +testcase tDataRangeDialogCalc + dim sDataRange as string + dim sInputFile as string + sInputFile = convertpath(gTestToolPath & "chart2/required/input/ch_flexrange03.ods" ) + printlog "Open test document gTestToolPath/chart2/required/input/ch_flexrange03.ods" + if fOpenTestDocumentAndSelectDataRange(sInputFile) then + printlog "Check if the data range in edit field is $ChartFlexRange.$D$4:$G$6;$ChartFlexRange.$C$5:$G$6;$ChartFlexRange.$C$4" + Kontext "TabChartTypeDataRange" + sDataRange = DataRange.GetText + if sDataRange <> "$ChartFlexRange.$C$4:$G$6" then + warnlog "This is not the expected datarange, it is " & sDataRange & " but should be $ChartFlexRange.$C$4:$G$6" + else + printlog " Datarange is correct" + endif + printlog "Check if -Data series in columns- is enabled" + if Columns.IsEnabled then + printlog " Data series in columns is enabled" + else + warnlog "Data series in columns is disabled" + endif + printlog "Check if -Data series in columns- is enabled and chosen" + if Rows.IsEnabled then + printlog " Data series in rows is enabled" + if rows.IsChecked then + printlog " and checked" + else + warnlog "Data series in rows is not checked" + endif + else + warnlog "Data series in rows is disabled" + endif + printlog "Check if -First row as label- is enabled and checked" + if FirstRowAsLabel.IsEnabled then + printlog " First row as label is enabled" + if FirstRowAsLabel.IsChecked then + printlog " and checked" + else + warnlog "First row as label is not checked" + endif + else + warnlog "First row as label is disabled" + endif + printlog "Check if -First column as label- is enabled and checked" + if FirstColumnAsLabel.IsEnabled then + printlog " First column as label is enabled" + if FirstColumnAsLabel.IsChecked then + printlog " and checked" + else + warnlog "First column as label is not checked" + endif + else + warnlog "First column as label is disabled" + endif + printlog "Press button Range Chooser" + SelectDataRange.Click + printlog "Enter $ChartFlexRange.$B$3:$E$0 in Range Chooser and close Range Chooser" + Kontext "AcceptOrRejectChangesArea" + AreaEditField.SetText "$ChartFlexRange.$B$3:$E$0" + ShrinkButton.Click + printlog "Check if -Data series in rows- is disabled" + Kontext "TabChartTypeDataRange" + if NOT Rows.IsEnabled then + printlog " Data series in rows is disabled" + else + warnlog "Data series in rows is enabled, but should be disabled" + endif + printlog "Check if -Data series in columns- is disabled" + if NOT Columns.IsEnabled then + printlog " Data series in columns is disabled" + else + warnlog "Data series in columns is enabled, but should be disabled" + endif + printlog "Check if -First row as label- is disabled" + if NOT FirstRowAsLabel.IsEnabled then + printlog " First row as label is disabled" + else + warnlog "First row as label is enabled, but should be disabled" + endif + printlog "Check if -First column as label- is disabled" + if NOT FirstColumnAsLabel.IsEnabled then + printlog " First Column as label is disabled" + else + warnlog "First Column as label is enabled, but should be disabled" + endif + printlog "Check if OK button is disabled" + try + Kontext "TabChartTypeDataRange" + TabChartTypeDataRange.OK + warnlog "The OK button is not disabled" + goto endsub + catch + printlog " The OK button is disabled" + endcatch + printlog "Enter a valid range" + Kontext "TabChartTypeDataRange" + DataRange.SetText "$ChartFlexRange.$C$4:$G$6;$ChartFlexRange.$C$8:$G$8" + printlog "Check if -Data series in columns- is enabled" + if Columns.IsEnabled then + printlog " Data series in columns is enabled" + else + warnlog "Data series in columns is disabled" + endif + printlog "Check if -Data series in columns- is enabled and chosen" + if Rows.IsEnabled then + printlog " Data series in rows is enabled" + if rows.IsChecked then + printlog " and checked" + else + warnlog "Data series in rows is not checked" + endif + else + warnlog "Data series in rows is disabled" + endif + printlog "Check if -First row as label- is enabled and checked" + if FirstRowAsLabel.IsEnabled then + printlog " First row as label is enabled" + if FirstRowAsLabel.IsChecked then + printlog " and checked" + else + warnlog "First row as label is not checked" + endif + else + warnlog "First row as label is disabled" + endif + printlog "Check if -First column as label- is enabled and checked" + if FirstColumnAsLabel.IsEnabled then + printlog " First column as label is enabled" + if FirstColumnAsLabel.IsChecked then + printlog " and checked" + else + warnlog "First column as label is not checked" + endif + else + warnlog "First column as label is disabled" + endif + printlog "Press Cancel button" + Kontext "TabChartTypeDataRange" + TabChartTypeDataRange.Cancel + printlog "Close document" + Call hCloseDocument + else + warnlog "It was not possible to open the test document." + endif +endcase +' +'------------------------------------------------------------------------- +' +testcase tDataSeriesDialogCalc + dim sInputFile as string + dim iDataSeries as integer + dim sDataRanges as string + dim sRangeFor as string + dim sCategories as string + sInputFile = convertpath(gTestToolPath & "chart2/required/input/ch_flexrange04.ods") + printlog "Open test document gTestToolPath/chart2/required/input/ch_flexrange04.ods" + if fOpenTestDocumentAndSelectDataRange(sInputFile) then + Kontext + Active.SetPage TabChartTypeDataSeries + Kontext "TabChartTypeDataSeries" + printlog "Check if the data series listbox is enabled and contains one entry" + iDataSeries = DataSeries.GetItemCount + if iDataSeries = 1 then + printlog " One data serie is available" + else + warnlog "There are " & iDataSeries & " data series instead of 1" + endif + printlog "Check if the ADD button is enabled and click the button" + if AddButton.IsEnabled then + printlog " ADD button is enabled" + AddButton.Click + else + warnlog "ADD button is not enabled" + endif + printlog "Check if there are now two entries in the data series listbox" + iDataSeries = DataSeries.GetItemCount + if iDataSeries = 2 then + printlog " Adding a data series was successfull" + else + warnlog "There are " & iDataSeries & " data series instead of 2" + endif + printlog "Check if the new data series was added below the highlighted one" + if DataSeries.GetSelIndex = 2 then + printlog " The new data series was inserted below the highlighted (first) one" + else + warnlog "The new dataseries was not inserted below the highlighted one" + endif + printlog "Use UP button on last data series and verify that it it disabled on first entry" + DataSeries.Select(2) + if MoveUp.IsEnabled then + printlog " The MoveUp button is enabled" + MoveUp.Click + else + warnlog "The MoveUp button is disabled" + endif + if DataSeries.GetSelIndex = 1 then + printlog " Moving data series was successfull" + if MoveUp.IsEnabled then + warnlog "MoveUp button is not disabled on first entry" + else + printlog " and MoveUp button is disabled on first enty" + endif + else + warnlog "Moving data series was not successfull" + endif + printlog "Use DOWN button and verify that it is disabled on last entry" + DataSeries.Select(1) + if MoveDown.IsEnabled then + printlog " The MoveDown button is enabled" + MoveDown.Click + else + warnlog "The MoveDown button is disabled" + endif + if DataSeries.GetSelIndex = 2 then + printlog " Moving data series was successfull" + if MoveDown.IsEnabled then + warnlog "MoveDown button is not disabled on first entry" + else + printlog " and MoveDown button is disabled on first enty" + endif + else + warnlog "Moving data series was not successfull" + endif + printlog "Check if the REMOVE button is enabled and click the button" + if RemoveButton.IsEnabled then + printlog " REMOVE button is enabled" + RemoveButton.Click + else + warnlog "REMOVE button is not enabled" + endif + printlog "Check if there are now one entry in the data series listbox" + iDataSeries = DataSeries.GetItemCount + if iDataSeries = 1 then + printlog " Removing a data series was successfull" + else + warnlog "There are " & iDataSeries & " data series instead of 1" + endif + printlog "Select first entry in Data Ranges" + DataRanges.Select(1) + printlog "Verify that the range for NAME matches the one in edit field" + 'GetSelText(line,column) is a new parameter since CWS:SRC680gh13 + 'Instead of 1,2 there must be 1,4 used becqause there are two invisible + 'label-columns in that treelist-box + sDataRanges = DataRanges.GetSelText(1,4) + sRangeFor = RangeFor.GetText + if sDataRanges = sRangeFor then + printlog " Both ranges are matching" + else + warnlog "The ranges does not match: " & sDataRanges & sRangeFor + endif + printlog "Select second entry in Data Ranges" + DataRanges.Select(2) + printlog "Check that the range in the edit field has changed too" + 'GetSelText(line,column) is a new parameter since CWS:SRC680gh13 + 'Instead of 1,2 there must be 1,4 used becqause there are two invisible + 'label-columns in that treelist-box + sDataRanges = DataRanges.GetSelText(1,4) + sRangeFor = RangeFor.GetText + if sDataRanges = sRangeFor then + printlog " Both ranges are matching" + else + warnlog "The ranges does not match" & sDataRanges & sRangeFor + endif + printlog "Change the range in edit field" + RangeFor.SetText "$ChartFlexRange.$D$5:$D$10" + printlog "Check that the range in Data Ranges has changed too" + 'GetSelText(line,column) is a new parameter since CWS:SRC680gh13 + 'Instead of 1,2 there must be 1,4 used becqause there are two invisible + 'label-columns in that treelist-box + sDataRanges = DataRanges.GetSelText (1,4) + if sDataRanges = "$ChartFlexRange.$D$5:$D$10" then + printlog " The data range has also changed" + else + warnlog "The data range has not changed" + endif + printlog "Click on Range Chooser and change the range" + SelectRange.Click + Kontext "AcceptOrRejectChangesArea" + AreaEditField.SetText "$ChartFlexRange.$D$5:$D$12" + ShrinkButton.Click + printlog "Check if the range in Data ranges has changed" + Kontext "TabChartTypeDataSeries" + 'GetSelText(line,column) is a new parameter since CWS:SRC680gh13 + 'Instead of 1,2 there must be 1,4 used becqause there are two invisible + 'label-columns in that treelist-box + sDataRanges = DataRanges.GetSelText (1,4) + if sDataRanges = "$ChartFlexRange.$D$5:$D$12" then + printlog " The data range has also changed" + else + warnlog "The data range has not changed" + endif + printlog "Edit range for Categories" + Categories.SetText "$ChartFlexRange.$B$5:$B$10" + sCategories = Categories.GetText + if sCategories = "$ChartFlexRange.$B$5:$B$10" then + printlog " The range has been modified" + else + warnlog "Modifiing the range was not successfull" + endif + printlog "Click on Range Chooser and change the range to $ChartFlexRange.$B$5:$B$12" + SelectCategories.Click + Kontext "AcceptOrRejectChangesArea" + AreaEditField.SetText "$ChartFlexRange.$B$5:$B$12" + ShrinkButton.Click + printlog "Verify that the range is taken" + Kontext "TabChartTypeDataSeries" + sCategories = Categories.GetText + if sCategories = "$ChartFlexRange.$B$5:$B$12" then + printlog " The range has been modified" + else + warnlog "Modifiing the range was not successfull" + endif + printlog "Enter $ChartFlexRange.$B$5:$B$ as an invalid range" + Categories.SetText "$ChartFlexRange.$B$5:$B$" + printlog "Check that the OK button does not work" + try + Kontext "TabChartTypeDataSeries" + TabChartTypeDataSeries.OK + warnlog "The OK button is not disabled" + goto endsub + catch + printlog " The OK button is disabled" + endcatch + printlog "Enter as valid range $ChartFlexRange.$B$5:$B$12" + Kontext "TabChartTypeDataSeries" + Categories.SetText "$ChartFlexRange.$B$5:$B$12" + printlog "Press Range Chooser" + SelectCategories.Click + printlog "Move cursor to the end" + Kontext "AcceptOrRejectChangesArea" + AreaEditField.TypeKeys "<END>" + printlog "Enter a semicolon and the second range $ChartFlexRange.$B$14" + AreaEditField.TypeKeys ";$ChartFlexRange.$B$14" + printlog "Close Range Chooser" + ShrinkButton.Click + printlog "Verify that there is a multiple range" + Kontext "TabChartTypeDataSeries" + sCategories = Categories.GetText + if sCategories = "$ChartFlexRange.$B$5:$B$12;$ChartFlexRange.$B$14" then + printlog " The range has been modified to a multiple range" + else + warnlog "Modifiing the range was not successfull" + endif + printlog "Press Cancel button" + Kontext "TabChartTypeDataSeries" + TabChartTypeDataSeries.Cancel + printlog "Close document" + Call hCloseDocument + else + warnlog "It was not possible to open the test document." + endif +endcase + diff --git a/testautomation/chart2/optional/includes/ch2_flexible_source_range_selection01.inc b/testautomation/chart2/optional/includes/ch2_flexible_source_range_selection01.inc new file mode 100644 index 000000000000..071e9146ef78 --- /dev/null +++ b/testautomation/chart2/optional/includes/ch2_flexible_source_range_selection01.inc @@ -0,0 +1,792 @@ +'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 : Updatetest for Flexible Source Range Selection in Writer +'* +'************************************************************************ +'* +' #1 tDataRangeWizardWriter ' Updatetest for tabpage DataRange via chart wizard +' #1 tDataSeriesWizardWriter ' Updatetest for tabpage DataSeries via chart wizard +' #1 tDataRangeDialogWriter ' Updatetest for tabpage DataRange via data ranges dialog +' #1 tDataSeriesDialogWriter ' Updatetest for tabpage DataSeries via data ranges dialog +' #1 fOpenWriterTestDocumentAndInsertChart ' Sub routine to load test documents +'* +'\*********************************************************************** + +testcase tDataRangeWizardWriter + dim sDataRange as string + dim sInputFile as string + sInputFile = convertpath(gTestToolPath & "chart2/required/input/ch_flexrange05.odt") + '///Open test document <i>gTestToolPath</i>/chart2/required/input/ch_flexrange05.odt + printlog "Open test document gTestToolPath/chart2/required/input/ch_flexrange05.odt" + if fOpenWriterTestDocumentAndInsertChart(sInputFile) then + '///Choose the Chart type <i>line</i> (should be the fifth in the top-down list) + printlog "Choose the Chart type line (should be the fifth in the top-down list)" + if fSetChartType( "line" ) > 0 then + warnlog "Something went wrong setting chart type to Line." + Kontext "ChartWizard" + ChartWizard.Cancel + call hCloseDocument + goto endsub + endif + Kontext "ChartWizard" + '/// Click Next button + GoNext.Click + Kontext "TabChartTypeDataRange" + call DialogTest ( TabChartTypeDataRange ) + '///Check data range in edit field value (ChartFlexRange.A1:E5) + printlog "Check data range in edit field value (ChartFlexRange.A1:E5)" + Kontext "TabChartTypeDataRange" + sDataRange = DataRange.GetText + if sDataRange <> "ChartFlexRange.A1:E5" then + warnlog "This is not the expected datarange, it is " & sDataRange & " but should be ChartFlexRange.A1:E5" + else + printlog " Datarange is correct" + endif + '///Check if -Data series in rows- is enabled + printlog "Check if -Data series in rows- is enabled" + if Rows.IsEnabled then + printlog " Data series in rows is enabled" + else + warnlog "Data series in rows is disabled" + endif + '///Check if -Data series in columns- is enabled and chosen + printlog "Check if -Data series in columns- is enabled and chosen" + if Columns.IsEnabled then + printlog " Data series in columns is enabled" + if Columns.IsChecked then + printlog " and checked" + else + warnlog "Data series in columns is not checked" + endif + else + warnlog "Data series in columns is disabled" + endif + '///Check if -First row as label- is enabled and checked + printlog "Check if -First row as label- is enabled and checked" + if FirstRowAsLabel.IsEnabled then + printlog " First row as label is enabled" + if FirstRowAsLabel.IsChecked then + printlog " and checked" + else + warnlog "First row as label is not checked" + endif + else + warnlog "First row as label is disabled" + endif + '///Check if -First column as label- is enabled checked + printlog "Check if -First column as label- is enabled checked" + if FirstColumnAsLabel.IsEnabled then + printlog " First column as label is enabled" + if FirstColumnAsLabel.IsChecked then + printlog " and checked" + else + warnlog "First column as label is not checked" + endif + else + warnlog "First column as label is disabled" + endif + '///Enter invalid range ChartFlexRange.A1:E + printlog "Enter invalid range ChartFlexRange.A1:E" + DataRange.SetText "ChartFlexRange.A1:E" + '///Check if -Data series in rows- is disabled + printlog "Check if -Data series in rows- is disabled" + Kontext "TabChartTypeDataRange" + if NOT Rows.IsEnabled then + printlog " Data series in rows is disabled" + else + warnlog "Data series in rows is enabled, but should be disabled" + endif + '///Check if -Data series in columns- is disabled + printlog "Check if -Data series in columns- is disabled" + if NOT Columns.IsEnabled then + printlog " Data series in columns is disabled" + else + warnlog "Data series in columns is enabled, but should be disabled" + endif + '///Check if -First row as label- is disabled + printlog "Check if -First row as label- is disabled" + if NOT FirstRowAsLabel.IsEnabled then + printlog " First row as label is disabled" + else + warnlog "First row as label is enabled, but should be disabled" + endif + '///Check if -First column as label- is disabled + printlog "Check if -First column as label- is disabled" + if NOT FirstColumnAsLabel.IsEnabled then + printlog " First Column as label is disabled" + else + warnlog "First Column as label is enabled, but should be disabled" + endif + '///Check that Back, Next and Finish does not work + printlog "Check that Back, Next and Finish does not work" + kontext "ChartWizard" + GoBack.Click + kontext "TabChartTypeDataRange" + if FirstColumnAsLabel.IsVisible then + printlog " Success: Back button does not work" + else + warnlog "Back button is not functionless" + Kontext "ChartWizard" + GoNext.Click + endif + '///Enter valid range ChartFlexRange.A1:E5 + printlog "Enter valid range ChartFlexRange.A1:E5" + kontext "TabChartTypeDataRange" + DataRange.SetText "ChartFlexRange.A1:E5" + '///Check if -Data series in rows- is enabled + printlog "Check if -Data series in rows- is enabled" + if Rows.IsEnabled then + printlog " Data series in rows is enabled" + else + warnlog "Data series in rows is disabled" + endif + '///Check if -Data series in columns- has been enabled and chosen + printlog "Check if -Data series in columns- has been enabled and chosen" + if Columns.IsEnabled then + printlog " Data series in columns is enabled" + if Columns.IsChecked then + printlog " and checked" + else + warnlog "Data series in columns is not checked" + endif + else + warnlog "Data series in rows is disabled" + endif + '///Check if -First row as label- is enabled and checked + printlog "Check if -First row as label- is enabled and checked" + if FirstRowAsLabel.IsEnabled then + printlog " First row as label is enabled" + if FirstRowAsLabel.IsChecked then + printlog " and checked" + else + warnlog "First row as label is not checked" + endif + else + warnlog "First row as label is disabled" + endif + '///Check if -First column as label- is enabled checked + printlog "Check if -First column as label- is enabled and checked" + if FirstColumnAsLabel.IsEnabled then + printlog " First column as label is enabled" + if FirstColumnAsLabel.IsChecked then + printlog " and checked" + else + warnlog "First column as label is not checked" + endif + else + warnlog "First column as label is disabled" + endif + '///Press Cancel button + printlog "Press Cancel button" + Kontext "ChartWizard" + ChartWizard.Cancel + '///Close document + printlog "Close document" + Call hCloseDocument + else + warnlog "It was not possible to open the test document." + endif +endcase +' +'------------------------------------------------------------------------- +' +testcase tDataSeriesWizardWriter + dim sInputFile as string + dim iDataSeries as integer + dim sDataRanges as string + dim sRangeFor as string + dim sCategories as string + sInputFile = convertpath(gTestToolPath & "chart2/required/input/ch_flexrange06.odt" ) + '///Open test document gTestToolPath/chart2/required/input/ch_flexrange06.odt + printlog "Open test document gTestToolPath/chart2/required/input/ch_flexrange06.odt" + if fOpenWriterTestDocumentAndInsertChart(sInputFile) then + '///Choose the Chart type <i>area</i> (should be the fourth in the top-down list) + printlog "Choose the Chart type <i>area</i> (should be the fourth in the top-down list)" + Kontext "ChartType" + if fSetChartType( "area" ) > 0 then + warnlog "Something went wrong setting chart type to area." + Kontext "ChartWizard" + ChartWizard.Cancel + call hCloseDocument + goto endsub + endif + Kontext "ChartWizard" + '/// Click Next button + GoNext.Click + '/// Click Next button + GoNext.Click + Kontext "TabChartTypeDataSeries" + if RangeFor.IsVisible then + printlog " Switching to tabpage was successfull" + else + warnlog "Switching to tabpage Data Series was not successfull" + goto endsub + endif + call DialogTest ( TabChartTypeDataSeries ) + '///Check if the data series listbox is enabled and contains four entries + printlog "Check if the data series listbox is enabled and contains four entries" + iDataSeries = DataSeries.GetItemCount + if iDataSeries = 4 then + printlog " All 4 data series are available" + else + warnlog "There are " & iDataSeries & " data series instead of 4" + endif + '///Check if the ADD button is enabled and click the button + printlog "Check if the ADD button is enabled and click the button" + if AddButton.IsEnabled then + printlog " ADD button is enabled" + AddButton.Click + else + warnlog "ADD button is not enabled" + endif + '///Check if there are now five entries in the data series listbox + printlog "Check if there are now five entries in the data series listbox" + iDataSeries = DataSeries.GetItemCount + if iDataSeries = 5 then + printlog " Adding a data series was successfull" + else + warnlog "There are " & iDataSeries & " data series instead of 5" + endif + '///Check if the new data series was added below the highlighted one + printlog "Check if the new data series was added below the highlighted one" + if DataSeries.GetSelIndex = 2 then + printlog " The new data series was inserted below the highlighted (first) one" + else + warnlog "The new dataseries was not inserted below the highlighted one" + endif + '///Check if the REMOVE button is enabled and click the button + printlog "Check if the REMOVE button is enabled and click the button" + if RemoveButton.IsEnabled then + printlog " REMOVE button is enabled" + RemoveButton.Click + else + warnlog "REMOVE button is not enabled" + endif + '///Check if there are now four entries in the data series listbox + printlog "Check if there are now four entries in the data series listbox" + iDataSeries = DataSeries.GetItemCount + if iDataSeries = 4 then + printlog " Removing a data series was successfull" + else + warnlog "There are " & iDataSeries & " data series instead of 4" + endif + '/// Select third entry + printlog "Select third entry" + DataSeries.Select(3) + if MoveUp.IsEnabled then + printlog " The MoveUp button is enabled" + '/// The Move Up button should be enabled + printlog "The Move Up button should be enabled" + '/// Click the Move Up button twice + printlog "Click the Move Up button twice" + MoveUp.Click + MoveUp.Click + else + warnlog "The MoveUp button is disabled" + endif + if DataSeries.GetSelIndex = 1 then + printlog " Moving data series was successfull" + if MoveUp.IsEnabled then + warnlog "MoveUp button is not disabled on first entry" + else + printlog " and MoveUp button is disabled on first enty" + endif + else + warnlog "Moving data series was not successfull" + endif + '/// Select second entry + printlog "Select second entry" + DataSeries.Select(2) + if MoveDown.IsEnabled then + printlog " The MoveDown button is enabled" + '/// If Move Down button is enabled + printlog "If Move Down button is enabled" + '/// Click Move Down button twice + printlog "Click Move Down button twice" + MoveDown.Click + MoveDown.Click + else + warnlog "The MoveDown button is disabled" + endif + if DataSeries.GetSelIndex = 4 then + printlog " Moving data series was successfull" + if MoveDown.IsEnabled then + warnlog "MoveDown button is not disabled on first entry" + else + printlog " and MoveDown button is disabled on first enty" + endif + else + warnlog "Moving data series was not successfull" + endif + '///Select first entry in Data Ranges + printlog "Select first entry in Data Ranges" + DataRanges.Select(1) + '///Verify that the range matches the one in edit field + printlog "Verify that the range matches the one in edit field" + 'GetSelText(line,column) is a new parameter since CWS:SRC680gh13 + 'Instead of 1,2 there must be 1,4 used becqause there are two invisible + 'label-columns in that treelist-box + sDataRanges = DataRanges.GetSelText (1,4) + sRangeFor = RangeFor.GetText + if sDataRanges = sRangeFor then + printlog " Both ranges are matching" + else + warnlog "The ranges does not match: " & sDataRanges & sRangeFor + endif + '///Select second entry in Data Ranges + printlog "Select second entry in Data Ranges" + DataRanges.Select(2) + '///Check that the range in the edit field has changed, too + printlog "Check that the range in the edit field has changed, too" + 'GetSelText(line,column) is a new parameter since CWS:SRC680gh13 + 'Instead of 1,2 there must be 1,4 used becqause there are two invisible + 'label-columns in that treelist-box + sDataRanges = DataRanges.GetSelText (1,4) + sRangeFor = RangeFor.GetText + if sDataRanges = sRangeFor then + printlog " Both ranges are matching" + else + warnlog "The ranges does not match" & sDataRanges & sRangeFor + endif + '///Change the range in edit field + printlog "Change the range in edit field" + RangeFor.SetText "ChartFlexRange.B2:B4" + '///Check that the range in Data Ranges has changed, too + printlog "Check that the range in Data Ranges has changed, too" + 'GetSelText(line,column) is a new parameter since CWS:SRC680gh13 + 'Instead of 1,2 there must be 1,4 used becqause there are two invisible + 'label-columns in that treelist-box + sDataRanges = DataRanges.GetSelText (1,4) + if sDataRanges = "ChartFlexRange.B2:B4" then + printlog " The data range has also changed" + else + warnlog "The data range has not changed" + endif + '/// Set ChartFlexRange.A2:A4 as range for categories + printlog "Set ChartFlexRange.A2:A4 as range for categories" + Categories.SetText "ChartFlexRange.A2:A4" + sCategories = Categories.GetText + if sCategories = "ChartFlexRange.A2:A4" then + printlog " The range has been modified" + else + warnlog "Modifiing the range was not successfull" + endif + '///Enter invalid range ChartFlexRange.A2:A + printlog "Enter invalid range ChartFlexRange.A2:A" + Categories.SetText "ChartFlexRange.A2:A" + '///Check that the BACK button is disabled + printlog "Check that the BACK button does not work" + kontext "ChartWizard" + GoBack.Click + kontext "TabChartTypeDataSeries" + if Categories.IsVisible then + printlog " Success: Back button does not work" + else + warnlog "Back button is not functionless" + Kontext "ChartWizard" + GoNext.Click + endif + '///Enter valid range ChartFlexRange.A2:A5 + printlog "Enter valid range ChartFlexRange.A2:A5" + Categories.SetText "ChartFlexRange.A2:A5" + '///Press Cancel button + printlog "Press Cancel button" + Kontext "ChartWizard" + ChartWizard.Cancel + '///Close document + printlog "Close document" + Call hCloseDocument + else + warnlog "It was not possible to open the test document." + endif +endcase +' +'------------------------------------------------------------------------- +' +testcase tDataRangeDialogWriter + dim sDataRange as string + dim sInputFile as string + sInputFile = convertpath(gTestToolPath & "chart2/required/input/ch_flexrange07.odt") + '///Open test document <i>gTestToolPath</i>/chart2/required/input/ch_flexrange07.odt + printlog "Open test document gTestToolPath/chart2/required/input/ch_flexrange07.odt" + if fOpenTestDocumentAndSelectDataRange(sInputFile) then + '///Check data range in edit field (ChartFlexRange.A2:A3;ChartFlexRange.B1:E3) + printlog "Check data range in edit field" + Kontext "TabChartTypeDataRange" + sDataRange = DataRange.GetText + if sDataRange <> "ChartFlexRange.A2:A3;ChartFlexRange.B1:E3" then + warnlog "This is not the expected datarange, it is " & sDataRange & " but should be ChartFlexRange.A2:A3;ChartFlexRange.B1:E3" + else + printlog " Datarange is correct" + endif + '///Check if -Data series in columns- is enabled and chosen + printlog "Check if -Data series in columns- is enabled and chosen" + if Columns.IsEnabled then + printlog " Data series in columns is enabled" + if Columns.IsChecked then + printlog " and checked" + else + warnlog "Data series in columns is not checked" + endif + else + warnlog "Data series in columns is disabled" + endif + '///Check if -Data series in rows- is enabled + printlog "Check if -Data series in rows- is enabled" + if Rows.IsEnabled then + printlog " Data series in rows is enabled" + else + warnlog "Data series in rows is disabled" + endif + '///Check if -First row as label- is enabled and checked + printlog "Check if -First row as label- is enabled and checked" + if FirstRowAsLabel.IsEnabled then + printlog " First row as label is enabled" + if FirstRowAsLabel.IsChecked then + printlog " and checked" + else + warnlog "First row as label is not checked" + endif + else + warnlog "First row as label is disabled" + endif + '///Check if -First column as label- is enabled and checked + printlog "Check if -First column as label- is enabled and checked" + if FirstColumnAsLabel.IsEnabled then + printlog " First column as label is enabled" + if FirstColumnAsLabel.IsChecked then + printlog " and checked" + else + warnlog "First column as label is not checked" + endif + else + warnlog "First column as label is disabled" + endif + '///Enter invalid range ChartFlexRange.A1:E + printlog "Enter invalid range ChartFlexRange.A1:E" + DataRange.SetText "ChartFlexRange.A1:E" + '///Check that -Data series in rows- is disabled + printlog "Check that -Data series in rows- is disabled" + Kontext "TabChartTypeDataRange" + if NOT Rows.IsEnabled then + printlog " Data series in rows is disabled" + else + warnlog "Data series in rows is enabled, but should be disabled" + endif + '///Check that -Data series in columns- is disabled + printlog "Check that -Data series in columns- is disabled" + if NOT Columns.IsEnabled then + printlog " Data series in columns is disabled" + else + warnlog "Data series in columns is enabled, but should be disabled" + endif + '///Check if -First row as label- is disabled + printlog "Check if -First row as label- is disabled" + if NOT FirstRowAsLabel.IsEnabled then + printlog " First row as label is disabled" + else + warnlog "First row as label is enabled, but should be disabled" + endif + '///Check if -First column as label- is disabled + printlog "Check if -First column as label- is disabled" + if NOT FirstColumnAsLabel.IsEnabled then + printlog " First Column as label is disabled" + else + warnlog "First Column as label is enabled, but should be disabled" + endif + '///Check that OK button is disabled + printlog "Check that OK button is disabled" + try + Kontext "TabChartTypeDataRange" + TabChartTypeDataRange.OK + warnlog "The OK button is not disabled" + goto endsub + catch + printlog " The OK button is disabled" + endcatch + '///Enter valid range ChartFlexRange.A1:E3 + printlog "Enter valid range ChartFlexRange.A1:E3" + kontext "TabChartTypeDataRange" + DataRange.SetText "ChartFlexRange.A1:E3" + '///Check if -Data series in columns- is enabled and chosen + printlog "Check if -Data series in columns- is enabled and chosen" + if Columns.IsEnabled then + printlog " Data series in columns is enabled" + if Columns.IsChecked then + printlog " and checked" + else + warnlog "Data series in columns is not checked" + endif + else + warnlog "Data series in columns is disabled" + endif + '///Check if -Data series in rows- is enabled + printlog "Check if -Data series in rows- is enabled" + if Rows.IsEnabled then + printlog " Data series in rows is enabled" + else + warnlog "Data series in rows is disabled" + endif + '///Check if -First row as label- is enabled and checked + printlog "Check if -First row as label- is enabled and checked" + if FirstRowAsLabel.IsEnabled then + printlog " First row as label is enabled" + if FirstRowAsLabel.IsChecked then + printlog " and checked" + else + warnlog "First row as label is not checked" + endif + else + warnlog "First row as label is disabled" + endif + '///Check if -First column as label- is enabled and checked + printlog "Check if -First column as label- is enabled and checked" + if FirstColumnAsLabel.IsEnabled then + printlog " First column as label is enabled" + if FirstColumnAsLabel.IsChecked then + printlog " and checked" + else + warnlog "First column as label is not checked" + endif + else + warnlog "First column as label is disabled" + endif + '///Press Cancel button + printlog "Press Cancel button" + Kontext "TabChartTypeDataRange" + TabChartTypeDataRange.Cancel + '///Close document + printlog "Close document" + Call hCloseDocument + else + warnlog "It was not possible to open the test document." + endif +endcase +' +'------------------------------------------------------------------------- +' +testcase tDataSeriesDialogWriter + dim sInputFile as string + dim iDataSeries as integer + dim sDataRanges as string + dim sRangeFor as string + dim sCategories as string + sInputFile = convertpath(gTestToolPath & "chart2/required/input/ch_flexrange08.odt") + + '/// Open test document <i>gTestToolPath</i>/chart2/required/input/ch_flexrange08.odt + printlog "Open test document gTestToolPath/chart2/required/input/ch_flexrange08.odt" + if fOpenTestDocumentAndSelectDataRange(sInputFile) then + Kontext + '/// Switching to tab page Data Series + printlog "Switching to tab page Data Series" + active.SetPage TabChartTypeDataSeries + Kontext "TabChartTypeDataSeries" + call DialogTest ( TabChartTypeDataSeries ) + '///Check if the data series listbox is enabled and contains four entries + printlog "Check if the data series listbox is enabled and contains four entries" + iDataSeries = DataSeries.GetItemCount + if iDataSeries = 4 then + printlog " One data serie is available" + else + warnlog "There are " & iDataSeries & " data series instead of four" + endif + '///Check if the ADD button is enabled and click the button + printlog "Check if the ADD button is enabled and click the button" + if AddButton.IsEnabled then + printlog " ADD button is enabled" + AddButton.Click + else + warnlog "ADD button is not enabled" + endif + '///Check if there are now five entries in the data series listbox + printlog "Check if there are now five entries in the data series listbox" + iDataSeries = DataSeries.GetItemCount + if iDataSeries = 5 then + printlog " Adding a data series was successfull" + else + warnlog "There are " & iDataSeries & " data series instead of five" + endif + '///Check if the new data series was added below the highlighted one + printlog "Check if the new data series was added below the highlighted one" + if DataSeries.GetSelIndex = 2 then + printlog " The new data series was inserted below the highlighted (first) one" + else + warnlog "The new dataseries was not inserted below the highlighted one" + endif + '///Check if the REMOVE button is enabled and click the button + printlog "Check if the REMOVE button is enabled and click the button" + if RemoveButton.IsEnabled then + printlog " REMOVE button is enabled" + RemoveButton.Click + else + warnlog "REMOVE button is not enabled" + endif + '///Check if there are now four entries in the data series listbox + printlog "Check if there are now four entries in the data series listbox" + iDataSeries = DataSeries.GetItemCount + if iDataSeries = 4 then + printlog " Removing a data series was successfull" + else + warnlog "There are " & iDataSeries & " data series instead of 4" + endif + '///Use UP button and verify that it it disabled on first entry + printlog "Use UP button and verify that it it disabled on first entry" + DataSeries.Select(2) + if MoveUp.IsEnabled then + printlog " The MoveUp button is enabled" + MoveUp.Click + else + warnlog "The MoveUp button is disabled" + endif + if DataSeries.GetSelIndex = 1 then + printlog " Moving data series was successfull" + if MoveUp.IsEnabled then + warnlog "MoveUp button is not disabled on first entry" + else + printlog " and MoveUp button is disabled on first enty" + endif + else + warnlog "Moving data series was not successfull" + endif + '///Use DOWN button thrice and verify that it is disabled on last entry + printlog "Use DOWN button thrice and verify that it is disabled on last entry" + DataSeries.Select(1) + if MoveDown.IsEnabled then + printlog " The MoveDown button is enabled" + MoveDown.Click + MoveDown.Click + MoveDown.Click + else + warnlog "The MoveDown button is disabled" + endif + if DataSeries.GetSelIndex = 4 then + printlog " Moving data series was successfull" + if MoveDown.IsEnabled then + warnlog "MoveDown button is not disabled on first entry" + else + printlog " and MoveDown button is disabled on first enty" + endif + else + warnlog "Moving data series was not successfull" + endif + '///Select first entry in Data Ranges + printlog "Select first entry in Data Ranges" + DataRanges.Select(1) + '///Verify that the range matches the one in edit field + printlog "Verify that the range matches the one in edit field" + 'GetSelText(line,column) is a new parameter since CWS:SRC680gh13 + 'Instead of 1,2 there must be 1,4 used becqause there are two invisible + 'label-columns in that treelist-box + sDataRanges = DataRanges.GetSelText (1,4) + sRangeFor = RangeFor.GetText + if sDataRanges = sRangeFor then + printlog " Both ranges are matching" + else + warnlog "The ranges does not match: " & sDataRanges & sRangeFor + endif + '///Select second entry in Data Ranges + printlog "Select second entry in Data Ranges" + DataRanges.Select(2) + '///Check that the range in the edit field has changed,too + printlog "Check that the range in the edit field has changed,too" + 'GetSelText(line,column) is a new parameter since CWS:SRC680gh13 + 'Instead of 1,2 there must be 1,4 used becqause there are two invisible + 'label-columns in that treelist-box + sDataRanges = DataRanges.GetSelText (1,4) + sRangeFor = RangeFor.GetText + if sDataRanges = sRangeFor then + printlog " Both ranges are matching" + else + warnlog "The ranges does not match" & sDataRanges & sRangeFor + endif + '///Change the range in edit field to ChartFlexRange.B2:B3 + printlog "Change the range in edit field to ChartFlexRange.B2:B3" + RangeFor.SetText "ChartFlexRange.B2:B3" + '///Check that the range in Data Ranges has changed, too + printlog "Check that the range in Data Ranges has changed, too" + 'GetSelText(line,column) is a new parameter since CWS:SRC680gh13 + 'Instead of 1,2 there must be 1,4 used becqause there are two invisible + 'label-columns in that treelist-box + sDataRanges = DataRanges.GetSelText (1,4) + if sDataRanges = "ChartFlexRange.B2:B3" then + printlog " The data range has also changed" + else + warnlog "The data range has not changed" + endif + '///Edit range for Categories (ChartFlexRange.A2:A3) + printlog "Edit range for Categories (ChartFlexRange.A2:A3)" + Categories.SetText "ChartFlexRange.A2:A3" + sCategories = Categories.GetText + if sCategories = "ChartFlexRange.A2:A3" then + printlog " The range has been modified" + else + warnlog "Modifiing the range was not successfull" + endif + '///Enter invalid range ChartFlexRange.A2:A + printlog "Enter invalid range ChartFlexRange.A2:A" + Categories.SetText "ChartFlexRange.A2:A" + '///Check that the OK button is disabled + printlog "Check that the OK button is disabled" + try + Kontext "TabChartTypeDataSeries" + TabChartTypeDataSeries.OK + warnlog "The OK button is not disabled" + goto endsub + catch + printlog " The OK button is disabled" + endcatch + '///Enter valid range ChartFlexRange.A2:A4 + printlog "Enter valid range ChartFlexRange.A2:A4" + kontext "TabChartTypeDataSeries" + Categories.SetText "ChartFlexRange.A2:A4" + '///Press Cancel button + printlog "Press Cancel button" + Kontext "TabChartTypeDataSeries" + TabChartTypeDataSeries.Cancel + '///Close document + printlog "Close document" + Call hCloseDocument + else + warnlog "It was not possible to open the test document." + endif +endcase +' +'------------------------------------------------------------------------- +' +function fOpenWriterTestDocumentAndInsertChart(sInputFile as STRING) as BOOLEAN + fOpenWriterTestDocumentAndInsertChart = FALSE + hFileOpenLocally(sInputFile) + '///Menu Insert Object Chart to open chart wizard + printlog "Menu Insert Object Chart to open chart wizard" + InsertObjectChart + WaitSlot() + fOpenWriterTestDocumentAndInsertChart = TRUE +end function + diff --git a/testautomation/chart2/optional/includes/ch2_lvl1a.inc b/testautomation/chart2/optional/includes/ch2_lvl1a.inc new file mode 100755 index 000000000000..e012dd0253c8 --- /dev/null +++ b/testautomation/chart2/optional/includes/ch2_lvl1a.inc @@ -0,0 +1,267 @@ +'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 : Chart2 functional tests +'* +'\************************************************************************ + +sub ch2_lvl1a + + Call tPlotOptions + Call tChartShapes + +end sub + + +testcase tPlotOptions + + Dim sOutputFile as string + sOutputFile = convertpath(gOfficepath & "user\work\hiddenCells.ods") + + gApplication = "CALC" + + printlog "Load simple chart document" + if fLoadVerySimpleChartAndSaveLocal() > 0 then + warnlog "Loading test document seems to have failed -> Check this out!" + goto endsub + endif + printlog "Select chart using navigator" + if fSelectFirstOLE = -1 then + warnlog "It was not possible to select the chart object!" + Call hCloseDocument + goto endsub + endif + + printlog "Edit / Object / Edit" + EditObjectEdit + waitslot() + printlog "Select DataSeries A by toolbar selectorbox" + Kontext "DocumentChart" + call fChartSelectElement (8) + + printlog "Invoke Format::ObjectProperties" + Kontext "Toolbar" + FormatSelection.Click + + printlog "Select tab page Options" + Kontext + Active.SetPage TabDataSeriesOptions + Kontext "TabDataSeriesOptions" + printlog "activate checkbox 'Include values from hidden cells'" + try + IncludeHiddenCells.Check + catch + Warnlog "checkbox hidden or disabled" + Call hCloseDocument + goto endsub + endcatch + + printlog "Close and reopen data series dialog - checkbox should be still activated" + TabDataSeriesOptions.Ok + sleep (1) + Kontext "DocumentChart" + FormatSelection + printlog "Select tab page Options" + Kontext + Active.SetPage TabDataSeriesOptions + Kontext "TabDataSeriesOptions" + if Not IncludeHiddenCells.IsChecked then + Warnlog "After closing and reopening of Data-Series dialog the checkbox isn't checked anymore" + TabDataSeriesOptions.Cancel + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "<Escape>" + call hCloseDocument + goto endsub + endif + + TabDataSeriesOptions.Ok + + printlog "save and reopen file - checkbox still must be checked" + if NOT hFileSaveAsKill (sOutputFile) then + warnlog "Saving test document failed -> Aborting" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "<Escape>" + call hCloseDocument + goto endsub + endif + Call hCloseDocument + + Call hFileOpen(sOutputFile) + if fSelectFirstOLE = -1 then + warnlog "It was not possible to select the chart object!" + Call hCloseDocument + goto endsub + endif + + EditObjectEdit + waitslot() + printlog "Select DataSeries A by toolbar selectorbox" + call fChartSelectElement (8) + + printlog "Invoke Format::ObjectProperties" + Kontext "Toolbar" + FormatSelection.Click + Kontext + Active.SetPage TabDataSeriesOptions + Kontext "TabDataSeriesOptions" + if Not IncludeHiddenCells.IsChecked then + Warnlog "After closing and reopening of Data-Series dialog the checkbox isn't checked anymore" + TabDataSeriesOptions.Cancel + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "<Escape>" + call hCloseDocument + goto endsub + endif + + '/// Close dialog with Cancel-button + TabDataSeriesOptions.Cancel + '/// Close document + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "<Escape>" + + Call hCloseDocument +endcase + +' +'------------------------------------------------------------------------- +' +testcase tChartShapes + + Dim sLocalFile as string + Dim sLocalFileXLS as string + Dim sFormatXLS as string + sLocalFile = convertpath(gOfficepath & "user\work\chartshapes.ods") + sLocalFileXLS = convertpath(gOfficepath & "user\work\chartshapes.xls") + sFormatXLS = "MS Excel 97" + + gApplication = "CALC" + + printlog " Load simple chart document" + if fLoadVerySimpleChartAndSaveLocal() > 0 then + warnlog "Loading test document seems to have failed -> Check this out!" + goto endsub + endif + printlog " Select chart using navigator" + call fSelectFirstOLE + printlog " Invoke Edit::Object::Edit to enter Inplace Mode" + EditObjectEdit + printlog " Verify that the drawbar is visible" + Kontext "DrawBar" + + qaerrorlog "#i107003# disabled because of bug in toolbars" + ' if Not DrawBar.Exists then + ' Call hToolbarSelect("Drawing", true) + ' endif + + printlog " Insert a shape to the chart by <STRG-RETURN>" + Kontext "DocumentChart" + DocumentChart.TypeKeys "<F6>",4 + Kontext "DrawBar" + sleep (1) + DrawBar.typekeys "<TAB>",TRUE + DrawBar.typekeys "<TAB>",TRUE + DrawBar.typekeys "<TAB>",TRUE + DrawBar.typekeys "<TAB>",TRUE + DrawBar.typekeys "<MOD1 RETURN>",TRUE + printlog " Rename inserted shape" + Kontext "DocumentChart" + sleep (1) + DocumentChart.OpenContextMenu + sleep (1) + hMenuSelectNr (6) + Kontext "NameDlgObject" + NameField.SetText "ChartShape1" + NameDlgObject.OK + printlog " Leave Chart" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "<Escape>" + printlog "Select chart using navigator" + call fSelectFirstOLE + printlog "Invoke Edit::Object::Edit to enter Inplace Mode" + EditObjectEdit + printlog " Check if shape is still there" + Kontext "DocumentChart" + DocumentChart.typekeys "<SHIFT TAB>" + Sleep (1) + Kontext "Toolbar" + if ChartElementSelector.GetSelText <> "ChartShape1" then + warnlog "Something is wrong with the shape" + endif + printlog " Leave Chart" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "<Escape>" + printlog " Save document with the default calc filter" + call hFileSaveAsKill ( sLocalFile ) + printlog " Save document to 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 ( sLocalFile ) + printlog "Select chart using navigator" + call fSelectFirstOLE + printlog "Invoke Edit::Object::Edit to enter Inplace Mode" + EditObjectEdit + printlog " Check if shape is still there" + Kontext "DocumentChart" + DocumentChart.typekeys "<SHIFT TAB>" + Sleep (1) + Kontext "Toolbar" + if ChartElementSelector.GetSelText <> "ChartShape1" then + warnlog "Something is wrong with the shape" + endif + printlog " Leave Chart" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "<Escape>" + printlog " Close document" + Call hCloseDocument + call hFileOpen ( sLocalFileXLS ) + printlog "Select chart using navigator" + call fSelectFirstOLE + printlog "Invoke Edit::Object::Edit to enter Inplace Mode" + EditObjectEdit + printlog " Check if shape is still there" + Kontext "DocumentChart" + DocumentChart.typekeys "<SHIFT TAB>" + Sleep (1) + Kontext "Toolbar" + if ChartElementSelector.GetSelText <> "ChartShape1" then + warnlog "Something is wrong with the shape" + endif + printlog " Leave Chart" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "<Escape>" + printlog " Close document" + Call hCloseDocument + +endcase diff --git a/testautomation/chart2/optional/includes/loadsave/ch2_losa.inc b/testautomation/chart2/optional/includes/loadsave/ch2_losa.inc new file mode 100644 index 000000000000..b530b0c2a364 --- /dev/null +++ b/testautomation/chart2/optional/includes/loadsave/ch2_losa.inc @@ -0,0 +1,219 @@ +'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 : Load file of one Spreadsheet format and save to another +'* +'\****************************************************************************** + +sub subLoSaFromTo + + dim sSourcePath as string + dim lsInputFileList ( 500 ) as string + dim iFilesInList as integer + dim sCurrentFileInList as string + dim iMainIndex as integer + + dim cRelativePath as string + cRelativePath = "chart2\optional\input\" & gsDirectoryInSourcePath &"\" + + '///<u><b>Load/Save files with charts</b></u> + printLog Chr(13) + "--------- Save with filter: " & gsFileFormat & " ----------" + sSourcePath = convertPath ( gtesttoolpath & cRelativePath ) + + '///+<ul><li>Determine list of files to test (All files in 'chart2\loadsave\input\<gsDirectoryInSourcePath>\')</li> + GetAllFileList( sSourcePath , "*." & gsDirectoryInSourcePath , lsInputFileList() ) + iFilesInList = ListCount( lsInputFileList() ) + '///+<li>Run testcase 'tLoadSaveFromTo' for each file in list</li></ul> + for iMainIndex = 2 to iFilesInList + + sCurrentFileInList = lsInputFileList( iMainIndex ) + printlog "* * * * * * *" + printlog "Loop " & ( iMainIndex - 1 ) & " of " & ( iFilesInList - 1 ) + printlog "Test document: " & sCurrentFileInList + call tLoadSaveFromTo ( sCurrentFileInList ) + + next iMainIndex + +end sub + +'******************************************************************************* + +function hLoSaEscape() as boolean + + ' Fine grained function to send Escape-keystroke to a spreadsheet document + + const MAX_TRIES = 12 + dim iTry as integer + + for iTry = 1 to MAX_TRIES + + wait( 250 ) + + Kontext "DocumentCalc" + try + DocumentCalc.TypeKeys( "<ESCAPE>" ) + hLoSaEscape() = true + exit for + catch + if ( iTry = MAX_TRIES ) then + warnlog( "hLoSaEscape(): Sending <ESCAPE> to document failed." ) + hLoSaEscape() = false + endif + endcatch + + next iTry + +end function + +'******************************************************************************* + +function hLoSaInplaceEditing() as boolean + + ' Enter in-place editing mode + + const RC_TIMEOUT = -1 + + Kontext "DocumentCalc" + printlog( "Enable in-place editing by slot <EditObjectEdit>" ) + if ( hUseAsyncSlot( "EditObjectEdit" ) <> RC_TIMEOUT ) then + + printlog( "Clicked menuitem: Format->Charttype" ) + if ( hUseAsyncSlot( "FormatChartType" ) <> RC_TIMEOUT ) then + + Kontext "ChartType" + if ChartType.exists(2) then + + printlog( "Chart type dialog open, Chart object was found." ) + Kontext "ChartType" + if ( hCloseDialog( ChartType, "cancel" ) ) then + printlog( "Chart type dialog closed successfully" ) + hLoSaInplaceEditing() = true + else + warnlog( "hLoSaInplaceEditing(): Failed to close dialog <ChartType>" ) + hLoSaInplaceEditing() = false + endif + else + warnlog( "hLoSaInplaceEditing(): Chart type dialog not open, please check the Chart object" ) + hLoSaInplaceEditing() = false + endif + + else + warnlog( "hLoSaInplaceEditing(): Failed to execute slot <FormatChartType>" ) + hLoSaInplaceEditing() = false + endif + else + warnlog( "hLoSaInplaceEditing(): Failed to execute slot <EditObjectEdit>" ) + hLoSaInplaceEditing() = false + endif + +end function + +'******************************************************************************* + +testcase tLoadSaveFromTo ( sCurrentFile as string ) + + printlog( "Load/Save files containing Chart OLE objects in multiple file-formats" ) + + dim sCurrentFileLength as integer + dim iCurrentPostionInFileName as integer + dim iLastPathSignePositon as integer : iLastPathSignePositon = 0 + dim sExtractedFileName as string + dim sExtractedExtension as string + dim sTemporaryFile as string + dim sOutputFile as string + dim iIndex as integer + + sCurrentFileLength = len ( sCurrentFile ) + + 'Remove path and extension from file name + do + iCurrentPostionInFileName = instr ( iCurrentPostionInFileName + 1 , sCurrentFile , gPathSigne ) + if iCurrentPostionInFileName = 0 then + exit do + endif + iLastPathSignePositon = iCurrentPostionInFileName + loop + + sExtractedFileName = right ( sCurrentFile , sCurrentFileLength - iLastPathSignePositon ) + sCurrentFileLength = len ( sExtractedFileName ) + sExtractedExtension = right ( sExtractedFileName , 4 ) + sExtractedFileName = left ( sExtractedFileName , sCurrentFileLength - 4 ) + sTemporaryFile = ( gOfficePath & ConvertPath("user\work\TemporaryFileToAvoidLocking" ) ) + sOutputFile = ( gOfficePath & ConvertPath("user\work\" & sExtractedFileName & "_" & gsDirectoryInSourcePath & "_to" & gsOutputFileCustomExtension ) ) + + printlog( "Open file: " & sCurrentFile ) + if ( not hFileOpen( sCurrentFile ) ) then + warnlog( "Unable to read file" ) + goto endsub + endif + + printlog( "Save file locally, overwriting existing" ) + if ( not hFileSaveAsKill( sTemporaryFile & sExtractedExtension ) ) then + warnlog( "Unable to save file locally" ) + goto endsub + endif + + printlog( "Select the first OLE object via Navigator" ) + call fSelectFirstOLE + + printlog( "Enter in-place editing mode" ) + hLoSaInplaceEditing() + + printlog( "Type <Escape> to exit in-place editing mode" ) + hLoSaEscape() + + printlog( "Save file as " & sOutputFile & " using filter: " & gsFileFormat ) + if ( not hFileSaveAsWithFilterKill ( sOutputFile , gsFileFormat ) ) then + warnlog( "Saving the document failed using filter: " & gsFileFormat ) + goto endsub + endif + + printlog( "Close the document" ) + hCloseDocument() + + printlog( "Reload document" ) + if ( not hFileOpen(sOutputFile) ) then + warnlog( "Failed to reload document" ) + goto endsub + endif + + printlog( "Select the first (and only) OLE object" ) + call fSelectFirstOLE + + printlog( "Enter in-place editing mode" ) + hLoSaInplaceEditing() + + printlog( "Type <Escape> to exit in-place editing mode" ) + hLoSaEscape() + + printlog( "Close the document" ) + call hCloseDocument() + +endcase + diff --git a/testautomation/chart2/optional/includes/loadsave/ch2_xml_format.inc b/testautomation/chart2/optional/includes/loadsave/ch2_xml_format.inc new file mode 100644 index 000000000000..ef61dc36e704 --- /dev/null +++ b/testautomation/chart2/optional/includes/loadsave/ch2_xml_format.inc @@ -0,0 +1,243 @@ +'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 : Verify the Chart2 XML file format +'* +'************************************************************************ +'* +' #1 tCompareXMLFormatCreate ' Verify Chart2 XML file format by using three characteristcs on new chart +' #1 tCompareXMLFormatLoad ' Verify Chart2 XML file format by using three characteristcs on loaded chart +'* +'\*********************************************************************** + +testcase tCompareXMLFormatCreate + '///+ Test purpose: Verify within three characteristics that there is really a chart + + dim sOutputFile as string + dim sUnpackedStorageDir as string + dim sChartContentXML as string + + gApplication = "WRITER" + sOutputFile = convertpath(gOfficepath & "user\work\Chart2_XML.odt") + sUnpackedStorageDir = (gOfficePath & ConvertPath("user\work\chart2_XML2")) + sChartContentXML = (gOfficePath & ConvertPath("user\work\chart2_XML2") & ConvertPath("\Object 1\content.xml")) + + '/// File / New / Text + printlog " Open new Writer document" + call hNewDocument + '/// Insert chart with Insert / Object / Chart + printlog " Insert chart with Insert / Object / Chart" + InsertChart + '/// Save document to <i>gOfficepath</i>/user/work/Chart2_XML.odt + printlog " Save document to <i>gOfficepath</i>/user/work/Chart2_XML.odt" + if NOT hFileSaveAsKill (sOutputFile) then + warnlog "Saving test document failed -> Aborting" + call hCloseDocument + goto endsub + else + printlog "File saved successfully." + endif + '/// File / Close + call hCloseDocument + sleep(3) + printlog "File closed" + '/// Uncompress with <i>unzip</i> or <i>jar</i> the + '///+ <i>gOfficepath</i>/user/work/verySimpleChart.ods document + '///+ into <i>gOfficePath</i>/user/work/chart2_XML-directory + printlog "Unpack storage of test document." + UnpackStorage(sOutputFile, sUnpackedStorageDir) + printlog "Read the test documents DOM." + '/// Load the XML file <i>gOfficePath</i>/user/work/chart2_XML/Object 1/content.xml + '///+ in an XML editor + SAXReadFile(sChartContentXML) + printlog "Set the DOM pointer to document root" + printlog "|-/" + SAXSeekElement("/") + printlog " |-office:document-content" + '/// Open the element 'office:document-content' + SAXSeekElement("office:document-content") + printlog " |-office:body" + '/// Open the element 'office:body' + SAXSeekElement("office:body") + printlog " |-office:chart" + '/// Open the element 'office:chart' + SAXSeekElement("office:chart") + printlog " |-chart:chart" + '/// Open the element 'chart:chart' + SAXSeekElement("chart:chart") + '/// Get the attribute value for <i>chart:class</i>. + '///+ If it is 'chart:bar' the first characteristics validation has been + '///+ passed. + if SAXGetAttributeValue("chart:class") = "chart:bar" then + printlog "This is a bar chart as expected" + else + warnlog "This is no bar chart, it is a " & SaxGetAttributeValue("chart:class") + endif + printlog "Seek for chart:plot-area" + printlog " |-chart:plot-area" + '/// Open the element 'chart:plot-area' + SAXSeekElement("chart:plot-area") + '/// If the attribute value of 'chart:data-source-has-labels' is 'both' + '///+ the second characteristics validation has been passed. + if SAXGetAttributeValue("chart:data-source-has-labels") = "both" then + printlog "The label attribute for chart:plot-area is correct" + else + warnlog "The lable attribute is not both, it is " & SaxGetAttributeValue("chart:data-source-has-labels") + endif + printlog "Seek for chart:series" + printlog " |-chart:series" + '/// Open the element 'chart:series' + SAXSeekElement("chart:series") + '/// If the attribute valie of 'chart:values-cell-range-address' is local-table.$B$2:.$B$5'' + '///+ the hird characteristics validation has been passed. + if SAXGetAttributeValue("chart:values-cell-range-address") = "local-table.$B$2:.$B$5" then + printlog "The cell range for chart:series is correct" + else + warnlog "The cell range is not local-table.$B$2:.$B$5, it is " & SaxGetAttributeValue("chart:values-cell-range-address") + endif + ' DEBUG: printlog "I'm here: " & SAXGetElementName + '/// Close the XML editor. + SAXRelease +endcase +' +'-------------------------------------------------------------------- +' +testcase tCompareXMLFormatLoad + '///+ Test purpose: Verify within three characteristics that there is really a chart + + dim sOutputFile as string + dim sUnpackedStorageDir as string + dim sChartContentXML as string + + gApplication = "CALC" + sOutputFile = convertpath(gOfficepath & "user\work\verySimpleChart.ods") + sUnpackedStorageDir = (gOfficePath & ConvertPath("user\work\chart2_XML")) + sChartContentXML = (gOfficePath & ConvertPath("user\work\chart2_XML") & ConvertPath("\Object 1\content.xml")) + + '/// File / Open / <i>gTestToolPath</i>/chart2/update/input/verySimpleChart.ods + '/// File / Save As / <i>gOfficepath</i>/user/work/verySimpleChart.ods + if fLoadVerySimpleChartAndSaveLocal() > 0 then + warnlog "Loading test document failed!" + goto endsub + else + printlog "Test document has successfully been loaded." + endif + + '/// Select the chart object using the navigator + printlog "Select chart using navigator" + if fSelectFirstOLE = 0 then + printlog "Chart is selected" + else + warnlog "Chart could not be selected" + call hCloseDocument + goto endsub + endif + + '/// Activate chart with Edit / Object / Edit + printlog "Activate chart by Edit / Object / Edit" + EditObjectEdit + + 'Save document localy + Kontext "DocumentCalc" + '/// Press twice <ESCAPE> to leave the chart object + DocumentCalc.TypeKeys "<ESCAPE>" , 2 'Leave chart and unselect it + '/// Press <CTRL+HOME> to get to cell A1 + DocumentCalc.TypeKeys "<MOD1 HOME>" + '/// Press <F9> to re-calculate the spreadsheet and the objects + DocumentCalc.TypeKeys "<F9>" + '/// Save the document again + if NOT hFileSave (sOutputFile) then + warnlog "Saving test document localy failed -> Aborting" + call hCloseDocument + goto endsub + else + printlog "File with very simple chart saved successfully." + endif + '/// File / Close + call hCloseDocument + sleep(3) + printlog "File with very simple chart closed" + '/// Uncompress with <i>unzip</i> or <i>jar</i> the + '///+ <i>gOfficepath</i>/user/work/verySimpleChart.ods document + '///+ into <i>gOfficePath</i>/user/work/chart2_XML-directory + printlog "Unpack storage of test document." + UnpackStorage(sOutputFile, sUnpackedStorageDir) + printlog "Read the test documents DOM." + '/// Load the XML file <i>gOfficePath</i>/user/work/chart2_XML/Object 1/content.xml + '///+ in an XML editor + SAXReadFile(sChartContentXML) + printlog "Set the DOM pointer to document root" + printlog "|-/" + SAXSeekElement("/") + printlog " |-office:document-content" + '/// Open the element 'office:document-content' + SAXSeekElement("office:document-content") + printlog " |-office:body" + '/// Open the element 'office:body' + SAXSeekElement("office:body") + printlog " |-office:chart" + '/// Open the element 'office:chart' + SAXSeekElement("office:chart") + printlog " |-chart:chart" + '/// Open the element 'chart:chart' + SAXSeekElement("chart:chart") + '/// Get the attribute value for <i>chart:class</i>. + '///+ If it is 'chart:bar' the first characteristics validation has been + '///+ passed. + if SAXGetAttributeValue("chart:class") = "chart:bar" then + printlog "This is a bar chart as expected" + else + warnlog "This is no bar chart, it is a " & SaxGetAttributeValue("chart:class") + endif + printlog "Seek for chart:plot-area" + printlog " |-chart:plot-area" + '/// Open the element 'chart:plot-area' + SAXSeekElement("chart:plot-area") + '/// If the attribute value of 'table:cell-range-address' is 'Sheet1.A1:Sheet1.B2' + '///+ the second characteristics validation has been passed. + if SAXGetAttributeValue("table:cell-range-address") = "Sheet1.A1:Sheet1.B2" then + printlog "The cell range for chart:plot-area is correct" + else + warnlog "The cell range is not Sheet1.A1:Sheet1.B2, it is " & SaxGetAttributeValue("table:cell-range-address") + endif + printlog "Seek for chart:series" + printlog " |-chart:series" + '/// Open the element 'chart:series' + SAXSeekElement("chart:series") + '/// If the attribute valie of 'chart:values-cell-range-address' is Sheet1.A1:Sheet1.A2'' + '///+ the hird characteristics validation has been passed. + if SAXGetAttributeValue("chart:values-cell-range-address") = "Sheet1.A1:Sheet1.A2" then + printlog "The cell range for chart:series is correct" + else + warnlog "The cell range is not Sheet1.A1:Sheet1.A2, it is " & SaxGetAttributeValue("chart:values-cell-range-address") + endif + ' DEBUG: printlog "I'm here: " & SAXGetElementName + '/// Close the XML editor. + SAXRelease +endcase diff --git a/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard.inc b/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard.inc new file mode 100644 index 000000000000..357fa89c4393 --- /dev/null +++ b/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard.inc @@ -0,0 +1,1092 @@ +'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 : Chart wizard general functionality +'* +'************************************************************************ +'* +' #1 tCreateNew3DChart ' Create a new 3D chart and check the preserved values +' #1 tCreateNewLineChart ' Create a new line chart and check the preserved values +'* +'\************************************************************************ + +testcase tCreateNew3DChart + Dim sInputFile as STRING + Dim sOutputFile as STRING + Dim sControlString as STRING + Dim iChartVariant as integer + Dim iChartVariantText as string + + + sInputFile = convertpath ( gTesttoolPath & "chart2/optional/input/randomData.ods" ) + sOutputFile = convertpath ( gOfficePath & "user/work/tCreateNew3DChart.ods" ) + + printlog "Load test document TesttoolPath/chart2/optional/input/randomData.ods" + call hFileOpen(sInputFile) + sleep(2) + printlog "Save document as OfficePath/user/work/tCreateNew3DChart.ods" + if NOT hFileSaveAsWithFilterKill ( sOutputFile , "calc8" ) then + warnlog "Saving test document localy failed -> Aborting" + call hCloseDocument + goto endsub + endif + printlog "Insert / Chart" + InsertChart + sleep(5) + Kontext "ChartType" + printlog "Choose the Chart type bar (should be the second in the top-down list)" + if fSetChartType( "bar" ) > 0 then + warnlog "Something went wrong setting chart type to BAR." + endif + printlog "Select 2nd chart variant from left" + if fSetChartTypeVariant( 2 ) > 0 then + warnlog "Something went wrong setting chart type VARIANT." + endif + printlog "Check 3D Look checkbox" + if fSetChartType3D( TRUE ) > 0 then + warnlog "Something went wrong setting 3D chart." + endif + printlog "Change Chart type look to simple" + if fSetChartLook3D( "simple" ) > 0 then + warnlog "Something went wrong setting 3D look." + endif + printlog "Change Chart shape to cone" + if fSetChartShape3D( "cone" ) > 0 then + warnlog "Something went wrong setting 3D shape." + endif + printlog "Change to Data Range tab page by clicking the Next-button" + Kontext "ChartWizard" + GoNext.Click + Kontext "TabChartTypeDataRange" + printlog "Set data range text box to $Sheet1.$A$2:$E$13" + if fSetTextBox ( DataRange , "$Sheet1.$A$2:$E$13" ) > 0 then + warnlog "Something went wrong setting Text." + endif + printlog "Select data series in Rows radiobox" + if fSetRadioButton ( Rows ) > 0 then + warnlog "Something went wrong selecting 'Data Series in: Rows'." + endif + printlog "Uncheck First row as label checkbox" + if fSetCheckBox ( FirstRowAsLabel , FALSE ) > 0 then + warnlog "Something went wrong unselecting 'First row as label'." + endif + printlog "Change to Data Series tab page by clicking the Next-button" + Kontext "ChartWizard" + GoNext.Click + Kontext "TabChartTypeDataSeries" + printlog "Select last (12th) entry in Data Series list on the left" + if fSetListBoxByItem ( DataSeries , 12 ) > 0 then + warnlog "Something went wrong selecting 'Data Series' item no. 12." + endif + printlog "Click on the add-button" + AddButton.Click + printlog "Set Range for Name text field to A17" + if fSetTextBox ( RangeFor , "A17" ) > 0 then + warnlog "Something went wrong setting Text." + endif + printlog "Select 2nd entry in Data Ranges (Y-Values) list on the right" + if fSetListBoxByItem ( DataRanges , 2 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 2." + endif + printlog "Set Range for Y-Values text field to B17:E17" + if fSetTextBox ( RangeFor , "B17:E17" ) > 0 then + warnlog "Something went wrong setting Text." + endif + printlog "Change to Chart Elements tab-page by clicking the Next-button" + Kontext "ChartWizard" + GoNext.Click + Kontext "TabChartTypeChartElements" + printlog "Set 'Title' text box to MyTitle" + if fSetTextBox ( Title , "MyTitle" ) > 0 then + warnlog "Something went wrong setting Text." + endif + printlog "Set 'Subtitle' text box to 1 2 3" + if fSetTextBox ( Subtitle , "1 2 3" ) > 0 then + warnlog "Something went wrong setting Text." + endif + printlog "Set 'X Title' text box to Grått" + if fSetTextBox ( TitleXAxis , "Grått" ) > 0 then + warnlog "Something went wrong setting Text." + endif + printlog "Set 'Y Title' text box to Gräulich" + if fSetTextBox ( TitleYAxis , "Gräulich" ) > 0 then + warnlog "Something went wrong setting Text." + endif + printlog "Set 'Z Title' text box to 灰色" + if fSetTextBox ( TitleZAxis , "灰色" ) > 0 then + warnlog "Something went wrong setting Text." + endif + printlog "Check X Axis-checkbox" + if fSetCheckBox ( GridLinesXAxis , TRUE ) > 0 then + warnlog "Something went wrong checking 'X Axis'." + endif + printlog "Uncheck Y Axis-checkbox" + if fSetCheckBox ( GridLinesYAxis , FALSE ) > 0 then + warnlog "Something went wrong unchecking 'Y Axis'." + endif + printlog "heck Z Axis-checkbox" + if fSetCheckBox ( GridLinesZAxis , TRUE ) > 0 then + warnlog "Something went wrong checking 'Z Axis'." + endif + printlog "Select under Legend (on the right) the Left radio-button" + if fSetRadioButton ( PositionLeft ) > 0 then + warnlog "Something went wrong selecting 'Legend Display Left'." + endif + printlog "Click the Finish-button" + Kontext "ChartWizard" + ChartWizard.OK + sleep(2) + printlog "File / Save" + FileSave + Kontext "DocumentCalc" + printlog "Press ESCAPE button (deselecting the OLE object)" + DocumentCalc.TypeKeys "<Escape>" + printlog "Close the document" + Call hCloseDocument + sleep(2) + printlog "Open saved file again" + call hFileOpen(sOutputFile) + sleep(2) + printlog "Select chart OLE using navigator" + call fSelectFirstOLE + printlog "Edit / Object / Edit to enter inplace mode of the chart" + printlog "(enabling the chart menus and editing possibilities)" + EditObjectEdit + printlog "Format / Chart Type" + FormatChartType + sleep(1) + Kontext "ChartType" + printlog "Check if chart type is 'bar'" + if ChooseType.GetSelIndex <> 2 Then + warnlog "Selected chart type (bar) wasn't preserved after save and reload." + endif + printlog "Check that variant is 'stacked'" + iChartVariant = variant.GetSelIndex + iChartVariantText = variant.GetSelText(iChartVariant) + printlog "Check that the chart variant is 'Stacked' (2nd entry)" + if iChartVariant <> 2 then + warnlog "Instead of chart variant 'Stacked' (2) the variant " & iChartVariant & "(" & iChartVariantText & ") has been used - FAILED" + end if + printlog "Check the the '3D Look' box is checked" + if NOT Look3D.IsChecked then + warnlog "Check box 3D (enabled) wasn't preserved after save and reload." + endif + printlog "Check that 3D look is 'simple' (=default)" + if Scheme3D.GetSelIndex <> 1 then + warnlog "#i112522# - Default 3D Look ('simple') has not been preserved after save and reload." + endif + printlog "Check that 3D shape 'cone' is selected" + if BarColumnShape.GetSelIndex <> 3 Then + warnlog "3D Shape CONE wasn't preserved after save and reload." + endif + Kontext "ChartType" + printlog "Leave dialog with CANCEL button." + ChartType.CANCEL + printlog "Invoke Format / Data Ranges" + FormatDataRanges + printlog "Goto tab-page Data Range" + printlog "Verify now the made settings in the 'Data Ranges' dialog:" + Kontext + Active.SetPage TabFormatDataRangesDataRange + Kontext "TabFormatDataRangesDataRange" + if TabFormatDataRangesDataRange.Exists(2) then + printlog "Check substrings $A$2:$E$13 and $A$17:$E$17 in 'Data Range'" + sControlString = DataRange.GetText + if instr ( sControlString , "$A$2:$E$13" ) = 0 Then + warnlog "Data range wasn't correctly preserved after save and reload and does not caontain $A$2:$E$13." + endif + if instr ( sControlString , "$A$17:$E$17" ) = 0 Then + warnlog "#i72241# - Data range wasn't correctly preserved after save and reload and does not contain $A$17:$E$17." + endif + printlog "Check that radio button 'rows' is checked" + if NOT Rows.IsChecked then + warnlog "Radio Button ROWS (enabled) wasn't preserved after save and reload." + endif + printlog "Check that radio button 'columns is unchecked." + if Columns.IsChecked then + warnlog "Radio Button COLUMNS (disabled) wasn't preserved after save and reload." + endif + printlog "Check if 'First row as label' checkbox is unchecked" + if FirstRowAsLabel.IsChecked then + warnlog "Check box 'First row as label' (disabled) wasn't preserved after save and reload." + endif + printlog "Check that 'First column as label' checkbox is checked." + if NOT FirstColumnAsLabel.IsChecked then + warnlog "#i72241# - Check box 'First column as label' (enabled) wasn't preserved after save and reload." + endif + else + warnlog "Tab page 'Data Range' not visible!" + end if + printlog "Go to tab page 'Data Series'" + Kontext + Active.SetPage TabFormatDataRangesDataSeries + Kontext "TabFormatDataRangesDataSeries" + if TabFormatDataRangesDataSeries.Exists(2) then + printlog "Check if added range (13 in list on the left) was preserved." + if fSetListBoxByItem ( DataSeries , 13 ) > 0 then + warnlog "Selecting 13th item in Data Series seems to fail. Added range wasn't preserved." + else + printlog "Select 'Name'-entry in Data Ranges list on the right." + if fSetListBoxByItem ( DataRanges , 1 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 1." + else + printlog "Check that the string $A$17 exists in range for 'Name'" + sControlString = RangeFor.GetText + printlog "'Range for name' is: " & sControlString + if instr ( sControlString , "$A$17" ) = 0 Then + warnlog "#i72241# - 'Range for name' wasn't correctly preserved after save and reload." + else + printlog "Select 'Y-Values' in Data Ranges list on the right." + if fSetListBoxByItem ( DataRanges , 2 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 2." + else + printlog "Check that the string $B$17:$E$17 is in range for 'Y-Values'" + sControlString = RangeFor.GetText + if instr ( sControlString , "$B$17:$E$17" ) = 0 Then + warnlog "'Range for Y-Values' wasn't correctly preserved after save and reload." + endif + endif + endif + endif + endif + printlog "Close the dialog with 'cancel'-button" + TabFormatDataRangesDataSeries.Cancel + else + warnlog "Tab page 'Data series' not visible!" + end if + if fInvokeTitlesDialog() = 0 then + printlog "Insert / Title" + printlog "Verify now the made settings in the 'Titles' dialog:" + Kontext "InsertTitleDialog" + printlog "Check that 'Title' text field contains 'MyTitle'" + sControlString = MainTitle.GetText + if sControlString <> "MyTitle" then + warnlog "Title string 'MyTitle' wasn't preserved after save and reload." + endif + printlog "Check that 'Subtitle'text field contains 1 2 3" + sControlString = SubTitle.GetText + if sControlString <> "1 2 3" then + warnlog "Subtitle string '1 2 3' wasn't preserved after save and reload." + endif + printlog "Check that 'X Title' text field contains Grått" + sControlString = TitleXAxis.GetText + printlog "'X Title' is: " & sControlString + if sControlString <> "Grått" then + warnlog "X Title string 'Grått' wasn't preserved after save and reload." + endif + printlog "Check that 'Y Title' text field contains 'Gräulich'" + sControlString = TitleYAxis.GetText + if sControlString <> "Gräulich" then + warnlog "Y Title string 'Gräulich' wasn't preserved after save and reload." + endif + printlog "Check that 'Z Title' text field contains 灰色" + sControlString = TitleZAxis.GetText + printlog "'Z Title' is: " & sControlString + if sControlString <> "灰色" then + warnlog "Z Title string '灰色' wasn't preserved after save and reload." + endif + printlog "Close the Title-dialog by pressing 'Cancel'-button" + InsertTitleDialog.Cancel + endif + if fInvokeGridsDialog() = 0 then + printlog "Insert / Grid" + Kontext "InsertGridsDialog" + printlog "Check that 'Main Grid X Axis' checkbox is checked" + if NOT MainGridXaxis.IsChecked then + warnlog "Check box 'Gridlines X Axis' (checked) wasn't preserved after save and reload." + endif + printlog "Check that 'Main Grid Y Axis' checkbox is checked" + if MainGridYaxis.IsChecked then + warnlog "Check box 'Gridlines Y Axis' (unchecked) wasn't preserved after save and reload." + endif + printlog "Check that 'Main Grid Z Axis' checkbox is checked" + if NOT MainGridZaxis.IsChecked then + warnlog "Check box 'Gridlines Z Axis' (checked) wasn't preserved after save and reload." + endif + printlog "Check that 'Minor Grid X Axis' checkbox is unchecked" + if MinorGridXaxis.IsChecked then + warnlog "Check box 'Minor Grid X Axis' (unchecked) wasn't preserved after save and reload." + endif + printlog "Check that 'Minor Grid Y Axis' checkbox is unchecked" + if MinorGridYaxis.IsChecked then + warnlog "Check box 'Minor Grid Y Axis' (unchecked) wasn't preserved after save and reload." + endif + printlog "Check that 'Minor Grid Z Axis' checkbox is unchecked" + if MinorGridZaxis.IsChecked then + warnlog "Check box 'Minor Grid Z Axis' (unchecked) wasn't preserved after save and reload." + endif + printlog "Leave dialog with Cancel-button." + InsertGridsDialog.Cancel + endif + if fInvokeLegendDialog() = 0 then + printlog "Insert / Legend" + Kontext "InsertLegendDialog" + printlog "Check that 'Legend Display' checkbox is checked" + if NOT Display.IsChecked then + warnlog "Check box 'Legend Display' (enabled) wasn't preserved after save and reload." + endif + printlog "Check that 'Left' radio button is selected" + if NOT PositionLeft.IsChecked then + warnlog "Radio button 'Left' (enabled) wasn't preserved after save and reload." + endif + printlog "Cancel InsertLegend-dialog" + Kontext "InsertLegendDialog" + InsertLegendDialog.Cancel + end if + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "<Escape>" + printlog "Close document" + Call hCloseDocument +endcase +' +'-------------------------------------------------------------------- +' +testcase tCreateNewLineChart + dim sInputFile as STRING + dim sOutputFile as STRING + dim sControlString as STRING + sInputFile = convertpath ( gTesttoolPath & "chart2/optional/input/randomData.ods" ) + sOutputFile = convertpath ( gOfficepath & "user/work/tCreateNewLineChart.ods" ) + printlog "File / Load TesttoolPath/chart2/optional/input/randomData.ods" + call hFileOpen(sInputFile) + sleep(2) + printlog "Save document as Officepath/user/work/tCreateNewLineChart.ods" + if NOT hFileSaveAsWithFilterKill ( sOutputFile , "calc8" ) then + warnlog "Saving test document localy failed -> Aborting" + call hCloseDocument + goto endsub + endif + printlog "Insert / Chart" + InsertChart + printlog "Change Chart type to LINE (5th entry from the top)" + Kontext "ChartType" + if NOT ChartType.Exists(5) then + warnlog "Chart Wizard was not visible. EXITING!" + goto endsub + else + printlog "Chart Wizard visible." + end if + if fSetChartType ( "line" ) > 0 then + warnlog "Something went wrong setting chart type to LINE." + endif + printlog "Select 3rd Change chart type variant (lines only)" + if fSetChartTypeVariant ( 3 ) > 0 then + warnlog "Something went wrong setting chart type to 3rd variant (lines only)." + endif + printlog "Enable 'Stack Series' and select 'Percent'" + if fSetStackSeries ( "percent" ) > 0 then + warnlog "Something went wrong setting Stack Series to Percent." + endif + '/// Enable 'Smooth Lines' + printlog "Enable 'Smooth Lines'" + if fSetSmoothLines ( TRUE ) > 0 then + warnlog "Something went wrong enabling Smooth Lines." + endif + printlog "Invoke 'Smooth Lines' dialog" + if fInvokeSmoothLineProperties() > 0 then + warnlog "Something went wrong invoking Smooth Lines Dialog." + endif + printlog "Check B-Spline" + BSpline.check + printlog "Set Resolution to 33" + Resolution.SetText "33" + printlog "et Data Points Order to 5" + DataPointsOrder.SetText "5" + printlog "Close 'Smooth Lines' dialog" + if fCloseSmoothLinePropertiesOK() > 0 then + warnlog "Something went wrong closing Smooth Lines Dialog." + endif + printlog "Change to Data Range tab-page" + Kontext "ChartWizard" + GoNext.Click + Kontext "TabChartTypeDataRange" + printlog "Set Data Range text box to $Sheet1.$A$1:$F$13;$Sheet1.$A$17:$F$17" + if fSetTextBox ( DataRange , "$Sheet1.$A$1:$F$13;$Sheet1.$A$17:$F$17" ) > 0 then + warnlog "Something went wrong setting Text." + endif + printlog "Change to Data Series tab-page" + Kontext "ChartWizard" + GoNext.Click + Kontext "TabChartTypeDataSeries" + printlog "Select 3rd entry in Data Series" + if fSetListBoxByItem ( DataSeries , 3 ) > 0 then + warnlog "Something went wrong selecting 'Data Series' item No. 3." + endif + printlog "Remove series labeled 'John'" + RemoveButton.Click + printlog "Select 4th entry in Data Series" + if fSetListBoxByItem ( DataSeries , 4 ) > 0 then + warnlog "Something went wrong selecting 'Data Series' item No. 4." + endif + printlog "Select 2nd entry in Data Ranges" + if fSetListBoxByItem ( DataRanges , 2 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 2." + endif + printlog "Set 'Range for Y-Values' text box to $Sheet1.$F$2:$F$13;$Sheet1.$D$17" + if fSetTextBox ( RangeFor , "$Sheet1.$F$2:$F$13;$Sheet1.$D$17" ) > 0 then + warnlog "Something went wrong setting Text." + endif + printlog "Set 'Categories' text box to $Sheet1.$A$2:$A$13;$Sheet1.$A$1" + if fSetTextBox ( Categories , "$Sheet1.$A$2:$A$13;$Sheet1.$A$19" ) > 0 then + warnlog "Something went wrong setting Text." + endif + printlog "Change to Chart Elements tab-page" + Kontext "ChartWizard" + GoNext.Click + Kontext "TabChartTypeChartElements" + printlog "Uncheck 'Y Axis'" + if fSetCheckBox ( GridLinesYAxis , FALSE ) > 0 then + warnlog "Something went wrong unselecting 'Y Axis'." + endif + printlog "Uncheck 'Legend Display'" + if fSetCheckBox ( Display , FALSE ) > 0 then + warnlog "Something went wrong unselecting 'Legend Display'." + endif + printlog "Create Chart by clicking Finish-button" + Kontext "ChartWizard" + ChartWizard.OK + sleep(2) + printlog "File / Save" + FileSave + Kontext "DocumentCalc" + printlog "Press twice <ESCAPE>-key" + DocumentCalc.TypeKeys "<Escape>" , 2 + printlog "File / Close document" + Call hCloseDocument + sleep(2) + printlog "Open saved file again" + call hFileOpen(sOutputFile) + sleep(2) + printlog "Open the Navigator (F5)" + printlog "Select the first OLE object in the Navigator" + call fSelectFirstOLE + printlog "Edit / Object / Edit to enter Inplace Mode" + EditObjectEdit + printlog "Format / Chart Type" + FormatChartType + Kontext "ChartType" + if ChartType.Exists(2) then + printlog "Check if chart type is LINE" + if ChooseType.GetSelIndex <> 5 then + warnlog "Selected chart type wasn't preserved after save and reload." + endif + printlog "Check if chart variant is LINES ONLY (third variant in non-CTL versions from the left)" + if Variant.GetSelIndex <> 3 then + warnlog "Selected chart type variant wasn't preserved after save and reload." + end if + printlog "Check if 'Stack Series' box is checked" + if NOT StackSeries.IsChecked then + warnlog "Check box 'Stack Series' (enabled) wasn't preserved after save and reload." + endif + printlog "Check if 'Percent' radio button is checked" + if NOT Percent.IsChecked then + warnlog "Radio button box 'Percent' (enabled) wasn't preserved after save and reload." + endif + printlog "Check if 'Smooth Lines' box is checked" + if NOT SmoothLines.IsChecked then + warnlog "Check box 'Smooth Lines' (enabled) wasn't preserved after save and reload." + endif + printlog "Invoke 'Smooth Lines' dialog" + if fInvokeSmoothLineProperties() > 0 then + warnlog "Something went wrong invoking Smooth Lines dialog." + endif + printlog "Check if 'B-Spline' radio button is checked" + if NOT BSpline.IsChecked then + warnlog "Radio button box 'B-Spline' (enabled) wasn't preserved after save and reload." + endif + printlog "Check if 'Resolution' has value '33'" + if Resolution.GetText <> "33" then + warnlog "Value for Resolution '33' wasn't preserved after save and reload." + endif + printlog "Check if 'Data Points Order' has value '5'" + if DataPointsOrder.GetText <> "5" then + warnlog "Value for Data Points Order '5' wasn't preserved after save and reload." + endif + printlog "Close 'Smooth Lines' dialog" + if fCloseSmoothLinePropertiesOK() > 0 then + warnlog "Something went wrong closing Smooth Lines Dialog." + endif + printlog "Leave Chart Type dialog with Cancel" + Kontext "ChartType" + if ChartType.Exists(2) then + ChartType.Cancel + else + warnlog "ChartType dialog was not visible!?" + end if + else + warnlog "Chart Type dialog was not up!" + end if + printlog "Format / Data Ranges" + FormatDataRanges + printlog "Switch to tab page Data Series" + Kontext + Active.SetPage TabFormatDataRangesDataRange 'Due to bug #i77237# the tabpage has to be switched once before 'OK' or 'Cancel' can be used + Active.SetPage TabFormatDataRangesDataSeries + Kontext "TabChartTypeDataSeries" + if TabChartTypeDataSeries.Exists(2) then + printlog "Verify that there are 4 data series" + if DataSeries.GetItemCount <> 4 then + warnlog "There should be 4 dataseries, but there are " & DataSeries.GetItemCount + end if + printlog "Select 4th entry in Data Series" + if fSetListBoxByItem ( DataSeries , 4 ) > 0 then + warnlog "Selecting 4th item in Data Series failed. EXITING!" + TabChartTypeDataSeries.Cancel + call hCloseDocument + goto endsub + endif + printlog "Select Name in Data Ranges" + if fSetListBoxByItem ( DataRanges , 1 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 1." + endif + printlog "Check substring '$F$1' in Range for Name" + sControlString = RangeFor.GetText + printlog "'Range for name' is: " & sControlString + if instr ( sControlString , "$F$1" ) = 0 Then + warnlog "'Range for name' wasn't correctly preserved after save and reload." + endif + printlog "Select Y-Values in Data Ranges" + if fSetListBoxByItem ( DataRanges , 2 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 2. EXITING!" + TabChartTypeDataSeries.Cancel + call hCloseDocument + goto endsub + endif + printlog "Check substring '$F$2:$F$13' and '$D$17'in Range for Name" + sControlString = RangeFor.GetText + if instr ( sControlString , "$F$2:$F$13" ) = 0 Then + warnlog "'Range for Y-Values' wasn't correctly preserved after save and reload." + endif + if instr ( sControlString , "$D$17" ) = 0 Then + warnlog "'Range for Y-Values' wasn't correctly preserved after save and reload." + endif + printlog "Check substring '$A$2:$A$13' and '$A$19'in Categories" + sControlString = Categories.GetText + if instr ( sControlString , "$A$2:$A$13" ) = 0 Then + warnlog "'Categories' wasn't correctly preserved after save and reload." + endif + if instr ( sControlString , "$A$19" ) = 0 Then + warnlog "'Categories' wasn't correctly preserved after save and reload." + endif + printlog "Leave tab page data series with CANCEL" + TabChartTypeDataSeries.Cancel + else + warnlog "Tab page Data Series was not up!" + end if + printlog "Insert / Title" + InsertTitle + Kontext "InsertTitleDialog" + if InsertTitleDialog.Exists(2) then + printlog "Check if 'Title' text box is empty" + sControlString = MainTitle.GetText + if sControlString <> "" then + warnlog "Empty Title string wasn't preserved after save and reload." + endif + printlog "Check if 'Subtitle' text box is empty" + sControlString = SubTitle.GetText + if sControlString <> "" then + warnlog "Empty Subtitle string wasn't preserved after save and reload." + endif + printlog "Check if 'X Title' text box is empty" + sControlString = TitleXaxis.GetText + if sControlString <> "" then + warnlog "Empty X Title string wasn't preserved after save and reload." + endif + printlog "Check if 'Y Title' text box is empty" + sControlString = TitleYaxis.GetText + if sControlString <> "" then + warnlog "Empty Y Title string wasn't preserved after save and reload." + endif + printlog "Check if 'Z Title' text box is empty" + sControlString = TitleZaxis.GetText + if sControlString <> "" then + warnlog "Empty Z Title string wasn't preserved after save and reload." + endif + printlog "Leaving Title dialog with Cancel" + InsertTitleDialog.Cancel + else + warnlog "Title dialog was not up!" + end if + printlog "Insert / Grids" + If fInvokeGridsDialog = 0 then + Kontext "InsertGridsDialog" + printlog "Check if 'Gridlines X Axis' box is checked" + if MainGridXaxis.IsChecked then + warnlog "Check box 'Gridlines X Axis' (disabled) wasn't preserved after save and reload." + endif + printlog "Check if 'Gridlines Y Axis' box is unchecked" + if MainGridYaxis.IsChecked then + warnlog "Check box 'Gridlines Y Axis' (disabled) wasn't preserved after save and reload." + endif + printlog "Check if 'Gridlines Z Axis' box is checked" + if MainGridZaxis.IsEnabled then + warnlog "Check box 'Gridlines Z Axis' shouldn't be enabled after save and reload." + endif + printlog "Leave dialog with CANCEL" + InsertGridsDialog.Cancel + else + warnlog "Insert Grids dialog was not up!" + end if + printlog "Insert / Legend" + if fInvokeLegendDialog() = 0 then + printlog "Check if 'Legend Display' box is checked" + Kontext "InsertLegendDialog" + if Display.IsChecked then + warnlog "Check box 'Legend Display' (disabled) wasn't preserved after save and reload." + endif + printlog "Leave dialog with CANCEL." + InsertLegendDialog.Cancel + else + warnlog "Insert Legend dialog was not up!" + end if + printlog "Press ESCAPE button (deselecting the OLE object)" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "<Escape>" + printlog "Close document" + Call hCloseDocument +endcase +' +'-------------------------------------------------------------------- +' +testcase tCreateNewBubbleChart + dim sInputFile as STRING + dim sOutputFile as STRING + dim sControlString as STRING + sInputFile = convertpath ( gTesttoolPath & "chart2/optional/input/BubbleChartData.ods" ) + sOutputFile = convertpath ( gOfficepath & "user/work/tCreateNewBubbleChart.ods" ) + printlog "File / Load TesttoolPath/chart2/optional/input/BubbleChartData.ods" + call hFileOpen(sInputFile) + sleep(2) + printlog "Save document as Officepath/user/work/tCreateNewBubbleChart.ods" + if NOT hFileSaveAsWithFilterKill ( sOutputFile , "calc8" ) then + warnlog "Saving test document localy failed -> Aborting" + call hCloseDocument + goto endsub + endif + printlog "Insert / Chart" + InsertChart + printlog "Change Chart type to BUBBLE (7th entry from the top)" + Kontext "ChartType" + if NOT ChartType.Exists(5) then + warnlog "Chart Wizard was not visible. EXITING!" + goto endsub + else + printlog "Chart Wizard visible." + end if + if fSetChartType ( "bubble" ) > 0 then + warnlog "Something went wrong setting chart type to Bubble Chart." + endif + printlog "Select 1st chart type variant (Bubble Chart)" + if fSetChartTypeVariant ( 1 ) > 0 then + warnlog "Something went wrong setting chart type to 1st variant (Bubble Chart)." + endif + printlog "Change to Data Range tab-page" + Kontext "ChartWizard" + GoNext.Click + Kontext "TabChartTypeDataRange" + printlog "Set Data Range text box to $Sheet1.$A$2:$C$5;$Sheet1.$A$13:$C$16" + if fSetTextBox ( DataRange , "$Sheet1.$A$2:$C$5;$Sheet1.$A$13:$C$16" ) > 0 then + warnlog "Something went wrong setting Text." + endif + printlog "Change to Data Series tab-page" + Kontext "ChartWizard" + GoNext.Click + Kontext "TabChartTypeDataSeries" + '### Name ### + printlog "Select 1st entry in Data Series" + if fSetListBoxByItem ( DataSeries , 1 ) > 0 then + warnlog "Something went wrong selecting 'Data Series' item No. 1." + endif + printlog "Select 1st entry in Data Ranges" + if fSetListBoxByItem ( DataRanges , 1 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 1." + endif + printlog "Set 'Range for Name' text box to $Sheet1.$C$1" + if fSetTextBox ( RangeFor , "$Sheet1.$C$1" ) > 0 then + warnlog "Something went wrong setting Text." + endif + '### Bubble Sizes ### + printlog "Select 2nd entry in Data Ranges" + if fSetListBoxByItem ( DataRanges , 2 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 2." + endif + printlog "Set 'Range for Bubble Sizes' text box to $Sheet1.$C$2:$C$5" + if fSetTextBox ( RangeFor , "$Sheet1.$C$2:$C$5" ) > 0 then + warnlog "Something went wrong setting Text." + endif + '### X-Values ### + printlog "Select 3rd entry in Data Ranges" + if fSetListBoxByItem ( DataRanges , 3 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 3." + endif + printlog "Set 'X-Values' text box to $Sheet1.$A$2:$A$5" + if fSetTextBox ( RangeFor , "$Sheet1.$A$2:$A$5" ) > 0 then + warnlog "Something went wrong setting Text." + endif + '### Y-Values ### + printlog "Select 4th entry in Data Ranges" + if fSetListBoxByItem ( DataRanges , 4 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 4." + endif + printlog "Set 'Y-Values' text box to $Sheet1.$B$2:$B$5" + if fSetTextBox ( RangeFor , "$Sheet1.$B$2:$B$5" ) > 0 then + warnlog "Something went wrong setting Text." + endif + printlog "Add data series" + AddButton.Click + '### Name ### + printlog "Select 1st entry in Data Ranges" + if fSetListBoxByItem ( DataRanges , 1 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 2." + endif + printlog "Set 'Range for Name' text box to $Sheet1.$C$12" + if fSetTextBox ( RangeFor , "$Sheet1.$C$12" ) > 0 then + warnlog "Something went wrong setting Text." + endif + '### Bubble Sizes ### + printlog "Select 2nd entry in Data Ranges" + if fSetListBoxByItem ( DataRanges , 2 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 2." + endif + printlog "Set 'Range for Bubble Sizes' text box to $Sheet1.$C$13:$C$16" + if fSetTextBox ( RangeFor , "$Sheet1.$C$13:$C$16" ) > 0 then + warnlog "Something went wrong setting Text." + endif + '### X-Values ### + printlog "Select 3rd entry in Data Ranges" + if fSetListBoxByItem ( DataRanges , 3 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 3." + endif + printlog "Set 'X-Values' text box to $Sheet1.$A$13:$A$16" + if fSetTextBox ( RangeFor , "$Sheet1.$A$13:$A$16" ) > 0 then + warnlog "Something went wrong setting Text." + endif + '### Y-Values ### + printlog "Select 4th entry in Data Ranges" + if fSetListBoxByItem ( DataRanges , 4 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 4." + endif + printlog "Set 'Y-Values' text box to $Sheet1.$B$13:$B$16" + if fSetTextBox ( RangeFor , "$Sheet1.$B$13:$B$16" ) > 0 then + warnlog "Something went wrong setting Text." + endif + + printlog "Change to Chart Elements tab-page" + Kontext "ChartWizard" + GoNext.Click + Kontext "TabChartTypeChartElements" + printlog "Uncheck 'Y Axis'" + if fSetCheckBox ( GridLinesYAxis , FALSE ) > 0 then + warnlog "Something went wrong unselecting 'Y Axis'." + endif + printlog "Uncheck 'Legend Display'" + if fSetCheckBox ( Display , FALSE ) > 0 then + warnlog "Something went wrong unselecting 'Legend Display'." + endif + printlog "Create Chart by clicking Finish-button" + Kontext "ChartWizard" + ChartWizard.OK + sleep(2) + printlog "File / Save" + FileSave + Kontext "DocumentCalc" + printlog "Press twice <ESCAPE>-key" + DocumentCalc.TypeKeys "<Escape>" , 2 + printlog "File / Close document" + Call hCloseDocument + sleep(2) + printlog "Open saved file again" + call hFileOpen(sOutputFile) + sleep(2) + printlog "Open the Navigator (F5)" + printlog "Select the first OLE object in the Navigator" + call fSelectFirstOLE + printlog "Edit / Object / Edit to enter Inplace Mode" + EditObjectEdit + printlog "Format / Chart Type" + FormatChartType + Kontext "ChartType" + if ChartType.Exists(2) then + printlog "Check if chart type is BUBBLE CHART" + if ChooseType.GetSelIndex <> 7 then + warnlog "Selected chart type wasn't preserved after save and reload." + endif + printlog "Check if chart variant is BUBBLE CHART (1st variant in non-CTL versions from the left)" + if Variant.GetSelIndex <> 1 then + warnlog "Selected chart type variant wasn't preserved after save and reload." + end if + printlog "Leave Chart Type dialog with Cancel" + Kontext "ChartType" + if ChartType.Exists(2) then + ChartType.Cancel + else + warnlog "ChartType dialog was not visible!?" + end if + else + warnlog "Chart Type dialog was not up!" + end if + printlog "Format / Data Ranges" + FormatDataRanges + Kontext + Active.SetPage TabChartTypeDataRange + Kontext "TabChartTypeDataRange" + if TabChartTypeDataRange.Exists(2) then + printlog "Check substrings '$A$2:$C$5', '$C$1', '$B$13:$C$16', '$C$12' in Data Range" + sControlString = DataRange.GetText + printlog "Data Range is: " & sControlString + if instr ( sControlString , "$A$2:$C$5" ) = 0 Then + warnlog "Data range wasn't correctly preserved after save and reload: $A$2:$C$13" + endif + if instr ( sControlString , "$C$1" ) = 0 Then + warnlog "Data range wasn't correctly preserved after save and reload: $A$19" + endif + if instr ( sControlString , "$B$13:$C$16" ) = 0 Then + QAErrorlog "#i100780#Data range wasn't correctly preserved after save and reload: $B$13:$C$16" + endif + if instr ( sControlString , "$C$12" ) = 0 Then + warnlog "Data range wasn't correctly preserved after save and reload: $E$1:$F$13" + endif + printlog "Check if Radio Button ROWS is checked" + if Rows.IsChecked then + warnlog "Radio Button ROWS (disabled) wasn't preserved after save and reload." + endif + printlog "Check if Radio Button COLUMNS is unchecked" + if NOT Columns.IsChecked then + warnlog "Radio Button COLUMNS (enabled) wasn't preserved after save and reload." + endif + printlog "Check if 'First row as label' box is checked" + if NOT FirstRowAsLabel.IsChecked then + warnlog "Check box 'First row as label' (checked) wasn't preserved after save and reload." + endif + printlog "Check if 'First column as label' box is not checked" + if FirstColumnAsLabel.IsChecked then + warnlog "Check box 'First column as label' (unchecked) wasn't preserved after save and reload." + endif + else + warnlog "Tab page Data Range was not up!" + FormatDataRanges + end if + printlog "Switch to tab page Data Series" + Kontext + Active.SetPage TabFormatDataRangesDataSeries + Kontext "TabChartTypeDataSeries" + if TabChartTypeDataSeries.Exists(2) then + printlog "Select 1st entry in Data Series" + if fSetListBoxByItem ( DataSeries , 1 ) > 0 then + warnlog "Selecting 1st item in Data Series failed. EXITING!" + TabChartTypeDataSeries.Cancel + call hCloseDocument + goto endsub + endif + printlog "Select Name in Data Ranges" + if fSetListBoxByItem ( DataRanges , 1 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 1." + endif + printlog "Check substring '$C$1' in Range for Name" + sControlString = RangeFor.GetText + printlog "'Range for name' is: " & sControlString + if instr ( sControlString , "$C$1" ) = 0 Then + warnlog "'Range for name' wasn't correctly preserved after save and reload." + endif + + printlog "Select Bubble Sizes in Data Ranges" + if fSetListBoxByItem ( DataRanges , 2 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 2. EXITING!" + TabChartTypeDataSeries.Cancel + call hCloseDocument + goto endsub + endif + printlog "Check substring '$C$2:$C$5'in Range for Name" + sControlString = RangeFor.GetText + if instr ( sControlString , "$C$2:$C$5" ) = 0 Then + warnlog "'Range for Bubble Sizes' wasn't correctly preserved after save and reload." + endif + + printlog "Select X-Values in Data Ranges" + if fSetListBoxByItem ( DataRanges , 3 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 3. EXITING!" + TabChartTypeDataSeries.Cancel + call hCloseDocument + goto endsub + endif + printlog "Check substring '$A$2:$A$5' in Range for Name" + sControlString = RangeFor.GetText + if instr ( sControlString , "$A$2:$A$5" ) = 0 Then + warnlog "'Range for X-Values' wasn't correctly preserved after save and reload." + endif + + printlog "Select Y-Values in Data Ranges" + if fSetListBoxByItem ( DataRanges , 4 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 4. EXITING!" + TabChartTypeDataSeries.Cancel + call hCloseDocument + goto endsub + endif + printlog "Check substring '$B$2:$B$5' in Range for Name" + sControlString = RangeFor.GetText + if instr ( sControlString , "$B$2:$B$5" ) = 0 Then + warnlog "'Range for Y-Values' wasn't correctly preserved after save and reload." + endif + + printlog "Select 2nd entry in Data Series" + if fSetListBoxByItem ( DataSeries , 2 ) > 0 then + warnlog "Selecting 1st item in Data Series failed. EXITING!" + TabChartTypeDataSeries.Cancel + call hCloseDocument + goto endsub + endif + printlog "Select Name in Data Ranges" + if fSetListBoxByItem ( DataRanges , 1 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 1." + endif + printlog "Check substring '$C$12' in Range for Name" + sControlString = RangeFor.GetText + printlog "'Range for name' is: " & sControlString + if instr ( sControlString , "$C$12" ) = 0 Then + warnlog "'Range for name' wasn't correctly preserved after save and reload." + endif + + printlog "Select Bubble Sizes in Data Ranges" + if fSetListBoxByItem ( DataRanges , 2 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 2. EXITING!" + TabChartTypeDataSeries.Cancel + call hCloseDocument + goto endsub + endif + printlog "Check substring '$C$13:$C$16'in Range for Name" + sControlString = RangeFor.GetText + if instr ( sControlString , "$C$13:$C$16" ) = 0 Then + warnlog "'Range for Bubble Sizes' wasn't correctly preserved after save and reload." + endif + + printlog "Select X-Values in Data Ranges" + if fSetListBoxByItem ( DataRanges , 3 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 3. EXITING!" + TabChartTypeDataSeries.Cancel + call hCloseDocument + goto endsub + endif + printlog "Check substring '$A$13:$A$16' in Range for Name" + sControlString = RangeFor.GetText + if instr ( sControlString , "$A$13:$A$16" ) = 0 Then + warnlog "'Range for X-Values' wasn't correctly preserved after save and reload." + endif + + printlog "Select Y-Values in Data Ranges" + if fSetListBoxByItem ( DataRanges , 4 ) > 0 then + warnlog "Something went wrong selecting 'Data Ranges' item No. 4. EXITING!" + TabChartTypeDataSeries.Cancel + call hCloseDocument + goto endsub + endif + printlog "Check substring '$B$13:$B$16' in Range for Name" + sControlString = RangeFor.GetText + if instr ( sControlString , "$B$13:$B$16" ) = 0 Then + warnlog "'Range for Y-Values' wasn't correctly preserved after save and reload." + endif + + printlog "Leave tab page data series with CANCEL" + TabChartTypeDataSeries.Cancel + else + warnlog "Tab page Data Series was not up!" + end if + printlog "Insert / Title" + InsertTitle + Kontext "InsertTitleDialog" + if InsertTitleDialog.Exists(2) then + printlog "Check if 'Title' text box is empty" + sControlString = MainTitle.GetText + if sControlString <> "" then + warnlog "Empty Title string wasn't preserved after save and reload." + endif + printlog "Check if 'Subtitle' text box is empty" + sControlString = SubTitle.GetText + if sControlString <> "" then + warnlog "Empty Subtitle string wasn't preserved after save and reload." + endif + printlog "Check if 'X Title' text box is empty" + sControlString = TitleXaxis.GetText + if sControlString <> "" then + warnlog "Empty X Title string wasn't preserved after save and reload." + endif + printlog "Check if 'Y Title' text box is empty" + sControlString = TitleYaxis.GetText + if sControlString <> "" then + warnlog "Empty Y Title string wasn't preserved after save and reload." + endif + printlog "Check if 'Z Title' text box is empty" + sControlString = TitleZaxis.GetText + if sControlString <> "" then + warnlog "Empty Z Title string wasn't preserved after save and reload." + endif + printlog "Leaving Title dialog with Cancel" + InsertTitleDialog.Cancel + else + warnlog "Title dialog was not up!" + end if + printlog "Insert / Grids" + If fInvokeGridsDialog = 0 then + Kontext "InsertGridsDialog" + printlog "Check if 'Gridlines X Axis' box is checked" + if MainGridXaxis.IsChecked then + warnlog "Check box 'Gridlines X Axis' (disabled) wasn't preserved after save and reload." + endif + printlog "Check if 'Gridlines Y Axis' box is unchecked" + if MainGridYaxis.IsChecked then + warnlog "Check box 'Gridlines Y Axis' (disabled) wasn't preserved after save and reload." + endif + printlog "Check if 'Gridlines Z Axis' box is checked" + if MainGridZaxis.IsEnabled then + warnlog "Check box 'Gridlines Z Axis' shouldn't be enabled after save and reload." + endif + printlog "Leave dialog with CANCEL" + InsertGridsDialog.Cancel + else + warnlog "Insert Grids dialog was not up!" + end if + printlog "Insert / Legend" + if fInvokeLegendDialog() = 0 then + printlog "Check if 'Legend Display' box is checked" + Kontext "InsertLegendDialog" + if Display.IsChecked then + warnlog "Check box 'Legend Display' (disabled) wasn't preserved after save and reload." + endif + printlog "Leave dialog with CANCEL." + InsertLegendDialog.Cancel + else + warnlog "Insert Legend dialog was not up!" + end if + printlog "Press ESCAPE button (deselecting the OLE object)" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "<Escape>" + printlog "Close document" + Call hCloseDocument +endcase + + diff --git a/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard2.inc b/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard2.inc new file mode 100644 index 000000000000..a89e8fad80d8 --- /dev/null +++ b/testautomation/chart2/optional/includes/wizard/ch2_lvl1_wizard2.inc @@ -0,0 +1,124 @@ +'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 : New chart types +'* +'************************************************************************ +'* +' #1 tCreateNewFilledNetChart ' Create a new filled netchart and check the preserved values +'* +'\************************************************************************ + +testcase tCreateNewFilledNetChart + Dim sInputFile as STRING + Dim sOutputFile as STRING + Dim sControlString as STRING + Dim iChartVariant as integer + Dim iChartVariantText as string + + + sInputFile = convertpath ( gTesttoolPath & "chart2/optional/input/randomData.ods" ) + sOutputFile = convertpath ( gOfficePath & "user/work/tCreateNewFilledChart.ods" ) + + + printlog "Load test document TesttoolPath/chart2/optional/input/randomData.ods" + call hFileOpen(sInputFile) + sleep(2) + printlog "Save document as OfficePath/user/work/tCreateNewFilledNetChart.ods" + if NOT hFileSaveAsWithFilterKill ( sOutputFile , "calc8" ) then + warnlog "Saving test document localy failed -> Aborting" + call hCloseDocument + goto endsub + endif + printlog "Insert / Chart" + InsertChart + sleep(5) + Kontext "ChartType" + if NOT ChartType.Exists(5) then + warnlog "Chart Wizard was not visible. EXITING!" + goto endsub + else + printlog "Chart Wizard visible." + end if + printlog "Choose the Chart type net (should be the eights in the top-down list)" + if fSetChartType( "net" ) > 0 then + warnlog "Something went wrong setting chart type to BAR." + endif + printlog "Select 4th chart variant from left (filled)" + if fSetChartTypeVariant( 4 ) > 0 then + warnlog "Something went wrong setting chart type VARIANT." + endif + printlog "Create Chart by clicking Finish-button" + Kontext "ChartWizard" + ChartWizard.OK + sleep(2) + printlog "File / Save" + FileSave + Kontext "DocumentCalc" + printlog "Press twice <ESCAPE>-key" + DocumentCalc.TypeKeys "<Escape>" , 2 + printlog "File / Close document" + Call hCloseDocument + sleep(2) + printlog "Open saved file again" + call hFileOpen(sOutputFile) + sleep(2) + printlog "Open the Navigator (F5)" + printlog "Select the first OLE object in the Navigator" + call fSelectFirstOLE + printlog "Edit / Object / Edit to enter Inplace Mode" + EditObjectEdit + printlog "Format / Chart Type" + FormatChartType + Kontext "ChartType" + if ChartType.Exists(2) then + printlog "Check if chart type is NET CHART" + if ChooseType.GetSelIndex <> 8 then + warnlog "Selected chart type wasn't preserved after save and reload." + endif + printlog "Check if chart variant is Filled Net CHART (4th variant in non-CTL versions from the left)" + if Variant.GetSelIndex <> 4 then + warnlog "Selected chart type variant wasn't preserved after save and reload." + end if + printlog "Leave Chart Type dialog with Cancel" + Kontext "ChartType" + if ChartType.Exists(2) then + ChartType.Cancel + else + warnlog "ChartType dialog was not visible!?" + end if + else + warnlog "Chart Type dialog was not up!" + end if + printlog "Press ESCAPE button (deselecting the OLE object)" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "<Escape>" + printlog "Close document" + Call hCloseDocument +endcase |