Debian Codegraph @

sd/qa/uitest/impress_tests2/tdf139511.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 libreoffice.uno.propertyvalue import mkPropertyValues
12 from uitest.uihelper.common import change_measurement_unit
13
14 class tdf139511(UITestCase):
15
16 def test_tdf139511(self):
17 with self.ui_test.create_doc_in_start_center("impress") as document:
18 xTemplateDlg = self.xUITest.getTopFocusWindow()
19 xCancelBtn = xTemplateDlg.getChild("close")
20 self.ui_test.close_dialog_through_button(xCancelBtn)
21
22 with change_measurement_unit(self, "Centimeter"):
23
24 self.xUITest.executeCommand(".uno:InsertTable?Columns:short=4&Rows:short=4")
25
26 self.assertEqual(3885, document.DrawPages[0][2].BoundRect.Height)
27 self.assertEqual(14136, document.DrawPages[0][2].BoundRect.Width)
28
29 with self.ui_test.execute_dialog_through_command(".uno:TransformDialog") as xDialog:
30
31
32 xWidth = xDialog.getChild('MTR_FLD_WIDTH')
33 xHeight = xDialog.getChild('MTR_FLD_HEIGHT')
34
35 xWidth.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"}))
36 xWidth.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"}))
37 xWidth.executeAction("TYPE", mkPropertyValues({"TEXT": "10"}))
38
39 xHeight.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"}))
40 xHeight.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"}))
41 xHeight.executeAction("TYPE", mkPropertyValues({"TEXT": "5"}))
42
43
44
45 # Without the fix in place, this test would have failed with
46 # AssertionError: 5037 != 8036
47 self.assertEqual(5037, document.DrawPages[0][2].BoundRect.Height)
48 self.assertEqual(10037, document.DrawPages[0][2].BoundRect.Width)
49
50
51 # vim: set shiftwidth=4 softtabstop=4 expandtab: