diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-22 05:46:59 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-22 18:19:34 +0200 |
commit | d8b376adba93a48e77ec9e81c96744d1e4997d88 (patch) | |
tree | c590c099c572bca67af66bd9b33236887ce5a0d1 /uitest/calc_tests/gridwindow.py | |
parent | 4fa28812f3574efaca42769e9e4ff28f7d545bd8 (diff) |
uitest: convert all calc demos to the unittest based approach
Change-Id: I6ad7898f92c74f37ed2936337d6570904860d535
Diffstat (limited to 'uitest/calc_tests/gridwindow.py')
-rw-r--r-- | uitest/calc_tests/gridwindow.py | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/uitest/calc_tests/gridwindow.py b/uitest/calc_tests/gridwindow.py index 1f01ec9d8622..1b63fe544fee 100644 --- a/uitest/calc_tests/gridwindow.py +++ b/uitest/calc_tests/gridwindow.py @@ -11,6 +11,8 @@ from helper import mkPropertyValues from uihelper.calc import enter_text_to_cell +from UITestCase import UITestCase + import time try: @@ -23,43 +25,37 @@ except ImportError: print("URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc") raise -def input(xContext): - xUITest = xContext.ServiceManager.createInstanceWithContext( - "org.libreoffice.uitest.UITest", xContext) - - ui_test = UITest(xUITest, xContext) +class GridWindowTest(UITestCase): - ui_test.create_doc_in_start_center("calc") - xTopWindow = xUITest.getTopFocusWindow() + def test_input(self): - xGridWindow = xTopWindow.getChild("grid_window") + self.ui_test.create_doc_in_start_center("calc") + xTopWindow = self.xUITest.getTopFocusWindow() - enter_text_to_cell(xGridWindow, "C3", "=A1") - enter_text_to_cell(xGridWindow, "A1", "2") + xGridWindow = xTopWindow.getChild("grid_window") - time.sleep(2) + enter_text_to_cell(xGridWindow, "C3", "=A1") + enter_text_to_cell(xGridWindow, "A1", "2") - ui_test.close_doc() + time.sleep(2) -def special_keys(xContext): - xUITest = xContext.ServiceManager.createInstanceWithContext( - "org.libreoffice.uitest.UITest", xContext) + self.ui_test.close_doc() - ui_test = UITest(xUITest, xContext) + def test_special_keys(self): - ui_test.create_doc_in_start_center("calc") - xTopWindow = xUITest.getTopFocusWindow() + self.ui_test.create_doc_in_start_center("calc") + xTopWindow = self.xUITest.getTopFocusWindow() - xGridWindow = xTopWindow.getChild("grid_window") + xGridWindow = xTopWindow.getChild("grid_window") - selectProps = mkPropertyValues({"CELL": "C3"}) - xGridWindow.executeAction("SELECT", selectProps) + selectProps = mkPropertyValues({"CELL": "C3"}) + xGridWindow.executeAction("SELECT", selectProps) - typeProps = mkPropertyValues({"KEYCODE": "CTRL+DOWN"}) - xGridWindow.executeAction("TYPE", typeProps) + typeProps = mkPropertyValues({"KEYCODE": "CTRL+DOWN"}) + xGridWindow.executeAction("TYPE", typeProps) - time.sleep(2) + time.sleep(2) - ui_test.close_doc() + self.ui_test.close_doc() # vim:set shiftwidth=4 softtabstop=4 expandtab: */ |