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
11 from uitest
.path
import get_srcdir_url
13 def get_url_for_data_file(file_name
):
14 return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name
16 class tdf79569(UITestCase
):
18 def test_tdf81457_table_merge_undo(self
):
19 writer_doc
= self
.ui_test
.load_file(get_url_for_data_file("tdf79569.doc"))
20 xWriterDoc
= self
.xUITest
.getTopFocusWindow()
21 xWriterEdit
= xWriterDoc
.getChild("writer_edit")
22 document
= self
.ui_test
.get_component()
23 self
.xUITest
.executeCommand(".uno:GoDown")
24 self
.xUITest
.executeCommand(".uno:GoDown")
25 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+END"}))
26 self
.xUITest
.executeCommand(".uno:GoRight")
27 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+END"}))
28 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "SHIFT+RIGHT"}))
29 self
.xUITest
.executeCommand(".uno:MergeCells")
30 self
.xUITest
.executeCommand(".uno:Undo")
31 self
.xUITest
.executeCommand(".uno:Redo")
32 self
.xUITest
.executeCommand(".uno:Undo")
34 self
.assertEqual(document
.TextTables
.getCount(), 1)
36 self
.ui_test
.close_doc()
38 # vim: set shiftwidth=4 softtabstop=4 expandtab: