diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-11-02 21:54:59 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-11-03 00:29:13 +0100 |
commit | c1c89b9323f925f2211b94b3d0e78a7b503b7142 (patch) | |
tree | f3db2ea9c084978f4027c6b5706035f8aa0c8aef /sc/qa | |
parent | 39bd2ff8c7dac93b7a3dd01ea80c8732939971df (diff) |
uitest: test creation of range names from ui
Change-Id: I3897a8a4dc77b5d41b3b64a03146c121fee5c83b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105229
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/uitest/range_name/create_range_name.py | 33 |
1 files changed, 33 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 92f70088ada7..b1b60c1cd83e 100644 --- a/sc/qa/uitest/range_name/create_range_name.py +++ b/sc/qa/uitest/range_name/create_range_name.py @@ -10,6 +10,8 @@ from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.framework import UITestCase from uitest.uihelper.common import type_text, select_pos from uitest.uihelper.common import get_state_as_dict +from libreoffice.calc.document import get_cell_by_position +from uitest.uihelper.calc import enter_text_to_cell class CreateRangeNameTest(UITestCase): @@ -35,6 +37,37 @@ class CreateRangeNameTest(UITestCase): self.ui_test.close_doc() + def test_create_range_name_from_ui(self): + + self.ui_test.create_doc_in_start_center("calc") + + calcDoc = self.xUITest.getTopFocusWindow() + gridwin = calcDoc.getChild("grid_window") + + enter_text_to_cell(gridwin, "A1", "1") + enter_text_to_cell(gridwin, "B1", "1") + enter_text_to_cell(gridwin, "C1", "1") + + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C1"})) + xPosWindow = calcDoc.getChild('pos_window') + self.assertEqual('A1:C1', get_state_as_dict(xPosWindow)['Text']) + + xPosWindow.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + xPosWindow.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + xPosWindow.executeAction("TYPE", mkPropertyValues({"TEXT":"RANGE1"})) + xPosWindow.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"})) + + self.assertEqual('RANGE1', get_state_as_dict(xPosWindow)['Text']) + + calcDoc = self.xUITest.getTopFocusWindow() + gridwin = calcDoc.getChild("grid_window") + + document = self.ui_test.get_component() + enter_text_to_cell(gridwin, "A2", "=SUM(RANGE1)") + self.assertEqual(3.0, get_cell_by_position(document, 0, 0, 1).getValue()) + + self.ui_test.close_doc() + def test_create_local_range_name(self): self.ui_test.create_doc_in_start_center("calc") |