diff options
author | Dennis Francis <dennis.francis@collabora.co.uk> | 2018-08-01 17:59:23 +0530 |
---|---|---|
committer | Dennis Francis <dennis.francis@collabora.co.uk> | 2018-08-03 19:12:36 +0200 |
commit | 2ffe228264caa77b18c3bea56823f000b2d01a7e (patch) | |
tree | 9626cf7f531ad7f6bc3eac2028f4d6ed6c6f0e1d /sc/qa | |
parent | 6b8874e780367427ff748556e8744bfe5c91b08e (diff) |
Allow forcing of intercept to zero in regression dialog
Change-Id: I3958c139141a9e717256a638d319e0bb5879e6a4
Reviewed-on: https://gerrit.libreoffice.org/58565
Tested-by: Jenkins
Reviewed-by: Dennis Francis <dennis.francis@collabora.co.uk>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/uitest/statistics/data/regression.ods | bin | 24844 -> 27410 bytes | |||
-rw-r--r-- | sc/qa/uitest/statistics/regression.py | 18 |
2 files changed, 13 insertions, 5 deletions
diff --git a/sc/qa/uitest/statistics/data/regression.ods b/sc/qa/uitest/statistics/data/regression.ods Binary files differindex f9f65bfda0f5..1c8b72cc912b 100644 --- a/sc/qa/uitest/statistics/data/regression.ods +++ b/sc/qa/uitest/statistics/data/regression.ods diff --git a/sc/qa/uitest/statistics/regression.py b/sc/qa/uitest/statistics/regression.py index ccf1258a776e..6f5fd2ca0e27 100644 --- a/sc/qa/uitest/statistics/regression.py +++ b/sc/qa/uitest/statistics/regression.py @@ -31,17 +31,18 @@ class regression(UITestCase): document = self.ui_test.get_component() # Initially the final check status is "FALSE" (failed). - self.assertEqual(get_cell_by_position(document, 11, 1, 5).getString(), "FALSE", + self.assertEqual(get_cell_by_position(document, 14, 1, 6).getString(), "FALSE", "Check status must be FALSE before the test") - self._do_regression(regression_type = "LINEAR", data_groupedby_column = data_groupedby_column) + self._do_regression(regression_type = "LINEAR", data_groupedby_column = data_groupedby_column, calc_intercept = True) + self._do_regression(regression_type = "LINEAR", data_groupedby_column = data_groupedby_column, calc_intercept = False) self._do_regression(regression_type = "LOG", data_groupedby_column = data_groupedby_column) self._do_regression(regression_type = "POWER", data_groupedby_column = data_groupedby_column) - self.assertEqual(get_cell_by_position(document, 11, 1, 5).getString(), "TRUE", + self.assertEqual(get_cell_by_position(document, 14, 1, 6).getString(), "TRUE", "One of more of the checks failed for data_groupedby_column = {}, manually try with the document". format(data_groupedby_column)) self.ui_test.close_doc() - def _do_regression(self, regression_type, data_groupedby_column = True): + def _do_regression(self, regression_type, data_groupedby_column = True, calc_intercept = True): assert(regression_type == "LINEAR" or regression_type == "LOG" or regression_type == "POWER") self.ui_test.execute_modeless_dialog_through_command(".uno:RegressionDialog") xDialog = self.xUITest.getTopFocusWindow() @@ -54,6 +55,7 @@ class regression(UITestCase): xlinearradio = xDialog.getChild("linear-radio") xlogarithmicradio = xDialog.getChild("logarithmic-radio") xpowerradio = xDialog.getChild("power-radio") + xnointerceptcheck = xDialog.getChild("nointercept-check") ## Set the X, Y and output ranges xvariable1rangeedit.executeAction("FOCUS", tuple()) # Without this the range parser does not kick in somehow @@ -79,7 +81,10 @@ class regression(UITestCase): xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) if regression_type == "LINEAR": - xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$ActualLinear.$A$1"})) + if calc_intercept: + xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$ActualLinear.$A$1"})) + else: + xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$ActualLinearNoIntercept.$A$1"})) elif regression_type == "LOG": xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$ActualLog.$A$1"})) else: @@ -97,6 +102,9 @@ class regression(UITestCase): else: xpowerradio.executeAction("CLICK", tuple()) + if not calc_intercept: + xnointerceptcheck.executeAction("CLICK", tuple()) + xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) |