summaryrefslogtreecommitdiffstats
path: root/sc/qa/uitest/calc_tests2/tdf127113.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
commited5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch)
tree7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /sc/qa/uitest/calc_tests2/tdf127113.py
parentInitial commit. (diff)
downloadlibreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.tar.xz
libreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.zip
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sc/qa/uitest/calc_tests2/tdf127113.py')
-rw-r--r--sc/qa/uitest/calc_tests2/tdf127113.py58
1 files changed, 58 insertions, 0 deletions
diff --git a/sc/qa/uitest/calc_tests2/tdf127113.py b/sc/qa/uitest/calc_tests2/tdf127113.py
new file mode 100644
index 000000000..daab2f521
--- /dev/null
+++ b/sc/qa/uitest/calc_tests2/tdf127113.py
@@ -0,0 +1,58 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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.calc.document import get_cell_by_position
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+class tdf127113(UITestCase):
+
+ def launch_dialog(self, direction):
+ with self.ui_test.execute_dialog_through_command(".uno:FillSeries") as xDialog:
+ xDirection = xDialog.getChild(direction)
+ xDirection.executeAction("CLICK", tuple())
+
+ xStart = xDialog.getChild("startValue")
+ xStart.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
+ self.assertEqual("1", get_state_as_dict(xStart)["Text"])
+
+ xEnd = xDialog.getChild("endValue")
+ xEnd.executeAction("TYPE", mkPropertyValues({"TEXT":"5"}))
+ self.assertEqual("5", get_state_as_dict(xEnd)["Text"])
+
+ # Without the fix in place, this test would have failed because the increment child
+ # couldn't be empty and a warning dialog would be displayed
+ xIncrement = xDialog.getChild("increment")
+ xIncrement.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xIncrement.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ self.assertEqual("", get_state_as_dict(xIncrement)["Text"])
+
+ def test_tdf127113(self):
+ with self.ui_test.create_doc_in_start_center("calc") as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A9"}))
+
+ self.launch_dialog("down")
+
+ value = 1.0
+ for i in range(9):
+ self.assertEqual(value, get_cell_by_position(calc_doc, 0, 0, i).getValue())
+ value += 0.5
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:B9"}))
+
+ self.launch_dialog("up")
+
+ for i in range(9):
+ value -= 0.5
+ self.assertEqual(value, get_cell_by_position(calc_doc, 0, 1, i).getValue())
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab: