sw/qa/uitest/data/tdf168070.docx              |binary
 sw/qa/uitest/data/tdf168070_2.docx            |binary
 sw/qa/uitest/writer_tests/compareDocuments.py |   28 ++++++++++++++++++++++++++
 3 files changed, 28 insertions(+)

New commits:
commit 7cfd0af0a5799265164a56a006d8b0207585aeb9
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Thu Aug 28 20:10:39 2025 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri Aug 29 12:16:16 2025 +0200

    tdf#168070: sw: Add UItest
    
    Change-Id: Ifaddc46a7a7918b22f4a4943fe6697ef0bcb375a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190339
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/qa/uitest/data/tdf168070.docx b/sw/qa/uitest/data/tdf168070.docx
new file mode 100644
index 000000000000..f050073902cf
Binary files /dev/null and b/sw/qa/uitest/data/tdf168070.docx differ
diff --git a/sw/qa/uitest/data/tdf168070_2.docx 
b/sw/qa/uitest/data/tdf168070_2.docx
new file mode 100644
index 000000000000..aa641e81f342
Binary files /dev/null and b/sw/qa/uitest/data/tdf168070_2.docx differ
diff --git a/sw/qa/uitest/writer_tests/compareDocuments.py 
b/sw/qa/uitest/writer_tests/compareDocuments.py
index f2575f5ec906..5632d9f6ab52 100644
--- a/sw/qa/uitest/writer_tests/compareDocuments.py
+++ b/sw/qa/uitest/writer_tests/compareDocuments.py
@@ -62,5 +62,33 @@ class compareDocuments(UITestCase):
 
                 self.assertEqual(0, len(changesList.getChildren()))
 
+    def test_tdf168070(self):
+
+        with self.ui_test.load_file(get_url_for_data_file("tdf168070.docx")):
+
+            with 
self.ui_test.execute_dialog_through_command(".uno:CompareDocuments", 
close_button="") as xOpenDialog:
+
+                xFileName = xOpenDialog.getChild("file_name")
+                xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": 
get_url_for_data_file("tdf168070_2.docx")}))
+                xOpenBtn = xOpenDialog.getChild("open")
+
+                # The document is corrupted so click yes to repair it
+                with 
self.ui_test.execute_blocking_action(xOpenBtn.executeAction, args=('CLICK', 
()), close_button="") as xRepairDialog:
+                    xYesBtn = xRepairDialog.getChild("yes")
+
+                    # Close the dialog and open it again so the list of 
changes is updated
+                    with self.ui_test.execute_dialog_through_action(xYesBtn, 
'CLICK', close_button="close"):
+                        pass
+
+            with 
self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges",
 close_button="close") as xTrackDlg:
+                changesList = xTrackDlg.getChild("writerchanges")
+
+                # Check the number of changes
+                self.assertEqual(6, len(changesList.getChildren()))
+
+                xAccBtn = xTrackDlg.getChild("acceptall")
+                xAccBtn.executeAction("CLICK", tuple())
+
+                self.assertEqual(0, len(changesList.getChildren()))
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:

Reply via email to