sc/qa/uitest/autofilter2/tdf141559.py | 3 +-- sc/qa/uitest/autofilter2/tdf46184.py | 3 +-- uitest/uitest/test.py | 2 ++ 3 files changed, 4 insertions(+), 4 deletions(-)
New commits: commit 5d0de0b3451754652b840b77c0765c2b1153add8 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Mon Jul 15 15:45:25 2024 +0500 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Mon Jul 15 21:55:40 2024 +0200 Simplify use of close_dialog_through_button: allow button by name Change-Id: I59a74e7221808308853f0d893a416fababaf2318 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170493 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sc/qa/uitest/autofilter2/tdf141559.py b/sc/qa/uitest/autofilter2/tdf141559.py index 37068ccec0ba..51847dc43285 100644 --- a/sc/qa/uitest/autofilter2/tdf141559.py +++ b/sc/qa/uitest/autofilter2/tdf141559.py @@ -64,8 +64,7 @@ class tdf141559(UITestCase): select_by_text(xfield1, "A") select_by_text(xcond1, ">") xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"1"})) - xOKBtn = xDialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOKBtn) + self.ui_test.close_dialog_through_button("ok") row = get_row(document, 1) self.assertFalse(row.getPropertyValue("IsVisible")) diff --git a/sc/qa/uitest/autofilter2/tdf46184.py b/sc/qa/uitest/autofilter2/tdf46184.py index 508346321e73..18da47a5e060 100644 --- a/sc/qa/uitest/autofilter2/tdf46184.py +++ b/sc/qa/uitest/autofilter2/tdf46184.py @@ -63,8 +63,7 @@ class tdf46184(UITestCase): if get_state_as_dict(xdestpers)['Selected'] == 'false': xdestpers.executeAction("CLICK", tuple()) self.assertEqual('true', get_state_as_dict(xcopyresult)['Selected']) - xOKBtn = xDialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOKBtn) + self.ui_test.close_dialog_through_button("ok") row1 = get_row(document, 1) diff --git a/uitest/uitest/test.py b/uitest/uitest/test.py index e6491af3f67f..0ba35a98d9b9 100644 --- a/uitest/uitest/test.py +++ b/uitest/uitest/test.py @@ -192,6 +192,8 @@ class UITest(object): def close_dialog_through_button(self, button, dialog=None): if dialog is None: dialog = self._xUITest.getTopFocusWindow() + if isinstance(button, str): + button = dialog.getChild(button) with EventListener(self._xContext, "DialogClosed" ) as event: button.executeAction("CLICK", tuple()) while True: