[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - sw/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Wed Oct 28 15:51:40 UTC 2020


 sw/qa/uitest/writer_tests/data/tdf135018.odt |binary
 sw/qa/uitest/writer_tests/trackedChanges.py  |   36 +++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)

New commits:
commit b87fa88ee93601703394dd97be9b101370ecf1a5
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Tue Sep 1 17:30:44 2020 +0200
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Wed Oct 28 16:51:06 2020 +0100

    tdf#135018: sw: Add UItest
    
    Change-Id: Ia88e28b1569ea69df81d905cb76a6791a887ef3f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101883
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
    (cherry picked from commit b6ab2330d97672936edc56de8d6f5b6f772908ff)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104941
    Tested-by: Michael Stahl <michael.stahl at cib.de>
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/sw/qa/uitest/writer_tests/data/tdf135018.odt b/sw/qa/uitest/writer_tests/data/tdf135018.odt
new file mode 100644
index 000000000000..2dc9e2a4da0d
Binary files /dev/null and b/sw/qa/uitest/writer_tests/data/tdf135018.odt differ
diff --git a/sw/qa/uitest/writer_tests/trackedChanges.py b/sw/qa/uitest/writer_tests/trackedChanges.py
index 5bc8fecf7b03..bf98162cdda5 100644
--- a/sw/qa/uitest/writer_tests/trackedChanges.py
+++ b/sw/qa/uitest/writer_tests/trackedChanges.py
@@ -7,9 +7,13 @@
 
 from uitest.framework import UITestCase
 from uitest.debug import sleep
+from uitest.path import get_srcdir_url
 import time
 from uitest.uihelper.common import get_state_as_dict, type_text
 
+def get_url_for_data_file(file_name):
+   return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name
+
 class trackedchanges(UITestCase):
 
     def test_tdf91270(self):
@@ -151,4 +155,36 @@ class trackedchanges(UITestCase):
         self.assertEqual(document.Text.String[0:30], "Test LibreOffice Test2 Test4")
 
         self.ui_test.close_doc()
+
+    def test_tdf135018(self):
+        self.ui_test.load_file(get_url_for_data_file("tdf135018.odt"))
+        xWriterDoc = self.xUITest.getTopFocusWindow()
+        xWriterEdit = xWriterDoc.getChild("writer_edit")
+        document = self.ui_test.get_component()
+
+        self.assertEqual(5, document.CurrentController.PageCount)
+
+        self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges")
+        xTrackDlg = self.xUITest.getTopFocusWindow()
+        changesList = xTrackDlg.getChild("writerchanges")
+        self.assertEqual(147, len(changesList.getChildren()))
+
+        # Without the fix in place, it would have crashed here
+        xAccBtn = xTrackDlg.getChild("acceptall")
+        xAccBtn.executeAction("CLICK", tuple())
+
+        self.assertEqual(0, len(changesList.getChildren()))
+
+        xUndoBtn = xTrackDlg.getChild("undo")
+        xUndoBtn.executeAction("CLICK", tuple())
+
+        self.assertEqual(147, len(changesList.getChildren()))
+
+        xcloseBtn = xTrackDlg.getChild("close")
+        xcloseBtn.executeAction("CLICK", tuple())
+
+        #self.assertEqual(18, document.CurrentController.PageCount)
+
+        self.ui_test.close_doc()
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:


More information about the Libreoffice-commits mailing list