sw/qa/uitest/data/tdf167128.fodt | 40 +++++++++++++++++++++++++++++++++ sw/qa/uitest/writer_tests/tdf167128.py | 35 ++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+)
New commits: commit b5d94b9e26e6f2b30acb8a406bd7fb7bf8fe86ad Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Fri Jun 20 15:05:25 2025 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Fri Jun 20 17:47:29 2025 +0200 tdf#167128: sw: Add UItest Change-Id: I9e7731b696e3e45903820dd2747ec958c2075e1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186766 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Jenkins diff --git a/sw/qa/uitest/data/tdf167128.fodt b/sw/qa/uitest/data/tdf167128.fodt new file mode 100644 index 000000000000..0c7072b244a0 --- /dev/null +++ b/sw/qa/uitest/data/tdf167128.fodt @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" office:version="1.4" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:automatic-styles> + <style:style style:name="T1" style:family="text"> + <style:text-properties fo:font-weight="bold"/> + </style:style> + </office:automatic-styles> + <office:body> + <office:text> + <text:tracked-changes text:track-changes="false"> + <text:changed-region xml:id="ct2412392131792" text:id="ct2412392131792"> + <text:deletion> + <office:change-info> + <dc:creator>Mike</dc:creator> + <dc:date>2025-06-16T14:08:27</dc:date> + </office:change-info> + </text:deletion> + </text:changed-region> + <text:changed-region xml:id="ct2412428113776" text:id="ct2412428113776"> + <text:format-change> + <office:change-info> + <dc:creator>Mike</dc:creator> + <dc:date>2025-06-17T12:41:00</dc:date> + </office:change-info> + </text:format-change> + </text:changed-region> + <text:changed-region xml:id="ct2412428117232" text:id="ct2412428117232"> + <text:insertion> + <office:change-info> + <dc:creator>Mike</dc:creator> + <dc:date>2025-06-17T12:41:19</dc:date> + </office:change-info> + </text:insertion> + </text:changed-region> + </text:tracked-changes> + <text:p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum consequat mi quis pretium semper. Proin luctus orci ac neque venenatis, quis commodo dolor posuere. Curabitur dignissim sapien quis cursus egestas. <text:change-start text:change-id="ct2412392131792"/>Donec<text:change-end text:change-id="ct2412392131792"/> blandit auctor arcu, nec <text:change-start text:change-id="ct2412428113776"/><text:span text:style-name="T1">pellentesque</text:span><text:change-end text:change-id="ct2412428113776"/> eros molestie eget. In consectetur aliquam hendrerit. Sed cursus mauris vitae ligula pellentesque, non pellentesque urna aliquet. Fusce placerat mauris enim, nec rutrum purus semper vel. Praesent tincidunt neque eu pellentesque pharetra. Fusce pellentesque est orci.<text:change-start text:change-id="ct2412428117232"/> Sapienti sat.<text:change-end text:change-id="ct2412428117232"/></text:p> + </office:text> + </office:body> +</office:document> \ No newline at end of file diff --git a/sw/qa/uitest/writer_tests/tdf167128.py b/sw/qa/uitest/writer_tests/tdf167128.py new file mode 100644 index 000000000000..b64f6dfbcdab --- /dev/null +++ b/sw/qa/uitest/writer_tests/tdf167128.py @@ -0,0 +1,35 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# +from uitest.framework import UITestCase +from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file + +class tdf167128(UITestCase): + + def test_tdf167128(self): + + with self.ui_test.load_file(get_url_for_data_file("tdf167128.fodt")): + + with self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptTrackedChanges", close_button="close") as xTrackDlg: + changesList = xTrackDlg.getChild("writerchanges") + + self.assertEqual(3, len(changesList.getChildren())) + self.assertEqual('true', get_state_as_dict(changesList.getChild('0'))["IsSelected"]) + self.assertEqual('false', get_state_as_dict(changesList.getChild('1'))["IsSelected"]) + self.assertEqual('false', get_state_as_dict(changesList.getChild('2'))["IsSelected"]) + + # Without the fix in place, this test would have failed here with + # AssertionError: 'true' != 'false' + self.assertEqual('true', get_state_as_dict(xTrackDlg.getChild("accept"))["Enabled"]) + self.assertEqual('true', get_state_as_dict(xTrackDlg.getChild("acceptall"))["Enabled"]) + self.assertEqual('true', get_state_as_dict(xTrackDlg.getChild("reject"))["Enabled"]) + self.assertEqual('true', get_state_as_dict(xTrackDlg.getChild("rejectall"))["Enabled"]) + + +# vim: set shiftwidth=4 softtabstop=4 expandtab: