summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-10-23 17:53:29 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-10-24 08:16:57 +0200
commitdad6851b1cb68fe8828230e4b59a08de05ae13a2 (patch)
tree25294a5664bbc9f095670756043bfe029f849d72 /sc/qa
parenta260bf6cc5ee1494e3aeacbf4f045a3fd4d3963e (diff)
tdf#104378: sc: Add UItest
Change-Id: I2258de72c3aae6b7d9aaa2c65c8c551384d84024 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104736 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/uitest/calc_dialogs/openDialogs.py3
-rw-r--r--sc/qa/uitest/calc_tests6/tdf104378.py36
2 files changed, 38 insertions, 1 deletions
diff --git a/sc/qa/uitest/calc_dialogs/openDialogs.py b/sc/qa/uitest/calc_dialogs/openDialogs.py
index a3bb7fb249bf..abf6857c02e1 100644
--- a/sc/qa/uitest/calc_dialogs/openDialogs.py
+++ b/sc/qa/uitest/calc_dialogs/openDialogs.py
@@ -139,7 +139,8 @@ dialogs = [
# {"command": ".uno:SpellDialog", "closeButton": "close"},
# an extra dialog appears
{"command": ".uno:Hyphenate", "closeButton": "cancel"},
- {"command": ".uno:ChineseConversion", "closeButton": "cancel"},
+ #{"command": ".uno:ChineseConversion", "closeButton": "cancel"},
+ # tested in sc/qa/uitest/calc_tests6/tdf104378.py
# {"command": ".uno:AutoCorrectDlg", "closeButton": "cancel"},
# tested in sc/qa/uitest/calc_tests6/autocorrectOptions.py
{"command": ".uno:GoalSeekDialog", "closeButton": "cancel", "skipTestOK": True},
diff --git a/sc/qa/uitest/calc_tests6/tdf104378.py b/sc/qa/uitest/calc_tests6/tdf104378.py
new file mode 100644
index 000000000000..44c786019636
--- /dev/null
+++ b/sc/qa/uitest/calc_tests6/tdf104378.py
@@ -0,0 +1,36 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from uitest.uihelper.calc import enter_text_to_cell
+from libreoffice.calc.document import get_cell_by_position
+
+class tdf104378(UITestCase):
+
+ def test_tdf104378(self):
+ calc_doc = self.ui_test.create_doc_in_start_center("calc")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ enter_text_to_cell(gridwin, "A1", "遠程MySQL連接遠程MySQL連接遠程MySQL連接")
+
+ self.ui_test.execute_dialog_through_command(".uno:ChineseConversion")
+
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOKBtn = xDialog.getChild('ok')
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ document = self.ui_test.get_component()
+
+ # Without the fix in place, this test would have failed with
+ # - 远程MySQL連接遠程MySQL連接遠程MySQL連接
+ # + 远程MySQL连接远程MySQL连接远程MySQL连接
+ self.assertEqual(get_cell_by_position(
+ document, 0, 0, 0).getString(), "远程MySQL连接远程MySQL连接远程MySQL连接")
+
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab: