diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-21 16:45:39 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-22 18:19:32 +0200 |
commit | 33d873b61f2b966c11019fc5e435b04aa0a1476d (patch) | |
tree | 6f54974e519c64a07bdbdaf7f6c35bb1f337b250 /uitest | |
parent | 2e2d4a326e25b460b0590d1cccb0ae2834743fc0 (diff) |
uitest: add tabcontrol demo
Change-Id: Ibcdf5c1a43ed943c22745545257d5d324ed139ec
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/demo_ui/demo_ui.txt | 1 | ||||
-rw-r--r-- | uitest/demo_ui/tabcontrol.py | 54 |
2 files changed, 55 insertions, 0 deletions
diff --git a/uitest/demo_ui/demo_ui.txt b/uitest/demo_ui/demo_ui.txt index 67600ef9433e..fb39558b49e3 100644 --- a/uitest/demo_ui/demo_ui.txt +++ b/uitest/demo_ui/demo_ui.txt @@ -6,6 +6,7 @@ demo_ui.gridwin.select_range demo_ui.gridwin.extend_range demo_ui.listbox.select_entry_pos demo_ui.listbox.select_entry_text +demo_ui.tabcontrol.select_pos demo_ui.tabdialog.select_tab_page_pos demo_ui.tabdialog.select_tab_page_name demo_ui.spinfield.up diff --git a/uitest/demo_ui/tabcontrol.py b/uitest/demo_ui/tabcontrol.py new file mode 100644 index 000000000000..b9d79adbf919 --- /dev/null +++ b/uitest/demo_ui/tabcontrol.py @@ -0,0 +1,54 @@ +# -*- 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 + +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_pos(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"})) + + time.sleep(1) + + xCancelBtn = xFunctionDlg.getChild("cancel") + xCancelBtn.executeAction("CLICK", tuple()) + + ui_test.close_doc() + +# vim:set shiftwidth=4 softtabstop=4 expandtab: */ + |