Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / uitest / writer_tests / tdf87199.py
blobd98761de29c1ae97417cce9ccdf1b78735377cb3
2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 from uitest.framework import UITestCase
9 class tdf87199(UITestCase):
11 def insertTextIntoCell(self, table, cellName, text ):
12 tableText = table.getCellByName( cellName )
13 tableText.setString( text )
15 def test_merge_column(self):
17 self.ui_test.create_doc_in_start_center("writer")
19 self.ui_test.execute_dialog_through_command(".uno:InsertTable")
21 xInsertDlg = self.xUITest.getTopFocusWindow()
24 xColSpin = xInsertDlg.getChild("colspin")
25 xColSpin.executeAction("DOWN", tuple())
27 xOkBtn = xInsertDlg.getChild("ok")
28 xOkBtn.executeAction("CLICK", tuple())
30 document = self.ui_test.get_component()
32 tables = document.getTextTables()
33 self.assertEqual(len(tables[0].getRows()), 2)
34 self.assertEqual(len(tables[0].getColumns()), 1)
36 self.insertTextIntoCell(tables[0], "A1", "test" )
37 self.insertTextIntoCell(tables[0], "A2", "test" )
39 cursor = tables[0].getCellByName( "A1" ).createTextCursor()
41 self.xUITest.executeCommand(".uno:EntireColumn")
43 self.xUITest.executeCommand(".uno:MergeCells")
45 tables = document.getTextTables()
46 self.assertEqual(len(tables[0].getRows()), 1)
47 self.assertEqual(len(tables[0].getColumns()), 1)
49 self.xUITest.executeCommand(".uno:Undo")
51 self.assertEqual(len(tables[0].getRows()), 2)
52 self.assertEqual(len(tables[0].getColumns()), 1)
54 self.ui_test.close_doc()
56 # vim: set shiftwidth=4 softtabstop=4 expandtab: