Debian Codegraph @

sd/qa/uitest/impress_tests/dimensionLinesTabPage.py

raw
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
2 #
3 # This file is part of the LibreOffice project.
4 #
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 #
9
10 from uitest.framework import UITestCase
11 from uitest.uihelper.common import get_state_as_dict
12 from libreoffice.uno.propertyvalue import mkPropertyValues
13
14 class dimensionLinesTabPage(UITestCase):
15
16 def test_tdf171746_number_decimal_places_limit(self):
17 with self.ui_test.create_doc_in_start_center("draw"):
18 # Insert a dimension line using CTRL key
19 xArgs = mkPropertyValues({"KeyModifier": 8192})
20 self.xUITest.executeCommandWithParameters(".uno:MeasureLine", xArgs)
21
22 # Open the dimension lines tab page
23 with self.ui_test.execute_dialog_through_command(".uno:measureAttributes") as xDialog:
24 # Increase decimal places 5 times (starting from default = 2)
25 xDecimalPlaces = xDialog.getChild("MTR_FLD_DECIMALPLACES")
26 for _ in range(5):
27 xDecimalPlaces.executeAction("UP", tuple())
28 # Without the fix in place, this test would have failed with
29 # AssertionError: '5' != '7'
30 self.assertEqual(get_state_as_dict(xDecimalPlaces)["Text"], "5")
31
32 # vim: set shiftwidth=4 softtabstop=4 expandtab: