diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-22 06:02:55 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-22 18:19:34 +0200 |
commit | fb821500ed026cfddae99c3695660556c75002d3 (patch) | |
tree | 671430795e5bf2c57ec43cbe921690794b870106 /uitest/impress_tests | |
parent | 19e380cfd980233b71915f34a1ba83d24bd5303e (diff) |
uitest: convert the impress test to the new python unittest framework
Change-Id: I7a5cf03daac1b0426672a9d6611aa4cab4aaf91c
Diffstat (limited to 'uitest/impress_tests')
-rw-r--r-- | uitest/impress_tests/impress_demo.txt | 4 | ||||
-rw-r--r-- | uitest/impress_tests/start.py | 105 |
2 files changed, 46 insertions, 63 deletions
diff --git a/uitest/impress_tests/impress_demo.txt b/uitest/impress_tests/impress_demo.txt deleted file mode 100644 index fb38b1411e01..000000000000 --- a/uitest/impress_tests/impress_demo.txt +++ /dev/null @@ -1,4 +0,0 @@ -impress_tests.start.start_impress -impress_tests.start.select_page -impress_tests.start.select_text -impress_tests.start.select_object diff --git a/uitest/impress_tests/start.py b/uitest/impress_tests/start.py index 5b0dfdbd88a1..28a3c749987f 100644 --- a/uitest/impress_tests/start.py +++ b/uitest/impress_tests/start.py @@ -9,6 +9,8 @@ from uitest_helper import UITest, get_state_as_dict from helper import mkPropertyValues +from UITestCase import UITestCase + import time try: @@ -21,94 +23,79 @@ except ImportError: print("URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc") raise -def start_impress(xContext): - xUITest = xContext.ServiceManager.createInstanceWithContext( - "org.libreoffice.uitest.UITest", xContext) - - ui_test = UITest(xUITest, xContext) - - ui_test.create_doc_in_start_center("impress") - - xImpressDoc = xUITest.getTopFocusWindow() - print(get_state_as_dict(xImpressDoc)) - print(xImpressDoc.getChildren()) - - xEditWin = xImpressDoc.getChild("impress_win") - xEditWin.executeAction("SET", mkPropertyValues({"ZOOM": "200"})) +class SimpleImpressTest(UITestCase): + def test_start_impress(self): - print(xEditWin.getChildren()) + self.ui_test.create_doc_in_start_center("impress") - time.sleep(1) + xImpressDoc = self.xUITest.getTopFocusWindow() + print(get_state_as_dict(xImpressDoc)) + print(xImpressDoc.getChildren()) - ui_test.close_doc() + xEditWin = xImpressDoc.getChild("impress_win") + xEditWin.executeAction("SET", mkPropertyValues({"ZOOM": "200"})) -def select_page(xContext): - xUITest = xContext.ServiceManager.createInstanceWithContext( - "org.libreoffice.uitest.UITest", xContext) + print(xEditWin.getChildren()) - ui_test = UITest(xUITest, xContext) + time.sleep(1) - ui_test.create_doc_in_start_center("impress") + self.ui_test.close_doc() - xImpressDoc = xUITest.getTopFocusWindow() - print(get_state_as_dict(xImpressDoc)) - print(xImpressDoc.getChildren()) + def test_select_page(self): - xEditWin = xImpressDoc.getChild("impress_win") + self.ui_test.create_doc_in_start_center("impress") - time.sleep(1) - print(get_state_as_dict(xEditWin)) + xImpressDoc = self.xUITest.getTopFocusWindow() + print(get_state_as_dict(xImpressDoc)) + print(xImpressDoc.getChildren()) - xEditWin.executeAction("GOTO", mkPropertyValues({"PAGE": "2"})) + xEditWin = xImpressDoc.getChild("impress_win") - time.sleep(1) + time.sleep(1) + print(get_state_as_dict(xEditWin)) - print(get_state_as_dict(xEditWin)) + xEditWin.executeAction("GOTO", mkPropertyValues({"PAGE": "2"})) - ui_test.close_doc() + time.sleep(1) -def select_text(xContext): - xUITest = xContext.ServiceManager.createInstanceWithContext( - "org.libreoffice.uitest.UITest", xContext) + print(get_state_as_dict(xEditWin)) - ui_test = UITest(xUITest, xContext) + self.ui_test.close_doc() - ui_test.create_doc_in_start_center("impress") + def test_select_text(self): - xImpressDoc = xUITest.getTopFocusWindow() - print(get_state_as_dict(xImpressDoc)) - print(xImpressDoc.getChildren()) + self.ui_test.create_doc_in_start_center("impress") - xEditWin = xImpressDoc.getChild("impress_win") + xImpressDoc = self.xUITest.getTopFocusWindow() + print(get_state_as_dict(xImpressDoc)) + print(xImpressDoc.getChildren()) - time.sleep(1) + xEditWin = xImpressDoc.getChild("impress_win") - print(get_state_as_dict(xEditWin)) + time.sleep(1) - ui_test.close_doc() + print(get_state_as_dict(xEditWin)) -def select_object(xContext): - xUITest = xContext.ServiceManager.createInstanceWithContext( - "org.libreoffice.uitest.UITest", xContext) + self.ui_test.close_doc() - ui_test = UITest(xUITest, xContext) + def test_select_object(self): - ui_test.create_doc_in_start_center("impress") + self.ui_test.create_doc_in_start_center("impress") - xImpressDoc = xUITest.getTopFocusWindow() - print(get_state_as_dict(xImpressDoc)) - print(xImpressDoc.getChildren()) + xImpressDoc = self.xUITest.getTopFocusWindow() + print(get_state_as_dict(xImpressDoc)) + print(xImpressDoc.getChildren()) - xEditWin = xImpressDoc.getChild("impress_win") + xEditWin = xImpressDoc.getChild("impress_win") - xEditWin.executeAction("SELECT", mkPropertyValues({"OBJECT":"Unnamed Drawinglayer object 1"})) - time.sleep(1) - xEditWin.executeAction("DESELECT", tuple()) + xEditWin.executeAction("SELECT", mkPropertyValues({"OBJECT":"Unnamed Drawinglayer object 1"})) + time.sleep(1) + xEditWin.executeAction("DESELECT", tuple()) - time.sleep(1) + time.sleep(1) - print(get_state_as_dict(xEditWin)) + print(get_state_as_dict(xEditWin)) - ui_test.close_doc() + self.ui_test.close_doc() # vim:set shiftwidth=4 softtabstop=4 expandtab: */ |