diff options
author | Artur Neumann <artur@jankaritech.com> | 2019-07-05 15:36:30 +0545 |
---|---|---|
committer | Zdenek Crhonek <zcrhonek@gmail.com> | 2019-07-26 08:18:22 +0200 |
commit | 271dcc757d536718795f8c24a686a75424e90f23 (patch) | |
tree | 49101f22cfecfb90b5a6aec3a435bd9d32a7d1f1 /sc/qa/uitest | |
parent | aef615ac9c69775bf51d5bf77d62686244f586af (diff) |
UI tests opening all dialogs in writer and see if it crashes
Open a dialog, close it by the given button e.g. "cancel" or "close".
If the dialog has an enabled "OK" button open the dialog again
and try to close it also using the OK button.
For every dialog a complete new document is opened to ensure test-separation,
otherwise one action could hamper the next action.
For dialogs that already have other tests a "cancel/close" test was added to
the previous test. As far as possible opening new documents was avoided in those
cases. And in some cases a simple check was added to check if the "cancel" button
does not change anything.
Simmilar tests for calc have been renamed and code dublication has been
removed by moving main part of the code to a helper file
Change-Id: I01f197cae8bc6fe0345661fe042b655f16229485
Reviewed-on: https://gerrit.libreoffice.org/75124
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
Diffstat (limited to 'sc/qa/uitest')
-rw-r--r-- | sc/qa/uitest/calc_dialogs/openDialogs.py (renamed from sc/qa/uitest/dialogs/openDialogs.py) | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/sc/qa/uitest/dialogs/openDialogs.py b/sc/qa/uitest/calc_dialogs/openDialogs.py index 341a9e1f9998..94a7ca916c14 100644 --- a/sc/qa/uitest/dialogs/openDialogs.py +++ b/sc/qa/uitest/calc_dialogs/openDialogs.py @@ -7,7 +7,7 @@ from uitest.framework import UITestCase import unittest -from uitest.uihelper.common import get_state_as_dict +from uitest.uihelper.testDialog import testDialog dialogs = [ {"command": ".uno:OpenRemote", "closeButton": "cancel"}, @@ -165,29 +165,7 @@ def load_tests(loader, tests, pattern): # the test only checks if calc crashes by opening the dialog, see e.g. tdf#120227, tdf#125985, tdf#125982 class openDialogs(UITestCase): def check(self, dialog): - calc_doc = self.ui_test.create_doc_in_start_center("calc") - self.ui_test.execute_dialog_through_command(dialog['command']) - xDialog = self.xUITest.getTopFocusWindow() - xCloseBtn = xDialog.getChild(dialog['closeButton']) - if 'skipTestOK' in dialog and dialog['skipTestOK'] == True: - xOKBtn = None - else: - try: - xOKBtn = xDialog.getChild("ok") - if (get_state_as_dict(xOKBtn)["Enabled"] != "true"): - xOKBtn = None - except: - xOKBtn = None - - self.ui_test.close_dialog_through_button(xCloseBtn) - if (xOKBtn != None): - print("check also OK button") - self.ui_test.execute_dialog_through_command(dialog['command']) - xDialog = self.xUITest.getTopFocusWindow() - xOKBtn = xDialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOKBtn) - self.ui_test.close_doc() - + testDialog(self, "calc", dialog) dialogCount = 0 for dialog in dialogs: |