summaryrefslogtreecommitdiff
path: root/uitest/calc_tests
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-05-05 00:50:52 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-06-18 17:02:00 +0200
commitce3d9d8d7ce80a8cc4a94e75b46666bd3f245483 (patch)
treecd97b24f97b710a46803f254fa8ccb9df092e2b9 /uitest/calc_tests
parent755a7b74b44a8dadc403f94dda0e3450df1daa17 (diff)
uitest: add demo for calc's gridwindow
Change-Id: I1a3bf7523d71e6bb3bf9d61859d8d5d2b275f95f
Diffstat (limited to 'uitest/calc_tests')
-rw-r--r--uitest/calc_tests/gridwindow.py58
1 files changed, 58 insertions, 0 deletions
diff --git a/uitest/calc_tests/gridwindow.py b/uitest/calc_tests/gridwindow.py
new file mode 100644
index 000000000000..4f9bcb573a56
--- /dev/null
+++ b/uitest/calc_tests/gridwindow.py
@@ -0,0 +1,58 @@
+# -*- 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/.
+#
+
+from uitest_helper import UITest
+
+from helper import mkPropertyValues
+
+import time
+
+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 select_cell(xContext):
+ xUITest = xContext.ServiceManager.createInstanceWithContext(
+ "org.libreoffice.uitest.UITest", xContext)
+
+ ui_test = UITest(xUITest, xContext)
+
+ ui_test.create_doc_in_start_center("calc")
+ xTopWindow = xUITest.getTopFocusWindow()
+
+ xGridWindow = xTopWindow.getChild("grid_window")
+
+ selectProps = mkPropertyValues({"CELL": "B10"})
+ xGridWindow.executeAction("SELECT", selectProps)
+
+ time.sleep(20)
+
+def select_range(xContext):
+ xUITest = xContext.ServiceManager.createInstanceWithContext(
+ "org.libreoffice.uitest.UITest", xContext)
+
+ ui_test = UITest(xUITest, xContext)
+
+ ui_test.create_doc_in_start_center("calc")
+ xTopWindow = xUITest.getTopFocusWindow()
+
+ xGridWindow = xTopWindow.getChild("grid_window")
+
+ time.sleep(1)
+
+ selectProps = mkPropertyValues({"RANGE": "B10:C20"})
+ xGridWindow.executeAction("SELECT", selectProps)
+
+ time.sleep(20)
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab: */