From ebbb900ea24e7db9b3956e24a8c5ba0263e62f03 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Fri, 20 May 2016 20:50:43 +0200 Subject: uitest: add initial writer demos Change-Id: If0aaf07b061fde3d5efa0d604af002efc872f726 --- uitest/writer_tests/start.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 uitest/writer_tests/start.py diff --git a/uitest/writer_tests/start.py b/uitest/writer_tests/start.py new file mode 100644 index 000000000000..65ca0edba578 --- /dev/null +++ b/uitest/writer_tests/start.py @@ -0,0 +1,44 @@ +# -*- 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 start_writer(xContext): + xUITest = xContext.ServiceManager.createInstanceWithContext( + "org.libreoffice.uitest.UITest", xContext) + + ui_test = UITest(xUITest, xContext) + + ui_test.create_doc_in_start_center("writer") + + xWriterDoc = xUITest.getTopFocusWindow() + print(xWriterDoc.getChildren()) + + xWriterEdit = xWriterDoc.getChild("writer_edit") + print(xWriterEdit.getState()) + + xWriterEdit.executeAction("SET", mkPropertyValues({"ZOOM": "200"})) + + time.sleep(2) + + ui_test.close_doc() + +# vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit