Kaydet (Commit) fb821500 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

uitest: convert the impress test to the new python unittest framework

Change-Id: I7a5cf03daac1b0426672a9d6611aa4cab4aaf91c
üst 19e380cf
impress_tests.start.start_impress
impress_tests.start.select_page
impress_tests.start.select_text
impress_tests.start.select_object
......@@ -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: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment