summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-11-18 13:58:54 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2020-11-18 21:20:26 +0100
commita930f12c30f31d306ba60c5344cd8308d9fa4ee1 (patch)
treed7ee985fb5e15e0ed7180af08e14a6193db39642 /sc
parent4535e2291741bb9262ca274cb50f80a2618cdcc2 (diff)
tdf#137397: sc: Add UItest
Change-Id: I53530cc74dadae79b674d98076b92489a0508680 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106057 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/uitest/calc_tests7/tdf137397.py49
-rw-r--r--sc/qa/uitest/data/tdf137397.odsbin0 -> 8338 bytes
2 files changed, 49 insertions, 0 deletions
diff --git a/sc/qa/uitest/calc_tests7/tdf137397.py b/sc/qa/uitest/calc_tests7/tdf137397.py
new file mode 100644
index 000000000000..fe8b34a31d48
--- /dev/null
+++ b/sc/qa/uitest/calc_tests7/tdf137397.py
@@ -0,0 +1,49 @@
+# -*- 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.common import change_measurement_unit
+import org.libreoffice.unotest
+import pathlib
+
+def get_url_for_data_file(file_name):
+ return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+
+class tdf137397(UITestCase):
+
+ def test_tdf137397(self):
+
+ calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf137397.ods"))
+
+ change_measurement_unit(self, 'Centimeter')
+
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWin = xCalcDoc.getChild("grid_window")
+
+ xGridWin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Shape"}))
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+ xGridWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "TextPropertyPanel"}))
+
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+
+
+ self.ui_test.wait_until_child_is_available(xCalcDoc, 'selectwidth')
+ self.assertEqual(get_state_as_dict(xCalcDoc.getChild('selectwidth'))['Text'], '6.00 cm')
+
+ # Without the fix in place, this test would have failed with
+ # AssertionError: '-14,585,309.84 cm' != '2.00 cm'
+ self.ui_test.wait_until_child_is_available(xCalcDoc, 'selectheight')
+ self.assertEqual(get_state_as_dict(xCalcDoc.getChild('selectheight'))['Text'], '2.00 cm')
+
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/data/tdf137397.ods b/sc/qa/uitest/data/tdf137397.ods
new file mode 100644
index 000000000000..203484804872
--- /dev/null
+++ b/sc/qa/uitest/data/tdf137397.ods
Binary files differ