[Libreoffice-commits] core.git: sw/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Thu Dec 10 11:33:29 UTC 2020
sw/qa/uitest/data/tdf129083.odt |binary
sw/qa/uitest/table/sheetToTable.py | 36 ++++++++++++++++++++++++++++++++++--
2 files changed, 34 insertions(+), 2 deletions(-)
New commits:
commit e9640fd9d146527f26e66bb87a9d8a43cd161957
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Dec 10 11:23:22 2020 +0100
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Dec 10 12:32:44 2020 +0100
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 at libreoffice.org>
diff --git a/sw/qa/uitest/data/tdf129083.odt b/sw/qa/uitest/data/tdf129083.odt
new file mode 100644
index 000000000000..3de65273e8a1
Binary files /dev/null and b/sw/qa/uitest/data/tdf129083.odt differ
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()
More information about the Libreoffice-commits
mailing list