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

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 14 20:20:47 UTC 2020


 sc/qa/uitest/calc_tests/data/tdf130960.odt |binary
 sc/qa/uitest/calc_tests4/trackedChanges.py |   30 +++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)

New commits:
commit 4a581f12e0d0fa105f053904300b729acb18194a
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Tue Apr 14 19:57:17 2020 +0200
Commit:     Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Tue Apr 14 22:20:13 2020 +0200

    tdf#130960: Add UItest
    
    Change-Id: I41f5bd8c8b9183138b673a5f40d8a29abe9874df
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92218
    Tested-by: Jenkins
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>

diff --git a/sc/qa/uitest/calc_tests/data/tdf130960.odt b/sc/qa/uitest/calc_tests/data/tdf130960.odt
new file mode 100644
index 000000000000..2a08fa54b7a1
Binary files /dev/null and b/sc/qa/uitest/calc_tests/data/tdf130960.odt differ
diff --git a/sc/qa/uitest/calc_tests4/trackedChanges.py b/sc/qa/uitest/calc_tests4/trackedChanges.py
index 13cdb1319088..ca446e66d0a2 100644
--- a/sc/qa/uitest/calc_tests4/trackedChanges.py
+++ b/sc/qa/uitest/calc_tests4/trackedChanges.py
@@ -11,10 +11,40 @@ from libreoffice.calc.document import get_cell_by_position
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.uihelper.calc import enter_text_to_cell
 from uitest.uihelper.common import get_state_as_dict
+from uitest.path import get_srcdir_url
 import datetime
 
+
+def get_url_for_data_file(file_name):
+    return get_srcdir_url() + "/sc/qa/uitest/calc_tests/data/" + file_name
+
 class CalcTrackedChanges(UITestCase):
 
+    def test_tdf131907(self):
+        calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf130960.odt"))
+        xCalcDoc = self.xUITest.getTopFocusWindow()
+        self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptChanges")
+        xTrackDlg = self.xUITest.getTopFocusWindow()
+
+        xChangesList = xTrackDlg.getChild("calcchanges")
+        self.assertEqual(1, len(xChangesList.getChildren()))
+
+        text = "Row inserted \tSheet1.1:1\t \t04/05/2020 17:01:10\t (Row 1:1 inserted)"
+        self.assertEqual(get_state_as_dict(xChangesList.getChild('0'))["Text"], text)
+
+        #it would crash here
+        xRejBtn = xTrackDlg.getChild("reject")
+        xRejBtn.executeAction("CLICK", tuple())
+
+        self.assertEqual(2, len(xChangesList.getChildren()))
+        self.assertEqual(get_state_as_dict(xChangesList.getChild('0'))["Text"], "Accepted")
+        self.assertEqual(get_state_as_dict(xChangesList.getChild('1'))["Text"], "Rejected")
+
+        xCancBtn = xTrackDlg.getChild("close")
+        xCancBtn.executeAction("CLICK", tuple())
+
+        self.ui_test.close_doc()
+
     def test_tdf66263_Protect_Records(self):
         calc_doc = self.ui_test.create_doc_in_start_center("calc")
         xCalcDoc = self.xUITest.getTopFocusWindow()


More information about the Libreoffice-commits mailing list