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
14 class tdf91762(UITestCase
):
16 def test_tdf91762(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
)
22 self
.xUITest
.executeCommand(".uno:AssignLayout?WhatLayout:long=1")
24 with self
.ui_test
.execute_dialog_through_command(".uno:InsertTable") as xDialog
:
25 self
.assertEqual('5', get_state_as_dict(xDialog
.getChild('columns'))['Text'])
26 self
.assertEqual('2', get_state_as_dict(xDialog
.getChild('rows'))['Text'])
28 self
.assertEqual(1961, document
.DrawPages
[0].getByIndex(1).BoundRect
.Height
)
29 self
.assertEqual(25198, document
.DrawPages
[0].getByIndex(1).Size
.Width
)
30 self
.assertEqual(1923, document
.DrawPages
[0].getByIndex(1).Size
.Height
)
32 self
.assertEqual(1400, document
.DrawPages
[0].getByIndex(1).Position
.X
)
33 self
.assertEqual(3685, document
.DrawPages
[0].getByIndex(1).Position
.Y
)
35 xDoc
= self
.xUITest
.getTopFocusWindow()
36 xEdit
= xDoc
.getChild("impress_win")
38 xEdit
.executeAction("TYPE", mkPropertyValues({"TEXT":"test"}))
39 xEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
41 # tdf#138011: Without the fix in place, it will be much lower
42 self
.assertEqual(5466, document
.DrawPages
[0].getByIndex(1).BoundRect
.Height
)
45 # vim: set shiftwidth=4 softtabstop=4 expandtab: