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 /uitest/writer_tests | |
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 'uitest/writer_tests')
-rw-r--r-- | uitest/writer_tests/goToPage.py | 8 | ||||
-rw-r--r-- | uitest/writer_tests/insertBreakDialog.py | 13 | ||||
-rw-r--r-- | uitest/writer_tests/insertTableDialog.py | 9 | ||||
-rw-r--r-- | uitest/writer_tests/pageDialog.py | 10 |
4 files changed, 40 insertions, 0 deletions
diff --git a/uitest/writer_tests/goToPage.py b/uitest/writer_tests/goToPage.py index 63a21f04d840..d20f042dfb9a 100644 --- a/uitest/writer_tests/goToPage.py +++ b/uitest/writer_tests/goToPage.py @@ -37,4 +37,12 @@ class GoToPage_dialog(UITestCase): self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "3") + # check cancel button + self.ui_test.execute_dialog_through_command(".uno:GotoPage") + xDialog = self.xUITest.getTopFocusWindow() + xCancelBtn = xDialog.getChild("cancel") + self.ui_test.close_dialog_through_button(xCancelBtn) + + self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "3") + self.ui_test.close_doc() diff --git a/uitest/writer_tests/insertBreakDialog.py b/uitest/writer_tests/insertBreakDialog.py index 1ec61aff2368..291ffdac53b4 100644 --- a/uitest/writer_tests/insertBreakDialog.py +++ b/uitest/writer_tests/insertBreakDialog.py @@ -69,4 +69,17 @@ class WriterInsertBreakDialog(UITestCase): self.ui_test.close_doc() + def test_cancel_button_insert_line_break_dialog(self): + + self.ui_test.create_doc_in_start_center("writer") + + self.ui_test.execute_dialog_through_command(".uno:InsertBreak") + xDialog = self.xUITest.getTopFocusWindow() + xCancelBtn = xDialog.getChild("cancel") + self.ui_test.close_dialog_through_button(xCancelBtn) + + self.getPages(1) + + self.ui_test.close_doc() + # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/uitest/writer_tests/insertTableDialog.py b/uitest/writer_tests/insertTableDialog.py index 60bd9d3342a6..60d427954a4c 100644 --- a/uitest/writer_tests/insertTableDialog.py +++ b/uitest/writer_tests/insertTableDialog.py @@ -118,4 +118,13 @@ class WriterInsertTableDialog(UITestCase): self.ui_test.close_doc() + def test_cancel_button_insert_line_break_dialog(self): + self.ui_test.create_doc_in_start_center("writer") + self.ui_test.execute_dialog_through_command(".uno:InsertTable") + Dialog = self.xUITest.getTopFocusWindow() + CancelBtn = Dialog.getChild("cancel") + self.ui_test.close_dialog_through_button(CancelBtn) + + self.ui_test.close_doc() + # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/uitest/writer_tests/pageDialog.py b/uitest/writer_tests/pageDialog.py index 8165008d4f2b..233c269d891f 100644 --- a/uitest/writer_tests/pageDialog.py +++ b/uitest/writer_tests/pageDialog.py @@ -226,4 +226,14 @@ class WriterPageDialog(UITestCase): self.ui_test.close_doc() + def test_cancel_button_page_dialog(self): + self.ui_test.create_doc_in_start_center("writer") + + self.ui_test.execute_dialog_through_command(".uno:PageDialog") + xDialog = self.xUITest.getTopFocusWindow() + xCancelBtn = xDialog.getChild("cancel") + self.ui_test.close_dialog_through_button(xCancelBtn) + + self.ui_test.close_doc() + # vim: set shiftwidth=4 softtabstop=4 expandtab: |