1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 from uitest
.framework
import UITestCase
8 from uitest
.uihelper
.common
import get_state_as_dict
9 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
11 class tdf91762(UITestCase
):
13 def test_tdf91762(self
):
14 self
.ui_test
.create_doc_in_start_center("impress")
15 xTemplateDlg
= self
.xUITest
.getTopFocusWindow()
16 xCancelBtn
= xTemplateDlg
.getChild("cancel")
17 self
.ui_test
.close_dialog_through_button(xCancelBtn
)
19 self
.xUITest
.executeCommand(".uno:AssignLayout?WhatLayout:long=1")
21 self
.ui_test
.execute_dialog_through_command(".uno:InsertTable")
22 xDialog
= self
.xUITest
.getTopFocusWindow()
23 self
.assertEqual('5', get_state_as_dict(xDialog
.getChild('columns'))['Text'])
24 self
.assertEqual('2', get_state_as_dict(xDialog
.getChild('rows'))['Text'])
25 xOkBtn
= xDialog
.getChild("ok")
26 self
.ui_test
.close_dialog_through_button(xOkBtn
)
28 document
= self
.ui_test
.get_component()
29 self
.assertEqual(1929, document
.DrawPages
[0].getByIndex(1).BoundRect
.Height
)
30 self
.assertEqual(25198, document
.DrawPages
[0].getByIndex(1).Size
.Width
)
31 self
.assertEqual(1923, document
.DrawPages
[0].getByIndex(1).Size
.Height
)
33 self
.assertEqual(1400, document
.DrawPages
[0].getByIndex(1).Position
.X
)
34 self
.assertEqual(3685, document
.DrawPages
[0].getByIndex(1).Position
.Y
)
36 xDoc
= self
.xUITest
.getTopFocusWindow()
37 xEdit
= xDoc
.getChild("impress_win")
39 xEdit
.executeAction("TYPE", mkPropertyValues({"TEXT":"test"}))
40 xEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
42 # tdf#138011: Without the fix in place, this test would have failed with
43 # AssertionError: 5494 != 3559
44 self
.assertEqual(5494, document
.DrawPages
[0].getByIndex(1).BoundRect
.Height
)
46 self
.ui_test
.close_doc()
48 # vim: set shiftwidth=4 softtabstop=4 expandtab: