diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-12-10 11:23:22 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-12-10 12:32:44 +0100 |
commit | e9640fd9d146527f26e66bb87a9d8a43cd161957 (patch) | |
tree | 1d1d2556293a6aff2d1531899da0ce401181de0d /sw/qa/uitest/table | |
parent | 3bc92f7458384f0a253f89eaddc38b11ebf4b66d (diff) |
tdf#129083: sw: Add UItest
Change-Id: I0d7999c53d8fbf7fc69543f636fb536f3e15141c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107518
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/uitest/table')
-rw-r--r-- | sw/qa/uitest/table/sheetToTable.py | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/sw/qa/uitest/table/sheetToTable.py b/sw/qa/uitest/table/sheetToTable.py index 08405c03fbf1..d14529d4af9e 100644 --- a/sw/qa/uitest/table/sheetToTable.py +++ b/sw/qa/uitest/table/sheetToTable.py @@ -9,6 +9,7 @@ from uitest.uihelper.common import get_state_as_dict from uitest.uihelper.common import select_pos from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_state_as_dict, type_text +from uitest.uihelper.calc import enter_text_to_cell import org.libreoffice.unotest import pathlib @@ -19,7 +20,6 @@ def get_url_for_data_file(file_name): class sheetToTable(UITestCase): def test_sheet_to_table_without_hidden_rows(self): - print(get_url_for_data_file("hiddenRow.ods")) calc_doc = self.ui_test.load_file(get_url_for_data_file("hiddenRow.ods")) xCalcDoc = self.xUITest.getTopFocusWindow() self.xUITest.executeCommand(".uno:SelectAll") @@ -42,7 +42,6 @@ class sheetToTable(UITestCase): self.ui_test.close_doc() def test_tdf138688(self): - print(get_url_for_data_file("hiddenRow.ods")) calc_doc = self.ui_test.load_file(get_url_for_data_file("hiddenRow.ods")) xCalcDoc = self.xUITest.getTopFocusWindow() self.xUITest.executeCommand(".uno:SelectAll") @@ -73,3 +72,36 @@ class sheetToTable(UITestCase): # This was "2 (hidden)" (copied hidden row) self.assertEqual(table.getCellByName("A2").getString(), "3") self.ui_test.close_doc() + + def test_tdf129083(self): + calc_doc = self.ui_test.create_doc_in_start_center("calc") + + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + + 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") + + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"})) + + self.xUITest.executeCommand(".uno:Copy") + + self.ui_test.close_doc() + + writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf129083.odt")) + document = self.ui_test.get_component() + xWriterDoc = self.xUITest.getTopFocusWindow() + + self.xUITest.executeCommand(".uno:Paste") + + self.assertEqual(document.TextTables.getCount(), 1) + table = document.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") + self.ui_test.close_doc() |