From 5bb06ea6931c0c72df6b0f164bac1c8d00c51bb6 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Fri, 4 Jun 2021 21:59:21 +0200 Subject: Fix UITest The test had previously raced between the effect of vnd.sun.star.findbar:FocusToFindbar, typing, and pressing the "Find All" button. If typing happened before focusing, then focusing selected the already typed text. If button was clicked before focusing, it found the edit unfocused, and grabbed the focus, selecting its content. This adds "HasFocus" property to WindowUIObject::get_state. Change-Id: Ib277bd70508a3c1e86e1668afb7592d7a1523947 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116697 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- sw/qa/uitest/findBar/tdf138232.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sw') diff --git a/sw/qa/uitest/findBar/tdf138232.py b/sw/qa/uitest/findBar/tdf138232.py index 93f859bc7521..62a79824ea4d 100644 --- a/sw/qa/uitest/findBar/tdf138232.py +++ b/sw/qa/uitest/findBar/tdf138232.py @@ -23,6 +23,9 @@ class tdf138232(UITestCase): self.xUITest.executeCommand("vnd.sun.star.findbar:FocusToFindbar") xfind = xWriterDoc.getChild("find") + self.ui_test.wait_until_property_is_updated(xfind, 'HasFocus', "true") + self.assertEqual("true", get_state_as_dict(xfind)['HasFocus']) + xfind.executeAction("TYPE", mkPropertyValues({"TEXT": "Hello"})) self.assertEqual("Hello", get_state_as_dict(xfind)['Text']) -- cgit