Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sd / qa / uitest / impress_tests / tdf119246.py
blob5461f714d9ff520ec8082b7a2d0b8cb542e2a3fc
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This file is part of the LibreOffice project.
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/.
10 from uitest.framework import UITestCase
11 from uitest.uihelper.common import get_state_as_dict
12 from libreoffice.uno.propertyvalue import mkPropertyValues
13 from uitest.uihelper.common import change_measurement_unit
14 from uitest.uihelper.common import get_url_for_data_file
16 class tdf119246(UITestCase):
18 def test_tdf119246(self):
19 with self.ui_test.load_file(get_url_for_data_file("tdf119246.odp")) as document:
21 with change_measurement_unit(self, "Centimeter"):
23 xImpressDoc = self.xUITest.getTopFocusWindow()
25 self.assertIsNone(document.CurrentSelection)
27 xEditWin = xImpressDoc.getChild("impress_win")
28 xEditWin.executeAction("SELECT", mkPropertyValues({"OBJECT":"DimensionShape"}))
29 self.assertEqual("com.sun.star.drawing.SvxShapeCollection", document.CurrentSelection.getImplementationName())
31 with self.ui_test.execute_dialog_through_command(".uno:MeasureAttributes") as xDialog:
32 xLineDist = xDialog.getChild('MTR_LINE_DIST')
33 xGuideOvergang = xDialog.getChild('MTR_FLD_HELPLINE_OVERHANG')
34 xGuideDist = xDialog.getChild('MTR_FLD_HELPLINE_DIST')
35 xLeftDist = xDialog.getChild('MTR_FLD_HELPLINE1_LEN')
36 xRightDist = xDialog.getChild('MTR_FLD_HELPLINE2_LEN')
37 xDecimalPlace = xDialog.getChild('MTR_FLD_DECIMALPLACES')
39 # Without the fix in place, this test would have failed with
40 # AssertionError: '2.80 cm' != '1.00 cm'
41 self.assertEqual("2.80 cm", get_state_as_dict(xLineDist)['Text'])
42 self.assertEqual("0.20 cm", get_state_as_dict(xGuideOvergang)['Text'])
43 self.assertEqual("0.50 cm", get_state_as_dict(xGuideDist)['Text'])
44 self.assertEqual("4.00 cm", get_state_as_dict(xLeftDist)['Text'])
45 self.assertEqual("-1.40 cm", get_state_as_dict(xRightDist)['Text'])
46 self.assertEqual("2", get_state_as_dict(xDecimalPlace)['Text'])
48 # vim: set shiftwidth=4 softtabstop=4 expandtab: