sw/source/uibase/uitest/uiobject.cxx |    3 +++
 uitest/writer_tests5/tdf114724.py    |    4 ++++
 2 files changed, 7 insertions(+)

New commits:
commit d37b1ca5f502454266ff5a75455d61776ee11bb4
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Thu May 21 18:43:06 2020 +0200
Commit:     Xisco Faulí <xiscofa...@libreoffice.org>
CommitDate: Thu May 21 19:28:19 2020 +0200

    uitest: sw: grab focus before using toggle button in navigator
    
    otherwise the focus in on the document
    
    since ada385f1cba427416c1e8517cb6a45b61ceff7b0
    
    Change-Id: Ia8300fdceb4f50f89c6d90f238483a4c785163d0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94647
    Tested-by: Xisco Faulí <xiscofa...@libreoffice.org>
    Reviewed-by: Xisco Faulí <xiscofa...@libreoffice.org>

diff --git a/sw/source/uibase/uitest/uiobject.cxx 
b/sw/source/uibase/uitest/uiobject.cxx
index a0b8da9e9d97..6a55e42cf5ac 100644
--- a/sw/source/uibase/uitest/uiobject.cxx
+++ b/sw/source/uibase/uitest/uiobject.cxx
@@ -147,7 +147,10 @@ void SwNavigationPIUIObject::execute(const OUString& 
rAction,
         const StringMap& rParameters)
 {
     if (rAction == "ROOT")
+    {
+        mxSwNavigationPI->m_xContentTree->grab_focus();
         mxSwNavigationPI->ToolBoxSelectHdl("root");
+    }
     else
         WindowUIObject::execute(rAction, rParameters);
 }
diff --git a/uitest/writer_tests5/tdf114724.py 
b/uitest/writer_tests5/tdf114724.py
index 390e53b3ac37..46d19468d43c 100644
--- a/uitest/writer_tests5/tdf114724.py
+++ b/uitest/writer_tests5/tdf114724.py
@@ -25,6 +25,10 @@ class tdf114724(UITestCase):
         xNavigatorPanel = xWriterEdit.getChild("NavigatorPanelParent")
         xNavigatorPanel.executeAction("ROOT", tuple())
 
+        xContentTree = xNavigatorPanel.getChild('contenttree')
+        #Check the content has changed
+        self.assertEqual(len(xContentTree.getChildren()), 1)
+
         xWriterEdit.executeAction("FOCUS", tuple())
         time.sleep(2)
         self.assertEqual(get_state_as_dict(xNavigatorPanel)["selectioncount"], 
"1")
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to