tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / sw / qa / uitest / writer_tests7 / tdf132169.py
blob134ee44864d14ad3eb11f979a7be6d539b05d3fd
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/.
9 from uitest.framework import UITestCase
10 from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, type_text
11 from uitest.uihelper.common import change_measurement_unit
13 class tdf132169(UITestCase):
14 def test_tdf132169(self):
16 with self.ui_test.load_file(get_url_for_data_file("shape.odt")) as writer_doc:
18 with change_measurement_unit(self, "Point"):
20 self.xUITest.executeCommand(".uno:JumpToNextFrame")
22 #wait until the toolbar is available
23 xLineMetric = self.ui_test.wait_until_child_is_available('metricfield')
24 self.assertEqual(get_state_as_dict(xLineMetric)["Text"], "0.0 pt")
26 #Check changing value from dialog also works
27 with self.ui_test.execute_dialog_through_command(".uno:FormatLine") as xFormatLineDlg:
28 xWidth = xFormatLineDlg.getChild('MTR_FLD_LINE_WIDTH')
29 type_text(xWidth, "4.0")
31 self.ui_test.wait_until_property_is_updated(xLineMetric, "Text", "4.0 pt")
32 self.assertEqual(get_state_as_dict(xLineMetric)["Text"], "4.0 pt")
34 xLineMetric.executeAction("UP", tuple())
36 shape = writer_doc.getDrawPages()[0][0]
38 #Without the fix in place, it would have been 310
39 self.assertEqual(shape.LineWidth, 176)
41 # vim: set shiftwidth=4 softtabstop=4 expandtab: