diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-07-16 23:43:50 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-07-17 00:21:31 +0200 |
commit | f260194ae283fde803c4cf30c913ecc0d9d10358 (patch) | |
tree | 4544d8d3d3baf14707d34771a77f8e3972735cc1 /uitest | |
parent | 997c7accd393bc665538403a5738ce1a626d9665 (diff) |
uitest: add some work to load several documents
Change-Id: If9bf0e88fd7b223f10c31e3b0ed357da2bc4f9b0
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/uitest/test.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/uitest/uitest/test.py b/uitest/uitest/test.py index 4eb8c846c050..c9c51f5ed2be 100644 --- a/uitest/uitest/test.py +++ b/uitest/uitest/test.py @@ -23,6 +23,27 @@ class UITest(object): self._xUITest = xUITest self._xContext = xContext + def get_desktop(self): + desktop = self._xContext.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", self._xContext) + return desktop + + def get_frames(self): + desktop = self.get_desktop() + frames = desktop.getFrames() + return frames + + def load_file(self, url): + desktop = self.get_desktop() + with EventListener(self._xContext, "OnLoad") as event: + component = desktop.loadComponentFromURL(url, "_default", 0, tuple()) + time_ = 0 + while time_ < 30: + if event.executed: + time.sleep(DEFAULT_SLEEP) + return component + time_ += DEFAULT_SLEEP + time.sleep(DEFAULT_SLEEP) + def execute_dialog_through_command(self, command): with EventListener(self._xContext, "DialogExecute") as event: self._xUITest.executeCommand(command) |