diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-01-21 23:16:19 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-01-22 00:41:28 +0100 |
commit | 86c8c775bbefe333d684e12c99855a3c1de68051 (patch) | |
tree | 8f7646371bfe5ef983b3fc181773bc3fd616a2ff /uitest | |
parent | b3d713e7be354712f8815c877eb3787ac38bdc11 (diff) |
tdf#118308: sc: Add UItest
Change-Id: I4d23b4eda9ab3333eb0c062259601ba9bfb2179d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109775
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/uitest/test.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/uitest/uitest/test.py b/uitest/uitest/test.py index 556fb511cc97..a746643638bf 100644 --- a/uitest/uitest/test.py +++ b/uitest/uitest/test.py @@ -66,10 +66,14 @@ class UITest(object): time_ += DEFAULT_SLEEP time.sleep(DEFAULT_SLEEP) - def load_file(self, url): + def load_file(self, url, eventName="OnLoad"): + target = "_default" + if eventName == "OnNew": + target = "_blank" + desktop = self.get_desktop() - with EventListener(self._xContext, "OnLoad") as event: - component = desktop.loadComponentFromURL(url, "_default", 0, tuple()) + with EventListener(self._xContext, eventName) as event: + component = desktop.loadComponentFromURL(url, target, 0, tuple()) time_ = 0 while time_ < MAX_WAIT: if event.executed: @@ -81,6 +85,10 @@ class UITest(object): time_ += DEFAULT_SLEEP time.sleep(DEFAULT_SLEEP) + def load_empty_file(self, app): + url = "private:factory/s" + app + return self.load_file(url, "OnNew") + def execute_dialog_through_command(self, command, printNames=False): with EventListener(self._xContext, "DialogExecute", printNames=printNames) as event: if not self._xUITest.executeDialog(command): @@ -149,7 +157,6 @@ class UITest(object): if event.executed: frames = self.get_frames() self.get_desktop().setActiveFrame(frames[0]) - print(len(frames)) return time_ += DEFAULT_SLEEP time.sleep(DEFAULT_SLEEP) |