summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-08-09 12:34:31 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-08-09 15:51:17 +0200
commita5df8f82938973b2dd63e39d96b95833670005ba (patch)
tree78ff9baf92775f5011ef8be788aaf829e7b6fcf7
parent57fddf3e644c99715fb3bdf2e107aa2495c0ecf9 (diff)
tdf#149916: sw: Add UItest
Change-Id: I79b75c35023c1f508a0e4e48739ca7ee99c19d62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138012 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sw/qa/uitest/data/tdf149916.odtbin0 -> 9658 bytes
-rw-r--r--sw/qa/uitest/navigator/tdf149916.py42
2 files changed, 42 insertions, 0 deletions
diff --git a/sw/qa/uitest/data/tdf149916.odt b/sw/qa/uitest/data/tdf149916.odt
new file mode 100644
index 000000000000..8294e0bb5c72
--- /dev/null
+++ b/sw/qa/uitest/data/tdf149916.odt
Binary files differ
diff --git a/sw/qa/uitest/navigator/tdf149916.py b/sw/qa/uitest/navigator/tdf149916.py
new file mode 100644
index 000000000000..176bdb4d0b57
--- /dev/null
+++ b/sw/qa/uitest/navigator/tdf149916.py
@@ -0,0 +1,42 @@
+# -*- 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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
+
+class tdf149916(UITestCase):
+
+ def test_tdf149916(self):
+
+ with self.ui_test.load_file(get_url_for_data_file('tdf149916.odt')):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild('writer_edit')
+
+ self.xUITest.executeCommand('.uno:Sidebar')
+ xWriterEdit.executeAction('SIDEBAR', mkPropertyValues({'PANEL': 'SwNavigatorPanel'}))
+
+ # wait until the navigator panel is available
+ xNavigatorPanel = self.ui_test.wait_until_child_is_available('NavigatorPanel')
+
+ xContentTree = xNavigatorPanel.getChild('contenttree')
+ xFields = xContentTree.getChild('12')
+ self.assertEqual('Fields', get_state_as_dict(xFields)['Text'])
+
+ xFields.executeAction('EXPAND', tuple())
+
+ self.assertEqual('1', get_state_as_dict(xFields)['Children'])
+
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 'cross-reference - First - 1' != 'cross-reference - __RefHeading___Toc45_480138666 - 1'
+ self.assertEqual('cross-reference - First - 1', get_state_as_dict(xFields.getChild('0'))['Text'])
+
+ self.xUITest.executeCommand('.uno:Sidebar')
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab: