tdf#116685: sw: Add UItest
Change-Id: I94d9adb86662e67e0334e9777721b4117b3b9c51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129664 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
parent
2b8fbd7256
commit
d8be929f4c
1 changed files with 29 additions and 0 deletions
|
@ -91,4 +91,33 @@ class sheetToTable(UITestCase):
|
|||
self.assertEqual(table.getCellByName("A3").getString(), "Test 3")
|
||||
self.assertEqual(table.getCellByName("A4").getString(), "Test 4")
|
||||
|
||||
def test_tdf116685(self):
|
||||
with self.ui_test.create_doc_in_start_center("calc"):
|
||||
|
||||
xCalcDoc = self.xUITest.getTopFocusWindow()
|
||||
gridwin = xCalcDoc.getChild("grid_window")
|
||||
|
||||
enter_text_to_cell(gridwin, "A1", "Test 1")
|
||||
enter_text_to_cell(gridwin, "A2", "Test 2")
|
||||
enter_text_to_cell(gridwin, "A3", "Test 3")
|
||||
enter_text_to_cell(gridwin, "A4", "Test 4")
|
||||
|
||||
self.xUITest.executeCommand(".uno:SelectAll")
|
||||
self.xUITest.executeCommand(".uno:Copy")
|
||||
|
||||
with self.ui_test.load_empty_file("writer") as writer_doc:
|
||||
xWriterDoc = self.xUITest.getTopFocusWindow()
|
||||
|
||||
self.xUITest.executeCommand(".uno:Paste")
|
||||
|
||||
# Without the fix in place, this test would have failed with
|
||||
# AssertionError: 0 != 1
|
||||
self.assertEqual(writer_doc.TextTables.getCount(), 1)
|
||||
table = writer_doc.getTextTables()[0]
|
||||
self.assertEqual(len(table.getRows()), 4)
|
||||
self.assertEqual(table.getCellByName("A1").getString(), "Test 1")
|
||||
self.assertEqual(table.getCellByName("A2").getString(), "Test 2")
|
||||
self.assertEqual(table.getCellByName("A3").getString(), "Test 3")
|
||||
self.assertEqual(table.getCellByName("A4").getString(), "Test 4")
|
||||
|
||||
# vim: set shiftwidth=4 softtabstop=4 expandtab:
|
Loading…
Reference in a new issue