diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-22 05:57:06 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-22 18:19:34 +0200 |
commit | 19e380cfd980233b71915f34a1ba83d24bd5303e (patch) | |
tree | 8f70893172995635f070830baab037eb6622deb4 /uitest/demo_ui/gridwin.py | |
parent | d8b376adba93a48e77ec9e81c96744d1e4997d88 (diff) |
uitest: move the demo ui tests to the new unittest approach
Change-Id: I70222d701191f28f9dffb3bfdfbb7510d64d0251
Diffstat (limited to 'uitest/demo_ui/gridwin.py')
-rw-r--r-- | uitest/demo_ui/gridwin.py | 60 |
1 files changed, 26 insertions, 34 deletions
diff --git a/uitest/demo_ui/gridwin.py b/uitest/demo_ui/gridwin.py index 4ca63ac8b2ae..5c2fae90b14d 100644 --- a/uitest/demo_ui/gridwin.py +++ b/uitest/demo_ui/gridwin.py @@ -9,6 +9,8 @@ from uitest_helper import UITest from helper import mkPropertyValues +from UITestCase import UITestCase + import time try: @@ -21,53 +23,43 @@ except ImportError: print("URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc") raise -def select_cell(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") +class GridWinTest(UITestCase): - selectProps = mkPropertyValues({"CELL": "B10"}) - xGridWindow.executeAction("SELECT", selectProps) + def test_select_cell(self): - ui_test.close_doc() + self.ui_test.create_doc_in_start_center("calc") + xCalcDoc = self.xUITest.getTopFocusWindow() + xGridWindow = xCalcDoc.getChild("grid_window") -def select_range(xContext): - xUITest = xContext.ServiceManager.createInstanceWithContext( - "org.libreoffice.uitest.UITest", xContext) + selectProps = mkPropertyValues({"CELL": "B10"}) + xGridWindow.executeAction("SELECT", selectProps) - ui_test = UITest(xUITest, xContext) + self.ui_test.close_doc() - ui_test.create_doc_in_start_center("calc") - xCalcDoc = xUITest.getTopFocusWindow() - xGridWindow = xCalcDoc.getChild("grid_window") + def test_select_range(self): - selectProps = mkPropertyValues({"RANGE": "B10:C20"}) - xGridWindow.executeAction("SELECT", selectProps) + self.ui_test.create_doc_in_start_center("calc") + xCalcDoc = self.xUITest.getTopFocusWindow() + xGridWindow = xCalcDoc.getChild("grid_window") - ui_test.close_doc() + selectProps = mkPropertyValues({"RANGE": "B10:C20"}) + xGridWindow.executeAction("SELECT", selectProps) -def extend_range(xContext): - xUITest = xContext.ServiceManager.createInstanceWithContext( - "org.libreoffice.uitest.UITest", xContext) + self.ui_test.close_doc() - ui_test = UITest(xUITest, xContext) + def test_extend_range(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({"RANGE": "B10:C20"}) - xGridWindow.executeAction("SELECT", selectProps) + selectProps = mkPropertyValues({"RANGE": "B10:C20"}) + xGridWindow.executeAction("SELECT", selectProps) - select2Props = mkPropertyValues({"RANGE": "D3:F5", "EXTEND": "true"}) - xGridWindow.executeAction("SELECT", select2Props) + select2Props = mkPropertyValues({"RANGE": "D3:F5", "EXTEND": "true"}) + xGridWindow.executeAction("SELECT", select2Props) - ui_test.close_doc() + self.ui_test.close_doc() # vim:set shiftwidth=4 softtabstop=4 expandtab: */ |