From 3da8806e079c8fa75330100e5c17658b4f7e79a0 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Thu, 29 Sep 2016 17:03:06 +0200 Subject: 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 --- uitest/libreoffice/calc/conditional_format.py | 14 ++++++++++++++ uitest/libreoffice/calc/document.py | 11 +++++++++++ 2 files changed, 25 insertions(+) create mode 100644 uitest/libreoffice/calc/conditional_format.py create mode 100644 uitest/libreoffice/calc/document.py (limited to 'uitest') 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: */ -- cgit v1.2.3