diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-11-03 16:07:56 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-11-03 21:05:01 +0100 |
commit | b7a862bbd438eeeb006b08d3fde709b383d1eeb7 (patch) | |
tree | 7665771984fbc73909e0e7a4e9911de93cc390ae /sc | |
parent | ed8fc341678f780ceedd77db2ea4a4441bdca3e9 (diff) |
tdf#87474: sc: Add UItest
Change-Id: I2c915372076228164e6322fad84643971ea4e105
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105257
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/uitest/range_name/create_range_name.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sc/qa/uitest/range_name/create_range_name.py b/sc/qa/uitest/range_name/create_range_name.py index 1c59d879272b..f1cbe4a04d1d 100644 --- a/sc/qa/uitest/range_name/create_range_name.py +++ b/sc/qa/uitest/range_name/create_range_name.py @@ -66,6 +66,29 @@ class CreateRangeNameTest(UITestCase): enter_text_to_cell(gridwin, "A2", "=SUM(RANGE1)") self.assertEqual(3.0, get_cell_by_position(document, 0, 0, 1).getValue()) + # Change the name + self.ui_test.execute_dialog_through_command(".uno:DefineName") + xDialog = self.xUITest.getTopFocusWindow() + xNamesList = xDialog.getChild('names') + self.assertEqual(1, len(xNamesList.getChildren())) + + xName = xDialog.getChild('name') + self.assertEqual( 'RANGE1', get_state_as_dict(xName)["Text"]) + + xName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + xName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + xName.executeAction("TYPE", mkPropertyValues({"TEXT":"RANGE2"})) + + xOkBtn = xDialog.getChild("ok") + xOkBtn.executeAction("CLICK", tuple()) + + # tdf#87474 check the formula is updated after changing the name + self.assertEqual("=SUM(RANGE2)", get_cell_by_position(document, 0, 0, 1).getFormula()) + + self.xUITest.executeCommand(".uno:Undo") + + self.assertEqual("=SUM(RANGE1)", get_cell_by_position(document, 0, 0, 1).getFormula()) + self.ui_test.close_doc() def test_create_local_range_name(self): |