summaryrefslogtreecommitdiff
path: root/uitest
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-09-29 17:03:06 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-09-29 17:26:50 +0200
commit3da8806e079c8fa75330100e5c17658b4f7e79a0 (patch)
treee6dea937c31018037abc659fe8e1786fa143d0fe /uitest
parenta801155464cf479b3fbf30f27e3f51030d69ba14 (diff)
add helper methods to deal with Calc UNO
This is the third part of the UI Test tutorial. The code in uitest/libreoffice is generally useful UNO code that allows to interact with LibreOffice. This code should be independent of the UI testing framework and provide external developers a helpful starting point to writer python extensions. Change-Id: Ia1429577affd98dcf3f1aee3da3a7256499a1c78
Diffstat (limited to 'uitest')
-rw-r--r--uitest/libreoffice/calc/conditional_format.py14
-rw-r--r--uitest/libreoffice/calc/document.py11
2 files changed, 25 insertions, 0 deletions
diff --git a/uitest/libreoffice/calc/conditional_format.py b/uitest/libreoffice/calc/conditional_format.py
new file mode 100644
index 000000000000..adffc297410a
--- /dev/null
+++ b/uitest/libreoffice/calc/conditional_format.py
@@ -0,0 +1,14 @@
+# -*- 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/.
+#
+
+# this file provides methods to interact with the new conditional format API
+
+def get_conditional_format_from_sheet(sheet):
+ return sheet.getPropertyValue("ConditionalFormats")
+
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/uitest/libreoffice/calc/document.py b/uitest/libreoffice/calc/document.py
new file mode 100644
index 000000000000..356c5ec9954d
--- /dev/null
+++ b/uitest/libreoffice/calc/document.py
@@ -0,0 +1,11 @@
+# -*- 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/.
+#
+
+def get_sheet_from_doc(document, index):
+ return document.getSheets().getByIndex(index)
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab: */