summaryrefslogtreecommitdiff
path: root/sc/qa/uitest/calc_tests8
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-01-21 23:16:19 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-01-22 00:41:28 +0100
commit86c8c775bbefe333d684e12c99855a3c1de68051 (patch)
tree8f7646371bfe5ef983b3fc181773bc3fd616a2ff /sc/qa/uitest/calc_tests8
parentb3d713e7be354712f8815c877eb3787ac38bdc11 (diff)
tdf#118308: sc: Add UItest
Change-Id: I4d23b4eda9ab3333eb0c062259601ba9bfb2179d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109775 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa/uitest/calc_tests8')
-rw-r--r--sc/qa/uitest/calc_tests8/tdf118308.py58
1 files changed, 58 insertions, 0 deletions
diff --git a/sc/qa/uitest/calc_tests8/tdf118308.py b/sc/qa/uitest/calc_tests8/tdf118308.py
new file mode 100644
index 000000000000..313a2dc35ec8
--- /dev/null
+++ b/sc/qa/uitest/calc_tests8/tdf118308.py
@@ -0,0 +1,58 @@
+# -*- 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.common import get_state_as_dict
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.calc import enter_text_to_cell
+from libreoffice.calc.document import get_cell_by_position
+
+class tdf118308(UITestCase):
+
+ def test_tdf118308(self):
+ calc_doc = self.ui_test.create_doc_in_start_center("calc")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ enter_text_to_cell(gridwin, "A1", "A")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:Copy")
+
+ self.ui_test.close_doc()
+
+ calc_doc = self.ui_test.load_empty_file("calc")
+
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+
+ self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ # Without the fix in place, this test would have failed here
+ # since a different dialog would have been opened and the children
+ # wouldn't have been found
+ xText = xDialog.getChild("text")
+ xNumbers = xDialog.getChild("numbers")
+ xDatetime = xDialog.getChild("datetime")
+ xFormats = xDialog.getChild("formats")
+
+ self.assertEqual("true", get_state_as_dict(xText)["Selected"])
+ self.assertEqual("true", get_state_as_dict(xNumbers)["Selected"])
+ self.assertEqual("true", get_state_as_dict(xDatetime)["Selected"])
+ self.assertEqual("false", get_state_as_dict(xFormats)["Selected"])
+
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+
+ self.assertEqual("A", get_cell_by_position(document, 0, 0, 0).getString())
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
+