summaryrefslogtreecommitdiff
path: root/uitest/demo_ui/treelist.py
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-06-21 16:50:52 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-06-22 18:19:33 +0200
commit8fbe0a6f6a32ece52f97801f33eab54705d53bc3 (patch)
treec7f36747a2613bcc4838810a2a84ea5122077346 /uitest/demo_ui/treelist.py
parent71f562f8f77f14b76fde4329f7238fe2e7d6a054 (diff)
uitest: add treelist demo
Change-Id: I41796a2a557143030cbd016399c2c1bf5cde37bd
Diffstat (limited to 'uitest/demo_ui/treelist.py')
-rw-r--r--uitest/demo_ui/treelist.py64
1 files changed, 64 insertions, 0 deletions
diff --git a/uitest/demo_ui/treelist.py b/uitest/demo_ui/treelist.py
new file mode 100644
index 000000000000..4523dca94b7a
--- /dev/null
+++ b/uitest/demo_ui/treelist.py
@@ -0,0 +1,64 @@
+# -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+#
+# 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_helper import UITest
+
+from helper import mkPropertyValues
+from uihelper.calc import enter_text_to_cell
+
+from uitest_helper import get_state_as_dict
+
+try:
+ import pyuno
+ import uno
+ import unohelper
+except ImportError:
+ print("pyuno not found: try to set PYTHONPATH and URE_BOOTSTRAP variables")
+ print("PYTHONPATH=/installation/opt/program")
+ print("URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc")
+ raise
+
+def expand(xContext):
+ xUITest = xContext.ServiceManager.createInstanceWithContext(
+ "org.libreoffice.uitest.UITest", xContext)
+
+ ui_test = UITest(xUITest, xContext)
+
+ ui_test.create_doc_in_start_center("calc")
+
+ xCalcDoc = xUITest.getTopFocusWindow()
+ xGridWindow = xCalcDoc.getChild("grid_window")
+ enter_text_to_cell(xGridWindow, "B2", "=2+3+4")
+ xGridWindow.executeAction("SELECT", mkPropertyValues({"CELL": "B2"}))
+
+ ui_test.execute_modeless_dialog_through_command(".uno:FunctionDialog")
+
+ xFunctionDlg = xUITest.getTopFocusWindow()
+
+ xTabs = xFunctionDlg.getChild("tabs")
+ xTabs.executeAction("SELECT", mkPropertyValues({"POS":"1"}))
+
+ xTreelist = xTabs.getChild("struct")
+
+ xTreeEntry = xTreelist.getChild('0')
+
+ xTreeEntry.executeAction("COLLAPSE", tuple())
+
+ time.sleep(1)
+
+ xTreeEntry.executeAction("EXPAND", tuple())
+
+ time.sleep(1)
+
+ xCancelBtn = xFunctionDlg.getChild("cancel")
+ xCancelBtn.executeAction("CLICK", tuple())
+
+ ui_test.close_doc()
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab: */