sw/qa/uitest/options/tdf49895.py | 51 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+)
New commits: commit bb22aab5200c334627e5da2cab6c8e84ce86ca7d Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Jul 14 10:27:10 2025 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Jul 14 16:32:51 2025 +0200 tdf#49895, tdf#167466: sw: Add UItest Change-Id: I58564eb5c4f1f6684eeb69105be659a8e48ea145 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187849 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/qa/uitest/options/tdf49895.py b/sw/qa/uitest/options/tdf49895.py new file mode 100644 index 000000000000..4a690e0b0b9f --- /dev/null +++ b/sw/qa/uitest/options/tdf49895.py @@ -0,0 +1,51 @@ +# -*- 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/. +# + +import time + +from uitest.framework import UITestCase +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.common import get_state_as_dict + +class tdf49895(UITestCase): + + def test_tdf49895(self): + with self.ui_test.create_doc_in_start_center("writer"): + + with self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") as xDialog: + + xPages = xDialog.getChild("pages") + initialEntryCount = int(get_state_as_dict(xPages)["Children"]) + self.assertTrue(initialEntryCount != 0) + + xSearch = xDialog.getChild("searchEntry") + + xSearch.executeAction("TYPE", mkPropertyValues({"TEXT":"View"})) + + # Wait for the search/filter op to be completed + while True: + filteredEntryCount = int(get_state_as_dict(xPages)["Children"]) + if filteredEntryCount != initialEntryCount: + break + time.sleep(self.ui_test.get_default_sleep()) + + self.assertEqual(9, filteredEntryCount) + + xSearch.executeAction("CLEAR", tuple()) + + # Wait for the search/filter op to be completed + while True: + finalEntryCount = int(get_state_as_dict(xPages)["Children"]) + if finalEntryCount != filteredEntryCount: + break + time.sleep(self.ui_test.get_default_sleep()) + + self.assertEqual(initialEntryCount, finalEntryCount) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: