diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-07-16 23:44:17 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-07-17 00:21:31 +0200 |
commit | 5f5575f8c4f7766db0c7468a03ce1bed46821cfd (patch) | |
tree | 6284637b73f048e44a3d656d17cebd37cf813c01 /uitest | |
parent | f260194ae283fde803c4cf30c913ecc0d9d10358 (diff) |
uitest: add demo for handling two files
Change-Id: I03cbe67922df521a6cef5f3448c0c9dce10b662d
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/demo_ui/handle_multiple_files.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/uitest/demo_ui/handle_multiple_files.py b/uitest/demo_ui/handle_multiple_files.py new file mode 100644 index 000000000000..cc36baffdaf0 --- /dev/null +++ b/uitest/demo_ui/handle_multiple_files.py @@ -0,0 +1,41 @@ +# -*- 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/. +# + +from libreoffice.uno.propertyvalue import mkPropertyValues +from libreoffice.uno.eventlistener import EventListener + +from uitest.framework import UITestCase + +from uitest.debug import sleep + +import time + +class HandleFiles(UITestCase): + + def test_load_file(self): + + calc_file = self.ui_test.load_file("file:///home/moggi/devel/libo9/uitest/data/test.ods") + + calc_file2 = self.ui_test.load_file("file:///home/moggi/devel/libo9/uitest/data/test2.ods") + + frames = self.ui_test.get_frames() + self.assertEqual(len(frames), 2) + + self.ui_test.close_doc() + + frames = self.ui_test.get_frames() + self.assertEqual(len(frames), 1) + + # this is currently still necessary as otherwise + # the command is not forwarded to the correct frame + # TODO: provide an additional event that we can use + # and get rid of the sleep + time.sleep(1) + + self.ui_test.close_doc() + +# vim:set shiftwidth=4 softtabstop=4 expandtab: */ |