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

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 30 17:25:04 UTC 2020


 sw/qa/uitest/data/tdf137855.odt               |binary
 sw/qa/uitest/data/tdf137855_2.odt             |binary
 sw/qa/uitest/writer_tests/compareDocuments.py |   39 ++++++++++++++++++++++++++
 3 files changed, 39 insertions(+)

New commits:
commit 930e67f488b4d4abdf9ffe494f4b1530179881cb
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Oct 29 17:09:43 2020 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Fri Oct 30 18:24:21 2020 +0100

    tdf#137855: sw: Add UItest
    
    Change-Id: Iea71fdff2b900d36ad9475b20ef93f81138f3e9a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105016
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sw/qa/uitest/data/tdf137855.odt b/sw/qa/uitest/data/tdf137855.odt
new file mode 100644
index 000000000000..9657ebdb2de4
Binary files /dev/null and b/sw/qa/uitest/data/tdf137855.odt differ
diff --git a/sw/qa/uitest/data/tdf137855_2.odt b/sw/qa/uitest/data/tdf137855_2.odt
new file mode 100644
index 000000000000..0b0f9cbe6a1c
Binary files /dev/null and b/sw/qa/uitest/data/tdf137855_2.odt differ
diff --git a/sw/qa/uitest/writer_tests/compareDocuments.py b/sw/qa/uitest/writer_tests/compareDocuments.py
index 2013fac42bb8..f18accf456c3 100644
--- a/sw/qa/uitest/writer_tests/compareDocuments.py
+++ b/sw/qa/uitest/writer_tests/compareDocuments.py
@@ -54,4 +54,43 @@ class compareDocuments(UITestCase):
 
         self.ui_test.close_doc()
 
+    def test_tdf137855(self):
+
+        writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf137855.odt"))
+
+        document = self.ui_test.get_component()
+        xWriterDoc = self.xUITest.getTopFocusWindow()
+
+        self.ui_test.execute_dialog_through_command(".uno:CompareDocuments")
+
+        xOpenDialog = self.xUITest.getTopFocusWindow()
+        xFileName = xOpenDialog.getChild("file_name")
+        xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": get_url_for_data_file("tdf137855_2.odt")}))
+
+        xOpenBtn = xOpenDialog.getChild("open")
+        xOpenBtn.executeAction("CLICK", tuple())
+
+        # Close the dialog and open it again so the list of changes is updated
+        xTrackDlg = self.xUITest.getTopFocusWindow()
+        xcloseBtn = xTrackDlg.getChild("close")
+        xcloseBtn.executeAction("CLICK", tuple())
+
+        self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges")
+        xTrackDlg = self.xUITest.getTopFocusWindow()
+        changesList = xTrackDlg.getChild("writerchanges")
+
+        # Check the number of changes
+        self.assertEqual(263, len(changesList.getChildren()))
+
+        # Without the fix in place, this test would have crashed here
+        xAccBtn = xTrackDlg.getChild("acceptall")
+        xAccBtn.executeAction("CLICK", tuple())
+
+        self.assertEqual(0, len(changesList.getChildren()))
+
+        xcloseBtn = xTrackDlg.getChild("close")
+        xcloseBtn.executeAction("CLICK", tuple())
+
+        self.ui_test.close_doc()
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:


More information about the Libreoffice-commits mailing list