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/.
8 from uitest
.framework
import UITestCase
9 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
10 from uitest
.debug
import sleep
12 class tdf53460(UITestCase
):
14 def test_resize_table_with_keyboard_tdf53460(self
):
16 self
.ui_test
.create_doc_in_start_center("writer")
17 xWriterDoc
= self
.xUITest
.getTopFocusWindow()
18 xWriterEdit
= xWriterDoc
.getChild("writer_edit")
19 document
= self
.ui_test
.get_component()
20 #-insert a table (by default 2x2)
21 self
.ui_test
.execute_dialog_through_command(".uno:InsertTable")
22 xDialog
= self
.xUITest
.getTopFocusWindow()
23 xOkBtn
= xDialog
.getChild("ok")
24 xOkBtn
.executeAction("CLICK", tuple())
26 #-put the cursor inside first cell top left for example
27 #-insert a inner table (by default 2x2) inside this cell
28 self
.ui_test
.execute_dialog_through_command(".uno:InsertTable")
29 xDialog
= self
.xUITest
.getTopFocusWindow()
30 xOkBtn
= xDialog
.getChild("ok")
31 xOkBtn
.executeAction("CLICK", tuple())
32 #-still in top left cell, go to the line after the inner table
33 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
34 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
35 #- <ALT>+up key => crash
36 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+UP"}))
37 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
38 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
39 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
40 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
41 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+LEFT"}))
43 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
44 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+UP"}))
45 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
46 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
47 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
48 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
49 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+LEFT"}))
51 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
52 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+UP"}))
53 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
54 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
55 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
56 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
57 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+LEFT"}))
59 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
60 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+UP"}))
61 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
62 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
63 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
64 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
65 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+LEFT"}))
67 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"}))
68 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"}))
69 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+UP"}))
70 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
71 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+DOWN"}))
72 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
73 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RIGHT"}))
74 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+LEFT"}))
76 self
.assertEqual(document
.TextTables
.getCount(), 2)
77 self
.ui_test
.close_doc()
78 # vim: set shiftwidth=4 softtabstop=4 expandtab: