Debian Codegraph @

sd/qa/uitest/impress_tests2/tdf91762.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 uitest.uihelper.common import get_state_as_dict
12 from libreoffice.uno.propertyvalue import mkPropertyValues
13
14 class tdf91762(UITestCase):
15
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)
21
22 self.xUITest.executeCommand(".uno:AssignLayout?WhatLayout:long=1")
23
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'])
27
28 self.assertEqual(1961, document.DrawPages[0][1].BoundRect.Height)
29 self.assertEqual(25198, document.DrawPages[0][1].Size.Width)
30 self.assertEqual(1923, document.DrawPages[0][1].Size.Height)
31
32 self.assertEqual(1400, document.DrawPages[0][1].Position.X)
33 self.assertEqual(3685, document.DrawPages[0][1].Position.Y)
34
35 xDoc = self.xUITest.getTopFocusWindow()
36 xEdit = xDoc.getChild("impress_win")
37 for i in range(5):
38 xEdit.executeAction("TYPE", mkPropertyValues({"TEXT":"test"}))
39 xEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
40
41 # tdf#138011: Without the fix in place, it will be much lower
42 self.assertEqual(5466, document.DrawPages[0][1].BoundRect.Height)
43
44
45 # vim: set shiftwidth=4 softtabstop=4 expandtab: