summaryrefslogtreecommitdiff
path: root/uitest/uitest
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-06-26 01:41:17 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-06-26 03:28:08 +0200
commit97ad8133644d8eb7678aa3c180f3d8f9247a0d90 (patch)
treea8f4eefeba05a63c4c76b266686d2a4c8c4f6a5d /uitest/uitest
parentc924baf95fe47ea642924b3bc47cd81bf4e89d10 (diff)
uitest: bring some order into the file mess
The uitest/uitest directory will be used for the actual uitest framework. The libreoffice directory should contain any common LibreOffice related code. Change-Id: I3f6394ff4be83b89a8764eab10a154e755237d35
Diffstat (limited to 'uitest/uitest')
-rw-r--r--uitest/uitest/framework.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/uitest/uitest/framework.py b/uitest/uitest/framework.py
new file mode 100644
index 000000000000..a6f804b84187
--- /dev/null
+++ b/uitest/uitest/framework.py
@@ -0,0 +1,36 @@
+# -*- 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 unittest
+import time
+
+from uitest_helper import UITest
+
+from libreoffice.connection import PersistentConnection, OfficeConnection
+
+class UITestCase(unittest.TestCase):
+
+ def __init__(self, test_name, opts):
+ unittest.TestCase.__init__(self, test_name)
+ self.opts = opts
+
+ def setUp(self):
+ self.connection = PersistentConnection(self.opts)
+ self.connection.setUp()
+ self.xContext = self.connection.getContext()
+ self.xUITest = self.xContext.ServiceManager.createInstanceWithContext(
+ "org.libreoffice.uitest.UITest", self.xContext)
+
+ self.ui_test = UITest(self.xUITest, self.xContext)
+ self.startTime = time.time()
+
+ def tearDown(self):
+ t = time.time() - self.startTime
+ print("Execution time for %s: %.3f" % (self.id(), t))
+ self.connection.tearDown()
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab: */