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 | |
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')
-rw-r--r-- | sc/Module_sc.mk | 2 | ||||
-rw-r--r-- | sc/UITest_calc_dialogs.mk (renamed from sc/UITest_dialogs.mk) | 8 | ||||
-rw-r--r-- | sc/qa/uitest/calc_dialogs/openDialogs.py (renamed from sc/qa/uitest/dialogs/openDialogs.py) | 26 |
3 files changed, 7 insertions, 29 deletions
diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk index 3b4cf0aa687f..50fc8c3d7b8c 100644 --- a/sc/Module_sc.mk +++ b/sc/Module_sc.mk @@ -253,7 +253,7 @@ $(eval $(call gb_Module_add_uicheck_targets,sc,\ UITest_chart \ UITest_pageFormat \ UITest_calc_tests8 \ - UITest_dialogs \ + UITest_calc_dialogs \ )) endif diff --git a/sc/UITest_dialogs.mk b/sc/UITest_calc_dialogs.mk index 9498a6cb9488..42ed785b6000 100644 --- a/sc/UITest_dialogs.mk +++ b/sc/UITest_calc_dialogs.mk @@ -7,13 +7,13 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_UITest_UITest,dialogs)) +$(eval $(call gb_UITest_UITest,calc_dialogs)) -$(eval $(call gb_UITest_add_modules,dialogs,$(SRCDIR)/sc/qa/uitest,\ - dialogs/ \ +$(eval $(call gb_UITest_add_modules,calc_dialogs,$(SRCDIR)/sc/qa/uitest,\ + calc_dialogs/ \ )) -$(eval $(call gb_UITest_set_defs,dialogs, \ +$(eval $(call gb_UITest_set_defs,calc_dialogs, \ TDOC="$(SRCDIR)/sc/qa/uitest/calc_tests/data" \ )) 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: |