sc/qa/uitest/calc_tests7/tdf137397.py | 49 ++++++++++++++++++++++++++++++++++ sc/qa/uitest/data/tdf137397.ods |binary 2 files changed, 49 insertions(+)
New commits: commit a930f12c30f31d306ba60c5344cd8308d9fa4ee1 Author: Xisco Fauli <[email protected]> AuthorDate: Wed Nov 18 13:58:54 2020 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Wed Nov 18 21:20:26 2020 +0100 tdf#137397: sc: Add UItest Change-Id: I53530cc74dadae79b674d98076b92489a0508680 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106057 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> 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 Binary files /dev/null and b/sc/qa/uitest/data/tdf137397.ods differ _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
