[Libreoffice-commits] core.git: sw/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Thu Sep 10 13:30:30 UTC 2020
sw/qa/uitest/writer_tests/tdf93068.py | 29 ++++++++++++++++++++++++++---
1 file changed, 26 insertions(+), 3 deletions(-)
New commits:
commit 6d790ba76991be3a01f40636fa3b9e220a8d73d8
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Sep 10 11:56:10 2020 +0200
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Sep 10 15:29:48 2020 +0200
tdf#135950: sw: Add UItest
I'm reusing the test for tdf#93068.
We already have other tests where the Character dialog
is used so a test only testing the dialog opens is
recurrent
Change-Id: I5b75be6a2b4ccef9a794be76f089a70ec0903665
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102369
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sw/qa/uitest/writer_tests/tdf93068.py b/sw/qa/uitest/writer_tests/tdf93068.py
index fb883d58a51b..a77b4e42da91 100644
--- a/sw/qa/uitest/writer_tests/tdf93068.py
+++ b/sw/qa/uitest/writer_tests/tdf93068.py
@@ -5,8 +5,6 @@
#
from uitest.framework import UITestCase
-import time
-from uitest.uihelper.common import get_state_as_dict, type_text
class tdf93068(UITestCase):
@@ -14,7 +12,22 @@ class tdf93068(UITestCase):
self.ui_test.create_doc_in_start_center("writer")
- xWriterDoc = self.xUITest.getTopFocusWindow()
+ document = self.ui_test.get_component()
+
+ self.xUITest.getTopFocusWindow()
+
+ # tdf#135950: Character dialog crashes if multiple cells in a
+ # table are selected
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+
+ self.xUITest.executeCommand(".uno:SelectAll")
+
+ # Check the table is selected
+ self.assertEqual("SwXTextTableCursor", document.CurrentSelection.getImplementationName())
self.ui_test.execute_dialog_through_command(".uno:FontDialog")
xFontDlg = self.xUITest.getTopFocusWindow()
@@ -33,4 +46,14 @@ class tdf93068(UITestCase):
xOKBtn = xFontDlg.getChild("ok")
self.ui_test.close_dialog_through_button(xOKBtn)
+ self.xUITest.getTopFocusWindow()
+
+ # Check the table is still selected after closing the dialog
+ self.assertEqual("SwXTextTableCursor", document.CurrentSelection.getImplementationName())
+
+ self.xUITest.executeCommand(".uno:GoDown")
+
+ # Check the table is no longer selected
+ self.assertNotEqual("SwXTextTableCursor", document.CurrentSelection.getImplementationName())
+
self.ui_test.close_doc()
More information about the Libreoffice-commits
mailing list