From 271dcc757d536718795f8c24a686a75424e90f23 Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Fri, 5 Jul 2019 15:36:30 +0545 Subject: 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 Reviewed-by: Zdenek Crhonek --- sw/qa/uitest/writer_tests5/columns.py | 2 +- sw/qa/uitest/writer_tests5/titlePage.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'sw/qa/uitest/writer_tests5') diff --git a/sw/qa/uitest/writer_tests5/columns.py b/sw/qa/uitest/writer_tests5/columns.py index 3c09ef02f789..b3bce59b2db5 100644 --- a/sw/qa/uitest/writer_tests5/columns.py +++ b/sw/qa/uitest/writer_tests5/columns.py @@ -64,7 +64,7 @@ class columns(UITestCase): self.assertEqual(get_state_as_dict(colsnf)["Text"], "2") self.assertEqual(get_state_as_dict(spacing1mf)["Text"], "1.00 cm") self.assertEqual(get_state_as_dict(autowidth)["Selected"], "false") - xOKBtn = xDialog.getChild("ok") + xOKBtn = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xOKBtn) self.ui_test.close_doc() diff --git a/sw/qa/uitest/writer_tests5/titlePage.py b/sw/qa/uitest/writer_tests5/titlePage.py index 4df2cb1f3a14..a1a3b02117b2 100644 --- a/sw/qa/uitest/writer_tests5/titlePage.py +++ b/sw/qa/uitest/writer_tests5/titlePage.py @@ -32,6 +32,13 @@ class titlePage(UITestCase): self.ui_test.close_dialog_through_button(xOKBtn) self.assertEqual(document.CurrentController.PageCount, 3) + # check cancel button + self.ui_test.execute_dialog_through_command(".uno:TitlePageDialog") + xDialog = self.xUITest.getTopFocusWindow() + xCancelBtn = xDialog.getChild("cancel") + self.ui_test.close_dialog_through_button(xCancelBtn) + self.assertEqual(document.CurrentController.PageCount, 3) + self.ui_test.close_doc() # vim: set shiftwidth=4 softtabstop=4 expandtab: -- cgit