tdf#134390: sc: Add UItest

Change-Id: I12ab42afbe902a25f93deaa4884280392c705f38
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97516
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sc/qa/uitest/calc_tests8/navigator.py b/sc/qa/uitest/calc_tests8/navigator.py
index 4026ca6..56bb2b7 100644
--- a/sc/qa/uitest/calc_tests8/navigator.py
+++ b/sc/qa/uitest/calc_tests8/navigator.py
@@ -115,3 +115,39 @@ class navigator(UITestCase):

        self.xUITest.executeCommand(".uno:Sidebar")
        self.ui_test.close_doc()


    def test_tdf134390(self):
        calc_doc = self.ui_test.create_doc_in_start_center("calc")
        xCalcDoc = self.xUITest.getTopFocusWindow()
        xGridWin = xCalcDoc.getChild("grid_window")

        self.xUITest.executeCommand(".uno:Sidebar")
        xGridWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "ScNavigatorPanel"}))

        xCalcDoc = self.xUITest.getTopFocusWindow()
        xNavigatorPanel = xCalcDoc.getChild("NavigatorPanelParent")
        xNavigatorPanel.executeAction("ROOT", tuple())

        xRow = xNavigatorPanel.getChild('row')
        xColumn = xNavigatorPanel.getChild('column')
        self.assertEqual(get_state_as_dict(xColumn)['Value'], '1')
        self.assertEqual(get_state_as_dict(xRow)['Value'], '1')
        self.assertEqual(get_state_as_dict(xGridWin)["CurrentRow"], "0")
        self.assertEqual(get_state_as_dict(xGridWin)["CurrentColumn"], "0")

        xRow.executeAction("UP", tuple())
        xColumn.executeAction("UP", tuple())

        # Use return to update the current cell
        xColumn.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))

        self.assertEqual(get_state_as_dict(xColumn)['Value'], '2')
        self.assertEqual(get_state_as_dict(xRow)['Value'], '2')

        self.assertEqual(get_state_as_dict(xGridWin)["CurrentRow"], "1")
        self.assertEqual(get_state_as_dict(xGridWin)["CurrentColumn"], "1")

        self.xUITest.executeCommand(".uno:Sidebar")

        self.ui_test.close_doc()