summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-09-10 11:56:10 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-09-10 15:29:48 +0200
commit6d790ba76991be3a01f40636fa3b9e220a8d73d8 (patch)
tree743cf3fc8938acc1dbf1ebcf8c9e4c98c7ccfe1c /sw
parent8b806dc8dc5671090b129a3c4b2cde7171114817 (diff)
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@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/uitest/writer_tests/tdf93068.py29
1 files changed, 26 insertions, 3 deletions
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()