diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-09-17 10:45:27 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-09-17 10:45:27 +0000 |
commit | 7ced687273e1d0439c240f7f5776928f2121931a (patch) | |
tree | 99fe9f8cad5aed5d45fa90ae6612b8801dc0f516 /testautomation/chart2/optional | |
parent | b88e5cbaee8fc57a3eacb64f70e3d92fbae866c0 (diff) |
CWS-TOOLING: integrate CWS jskhgpilot3
2009-09-10 skotti Branch merge - cws automationdev300m57cat0 into this one
2009-09-10 skotti #i104919 - stripped comments
2009-09-09 tb121644 #i104895# split options test into 2 files one for first.bas and the other for X_updt.bas'es
2009-09-09 tb121644 #i100286# add HElpId HID_OPTIONS_JAVA_LIST
2009-09-08 tb121644 #i103219 CB_KEEP_LIST -> CB_REMOVE_LIST; clean hid.lst
2009-09-08 tb121644 #i103219 revert of revert of change; clean hid.lst
2009-09-10 skotti Imported changes from CWS jskhgpilot2, they are needed
2009-09-09 skotti Merged jskhgpilot3 into this clone
2009-09-06 skotti Branch merge
2009-09-04 skotti #i104201# - Use hardware acceleration is now available on Windws. Sometimes
2009-09-04 skotti #i104201# - Use hardware acceleration is now available on Windws. Sometimes
2009-09-04 skotti #i104201# - Use hardware acceleration is now available on Windws. Sometimes
2009-09-02 skotti #i104201# - Warnlog to QAErrorlog
2009-09-02 skotti #i104487# - Supply warnlog
2009-09-01 skotti #i104201 - Switch off verbosity
2009-09-01 skotti #i104201 - More minor fixes, finally also solved the Hyperlink issue
2009-09-01 skotti Minor fixes
2009-08-31 skotti #i104201# - typo. Gargel
2009-08-31 skotti #i104201# - on some systems we just dont have antialiasing
2009-08-31 skotti #i104457# Disable verbosity in t_tools1.inc
2009-08-31 skotti #i104201# - Simplified test case with more hard coded numbers and fixed incorrect itemcount for StarOffice (which caused the tOOoColors test to fail)
2009-08-28 skotti Rebase
2009-08-28 skotti #i104487# - Attempt to fix hyperlink dialog
2009-08-25 skotti #i104487# Added WaitSlot() which appears to solve the problem on Windows
2009-08-25 skotti Merge von cws jskhgpilot2
2009-07-31 skotti #i96753 - added just another 500ms wait - sad, that is
2009-07-31 skotti #i96753 - cleanup, documentation
2009-07-31 skotti #i96753 - fix
2009-07-31 skotti #i96753 - OK, another approach for testing on different hardware...
2009-07-31 skotti #i96753 - small adjustments, back to .click() method
2009-07-29 skotti #i96753 - invented new dynamic function to deal with the menubutton which - as a nice sideefect allows to disable all sleep() statements within the test. This is good for -330 seconds of sleeping and in combination with a few optimizations makes the test run less than 20 minutes, about 8 minutes faster than before
2009-07-28 skotti #i96753 - use MenuBtn.OpenMenu() instead of .click() as this appears to work better and is used in other places successfully as well
2009-07-28 skotti #i103065 - fileopen dialog shows Mercurial and SVN directories which must be skipped
2009-07-28 skotti #i103065 - Added mercurial hidden directory to the excludes list in global routine
2009-07-28 skotti Rebase oder so...
2009-07-28 skotti #i96753 - insert wait statements
2009-09-09 skotti #i104919# - Add a WaitSlot() to gain stability on slow systems
2009-09-09 skotti #i104910# - Changed Accelerator from ALT+o to ALT+n for german localization
2009-09-08 skotti #i104887# - Moved files from required to optional including inc-files. Updated paths and moved non-project files to LoadIncludeFiles section
Diffstat (limited to 'testautomation/chart2/optional')
4 files changed, 1740 insertions, 0 deletions
diff --git a/testautomation/chart2/optional/ch2_chart_data_dlg_impress.bas b/testautomation/chart2/optional/ch2_chart_data_dlg_impress.bas new file mode 100644 index 000000000000..6f27a7a6e4d9 --- /dev/null +++ b/testautomation/chart2/optional/ch2_chart_data_dlg_impress.bas @@ -0,0 +1,62 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: ch2_chart_data_dlg_impress.bas,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-13 14:27:01 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : oliver.craemer@sun.com +'* +'* short description : Resource Test for the Chart Data Dialogue in Impress. +'* +'\************************************************************************************************ + +sub main + use "chart2\optional\includes\ch2_datadialogue.inc" + + Call hStatusIn("Chart2", "ch2_chart_data_dlg_impress.bas") + printlog "--------------------------------------------" + printlog "C h a r t D a t a D i a l o g Updatetest" + printlog "--------------------------------------------" + + printLog "----------- tChartDataDialogue -----------" + call tChartDataDialogueButtons + call tChartDataDialogueFieldsUndo + Call hStatusOut +end sub +' +'------------------------------------------------------------------------------- +' +sub LoadIncludeFiles + use "global\system\includes\master.inc" + use "global\system\includes\gvariabl.inc" + Call GetUseFiles + gApplication = "IMPRESS" +end sub + diff --git a/testautomation/chart2/optional/ch2_flexible_source_range_selection.bas b/testautomation/chart2/optional/ch2_flexible_source_range_selection.bas new file mode 100644 index 000000000000..d3db18d82355 --- /dev/null +++ b/testautomation/chart2/optional/ch2_flexible_source_range_selection.bas @@ -0,0 +1,75 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: ch2_flexible_source_range_selection.bas,v $ +'* +'* $Revision: 1.1 $ +'* +'* last change: $Author: jsi $ $Date: 2008-06-13 14:27:01 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/*********************************************************************** +'* +'* owner : oliver.craemer@sun.com +'* +'* short description : Updatetest for Flexible Source Range Selection +'* +'\*********************************************************************** + +sub main + + use "chart2\optional\includes\ch2_flexible_source_range_selection.inc" + use "chart2\optional\includes\ch2_flexible_source_range_selection01.inc" + + Call hStatusIn("Chart2", "ch2_flexible_source_range_selection.bas") + printlog "----------------------------------------------" + printlog "Updatetest for Flexible Source Range Selection" + printlog "----------------------------------------------" + printlog "------------ Chart in Spreadsheet ------------" + gApplication = "CALC" + Call tDataRangeWizardCalc + Call tDataSeriesWizardCalc + Call tDataRangeDialogCalc + Call tDataSeriesDialogCalc + printlog "-------------- Chart in Writer ---------------" + gApplication = "WRITER" + Call tDataRangeWizardWriter + Call tDataSeriesWizardWriter + Call tDataRangeDialogWriter + Call tDataSeriesDialogWriter + Call hStatusOut +end sub +' +'------------------------------------------------------------------------------- +' +sub LoadIncludeFiles + use "global\system\includes\master.inc" + use "global\system\includes\gvariabl.inc" + + use "chart2\tools\ch_tools_common.inc" + use "chart2\tools\ch_tools_chart_type.inc" + + Call GetUseFiles + gApplication = "CALC" +end sub 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..f26d2efe07fc --- /dev/null +++ b/testautomation/chart2/optional/includes/ch2_flexible_source_range_selection.inc @@ -0,0 +1,803 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: ch2_flexible_source_range_selection.inc,v $ +'* +'* $Revision: 1.2 $ +'* +'* last change: $Author: obo $ $Date: 2008-07-21 12:07:40 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/*********************************************************************** +'* +'* owner : oliver.craemer@sun.com +'* +'* short description : 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 = 3 then + printlog " All 3 data series are available" + else + warnlog "There are " & iDataSeries & " data series instead of 3" + 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 = 4 then + printlog " Adding a data series was successfull" + else + warnlog "There are " & iDataSeries & " data series instead of 4" + 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 3 entries in the data series listbox" + iDataSeries = DataSeries.GetItemCount + if iDataSeries = 3 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 twice" + MoveDown.Click + MoveDown.Click + else + warnlog "The MoveDown button is disabled" + endif + if DataSeries.GetSelIndex = 3 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..3e97f3f6e52a --- /dev/null +++ b/testautomation/chart2/optional/includes/ch2_flexible_source_range_selection01.inc @@ -0,0 +1,800 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: ch2_flexible_source_range_selection01.inc,v $ +'* +'* $Revision: 1.2 $ +'* +'* last change: $Author: obo $ $Date: 2008-07-21 12:07:53 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/*********************************************************************** +'* +'* owner : oliver.craemer@sun.com +'* +'* short description : 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 + call hFileOpen(sInputFile) + sleep(2) + Call sMakeReadOnlyDocumentEditable() + '///Menu Insert Object Chart to open chart wizard + printlog "Menu Insert Object Chart to open chart wizard" + InsertObjectChart + WaitSlot() + fOpenWriterTestDocumentAndInsertChart = TRUE +end function + |