sc/qa/uitest/solver/solver.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
New commits: commit 34636bea78020e98bb5db6c3165d98d984e022dd Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Mar 15 10:51:11 2022 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Mar 15 12:07:43 2022 +0100 UITest_solver: add more asserts to find where the test fails This test fails sometimes for unknown reasons See https://ci.libreoffice.org//job/lo_ubsan/2329/consoleFull#2818066648ce9c26-9d0a-43a8-83d8-c44f54920d59 Change-Id: Ib5c01355fff1056f64cab7fcc8b486b31a0ba5e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131583 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/uitest/solver/solver.py b/sc/qa/uitest/solver/solver.py index f7372719c879..0ac87200f68a 100644 --- a/sc/qa/uitest/solver/solver.py +++ b/sc/qa/uitest/solver/solver.py @@ -22,28 +22,38 @@ class solver(UITestCase): gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B4"})) with self.ui_test.execute_modeless_dialog_through_command(".uno:SolverDialog", close_button="") as xDialog: xtargetedit = xDialog.getChild("targetedit") + xmax = xDialog.getChild("max") xvalue = xDialog.getChild("value") xvalueedit = xDialog.getChild("valueedit") xchangeedit = xDialog.getChild("changeedit") xref1edit = xDialog.getChild("ref1edit") xval1edit = xDialog.getChild("val1edit") + xop1list = xDialog.getChild("op1list") xref2edit = xDialog.getChild("ref2edit") xval2edit = xDialog.getChild("val2edit") xop2list = xDialog.getChild("op2list") + self.assertEqual("$B$4", get_state_as_dict(xtargetedit)["Text"]) + self.assertEqual("true", get_state_as_dict(xmax)["Checked"]) + xvalue.executeAction("CLICK", tuple()) + select_by_text(xop2list, "=>") + + self.assertEqual("<=", get_state_as_dict(xop1list)["SelectEntryText"]) + self.assertEqual("=>", get_state_as_dict(xop2list)["SelectEntryText"]) + xvalueedit.executeAction("TYPE", mkPropertyValues({"TEXT":"1000"})) xchangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"C2"})) xref1edit.executeAction("TYPE", mkPropertyValues({"TEXT":"C2"})) xval1edit.executeAction("TYPE", mkPropertyValues({"TEXT":"C4"})) xref2edit.executeAction("TYPE", mkPropertyValues({"TEXT":"C4"})) - select_by_text(xop2list, "=>") - xval2edit.executeAction("TYPE", mkPropertyValues({"TEXT":"0"})) + xOKBtn = xDialog.getChild("ok") - with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ())): - pass + with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ())) as xWarnDialog: + self.assertEqual("Solving successfully finished.", get_state_as_dict(xWarnDialog.getChild("label2"))["Text"]) + self.assertEqual("Result: 1000", get_state_as_dict(xWarnDialog.getChild("result"))["Text"]) #verify self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 1).getValue(), 400)