From d8be929f4cbb2fe16a366ef146be29955715fa2f Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Tue, 8 Feb 2022 11:22:55 +0100 Subject: [PATCH] tdf#116685: sw: Add UItest Change-Id: I94d9adb86662e67e0334e9777721b4117b3b9c51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129664 Tested-by: Xisco Fauli Reviewed-by: Xisco Fauli --- sw/qa/uitest/table/sheetToTable.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/sw/qa/uitest/table/sheetToTable.py b/sw/qa/uitest/table/sheetToTable.py index a592ee217186..e90f65e9fa3f 100644 --- a/sw/qa/uitest/table/sheetToTable.py +++ b/sw/qa/uitest/table/sheetToTable.py @@ -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: \ No newline at end of file