[Libreoffice-commits] core.git: sc/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Mon Nov 2 18:25:12 UTC 2020


 sc/qa/uitest/range_name/create_range_name.py |   19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

New commits:
commit dda3592f6a1028bd9d433eb2f88e561959212cf6
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Mon Nov 2 17:21:46 2020 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Mon Nov 2 19:24:23 2020 +0100

    tdf#67007: sc: Add UItest
    
    Change-Id: Id8e52f10943f5c28b3c28f757bd38b55f18f3384
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105189
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sc/qa/uitest/range_name/create_range_name.py b/sc/qa/uitest/range_name/create_range_name.py
index 1babca7c0a58..92f70088ada7 100644
--- a/sc/qa/uitest/range_name/create_range_name.py
+++ b/sc/qa/uitest/range_name/create_range_name.py
@@ -9,6 +9,7 @@ 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
 
 class CreateRangeNameTest(UITestCase):
 
@@ -16,28 +17,38 @@ class CreateRangeNameTest(UITestCase):
 
         self.ui_test.create_doc_in_start_center("calc")
 
+        calcDoc = self.xUITest.getTopFocusWindow()
+        xPosWindow = calcDoc.getChild('pos_window')
+        self.assertEqual('A1', get_state_as_dict(xPosWindow)['Text'])
+
         self.ui_test.execute_modeless_dialog_through_command(".uno:AddName")
 
         xAddNameDlg = self.xUITest.getTopFocusWindow()
 
         xEdit = xAddNameDlg.getChild("edit")
-        type_text(xEdit, "simpleRangeName")
+        type_text(xEdit, "globalRangeName")
 
         xAddBtn = xAddNameDlg.getChild("add")
         self.ui_test.close_dialog_through_button(xAddBtn)
 
+        self.assertEqual('globalRangeName', get_state_as_dict(xPosWindow)['Text'])
+
         self.ui_test.close_doc()
 
     def test_create_local_range_name(self):
 
         self.ui_test.create_doc_in_start_center("calc")
 
+        calcDoc = self.xUITest.getTopFocusWindow()
+        xPosWindow = calcDoc.getChild('pos_window')
+        self.assertEqual('A1', get_state_as_dict(xPosWindow)['Text'])
+
         self.ui_test.execute_modeless_dialog_through_command(".uno:AddName")
 
         xAddNameDlg = self.xUITest.getTopFocusWindow()
 
         xEdit = xAddNameDlg.getChild("edit")
-        type_text(xEdit, "simpleRangeName")
+        type_text(xEdit, "localRangeName")
 
         xScope = xAddNameDlg.getChild("scope")
         select_pos(xScope, "1")
@@ -45,6 +56,10 @@ class CreateRangeNameTest(UITestCase):
         xAddBtn = xAddNameDlg.getChild("add")
         self.ui_test.close_dialog_through_button(xAddBtn)
 
+        # tdf#67007: Without the fix in place, this test would have failed with
+        # AssertionError: 'localRangeName' != 'A1'
+        self.assertEqual('localRangeName', get_state_as_dict(xPosWindow)['Text'])
+
         self.ui_test.close_doc()
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:


More information about the Libreoffice-commits mailing list