summaryrefslogtreecommitdiff
path: root/sw/qa/uitest/table
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/uitest/table')
-rw-r--r--sw/qa/uitest/table/insertTableDialog.py84
-rw-r--r--sw/qa/uitest/table/sheetToTable.py22
-rw-r--r--sw/qa/uitest/table/tdf115026.py29
-rw-r--r--sw/qa/uitest/table/tdf116737.py71
-rwxr-xr-xsw/qa/uitest/table/tdf128593.py44
-rw-r--r--sw/qa/uitest/table/textToTable.py46
6 files changed, 158 insertions, 138 deletions
diff --git a/sw/qa/uitest/table/insertTableDialog.py b/sw/qa/uitest/table/insertTableDialog.py
index 2017dda1ca2b..427920e1985c 100644
--- a/sw/qa/uitest/table/insertTableDialog.py
+++ b/sw/qa/uitest/table/insertTableDialog.py
@@ -10,57 +10,69 @@ from uitest.uihelper.common import get_state_as_dict
class WriterInsertTableDialog(UITestCase):
- def test_tdf104158(self):
+ def insert_table(self, name, rows, cols):
+
+ self.ui_test.create_doc_in_start_center("writer")
+
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xNameEdit = xDialog.getChild("nameedit")
- with self.ui_test.create_doc_in_start_center("writer"):
+ xNameEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xNameEdit.executeAction("TYPE", mkPropertyValues({"TEXT": name}))
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- xDialog = self.xUITest.getTopFocusWindow()
+ xColSpin = xDialog.getChild("colspin")
+ xColSpin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xColSpin.executeAction("TYPE", mkPropertyValues({"TEXT": str(cols)}))
- xNameEdit = xDialog.getChild("nameedit")
+ xRowSpin = xDialog.getChild("rowspin")
+ xRowSpin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xRowSpin.executeAction("TYPE", mkPropertyValues({"TEXT": str(rows)}))
- xNameEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xNameEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "Test3"}))
+ self.assertEqual(get_state_as_dict(xNameEdit)["Text"], name)
+ self.assertEqual(get_state_as_dict(xColSpin)["Text"], str(cols))
+ self.assertEqual(get_state_as_dict(xRowSpin)["Text"], str(rows))
- xColSpin = xDialog.getChild("colspin")
- xColSpin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xColSpin.executeAction("TYPE", mkPropertyValues({"TEXT": "2"}))
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- xRowSpin = xDialog.getChild("rowspin")
- xRowSpin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xRowSpin.executeAction("TYPE", mkPropertyValues({"TEXT": "2"}))
+ document = self.ui_test.get_component()
- self.assertEqual(get_state_as_dict(xNameEdit)["Text"], "Test3")
- self.assertEqual(get_state_as_dict(xColSpin)["Text"], "2")
- self.assertEqual(get_state_as_dict(xRowSpin)["Text"], "2")
+ tables = document.getTextTables()
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ self.assertEqual(tables[0].getName(), name)
+ self.assertEqual(len(tables[0].getRows()), rows)
+ self.assertEqual(len(tables[0].getColumns()), cols)
- document = self.ui_test.get_component()
+ def insertTextIntoCell(self, table, cellName, text ):
+ tableText = table.getCellByName( cellName )
+ tableText.setString( text )
- tables = document.getTextTables()
+ def test_tdf104158(self):
+
+ self.insert_table("Test3", 2, 2)
- self.assertEqual(tables[0].getName(), "Test3")
- self.assertEqual(len(tables[0].getRows()), 2)
- self.assertEqual(len(tables[0].getColumns()), 2)
+ self.ui_test.execute_dialog_through_command(".uno:TableNumberFormatDialog")
- self.ui_test.execute_dialog_through_command(".uno:TableNumberFormatDialog")
+ xNumberFormatDlg = self.xUITest.getTopFocusWindow()
- xNumberFormatDlg = self.xUITest.getTopFocusWindow()
+ xOkBtn = xNumberFormatDlg.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- xOkBtn = xNumberFormatDlg.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ self.ui_test.close_doc()
def test_cancel_button_insert_table_dialog(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- Dialog = self.xUITest.getTopFocusWindow()
- CancelBtn = Dialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(CancelBtn)
-
- document = self.ui_test.get_component()
- tables = document.getTextTables()
- self.assertEqual(len(tables), 0)
+ self.ui_test.create_doc_in_start_center("writer")
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ Dialog = self.xUITest.getTopFocusWindow()
+ CancelBtn = Dialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(CancelBtn)
+
+ document = self.ui_test.get_component()
+ tables = document.getTextTables()
+ self.assertEqual(len(tables), 0)
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/table/sheetToTable.py b/sw/qa/uitest/table/sheetToTable.py
index e16ea93f85d5..4f48eeb644db 100644
--- a/sw/qa/uitest/table/sheetToTable.py
+++ b/sw/qa/uitest/table/sheetToTable.py
@@ -61,20 +61,22 @@ class sheetToTable(UITestCase):
self.assertEqual(table.getCellByName("A2").getString(), "3")
def test_tdf129083(self):
- with self.ui_test.create_doc_in_start_center("calc"):
+ 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()
+ 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")
+ 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"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
- self.xUITest.executeCommand(".uno:Copy")
+ self.xUITest.executeCommand(".uno:Copy")
+
+ self.ui_test.close_doc()
with self.ui_test.load_file(get_url_for_data_file("tdf129083.odt")) as writer_doc:
document = self.ui_test.get_component()
diff --git a/sw/qa/uitest/table/tdf115026.py b/sw/qa/uitest/table/tdf115026.py
index 8f994335af9e..92314753a8c3 100644
--- a/sw/qa/uitest/table/tdf115026.py
+++ b/sw/qa/uitest/table/tdf115026.py
@@ -11,25 +11,26 @@ from uitest.uihelper.common import get_state_as_dict
class tdf115026(UITestCase):
def test_pageBreak_and_tableAutoFormat(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
- self.xUITest.executeCommand(".uno:InsertPagebreak")
- self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2")
+ self.xUITest.executeCommand(".uno:InsertPagebreak")
+ self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2")
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ xDialog = self.xUITest.getTopFocusWindow()
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- self.ui_test.execute_dialog_through_command(".uno:AutoFormat")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:AutoFormat")
+ xDialog = self.xUITest.getTopFocusWindow()
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2")
+ self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2")
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/table/tdf116737.py b/sw/qa/uitest/table/tdf116737.py
index cc285d993ebd..139fcea3a812 100644
--- a/sw/qa/uitest/table/tdf116737.py
+++ b/sw/qa/uitest/table/tdf116737.py
@@ -13,39 +13,40 @@ from uitest.uihelper.common import select_pos
class tdf116737(UITestCase):
def test_tdf116737_select_table_style(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- xWriterDoc = self.xUITest.getTopFocusWindow()
- document = self.ui_test.get_component()
-
- #Insert => Insert Table / It's not possible to select a table style
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- xDialog = self.xUITest.getTopFocusWindow()
-
- formatlbinstable = xDialog.getChild("formatlbinstable")
- entry = formatlbinstable.getChild("11") #Simple List Shaded
- entry.executeAction("SELECT", tuple())
-
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
-
- #verify .uno:TableDialog
- self.ui_test.execute_dialog_through_command(".uno:TableDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "4") #tab Background
-
- btncolor = xDialog.getChild("btncolor")
- btncolor.executeAction("CLICK", tuple())
-
- R_custom = xDialog.getChild("R_custom")
- G_custom = xDialog.getChild("G_custom")
- B_custom = xDialog.getChild("B_custom")
- #"Simple List Shaded" -> header should be black
- self.assertEqual(get_state_as_dict(R_custom)["Text"], "0")
- self.assertEqual(get_state_as_dict(G_custom)["Text"], "0")
- self.assertEqual(get_state_as_dict(B_custom)["Text"], "0")
-
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
-
+ self.ui_test.create_doc_in_start_center("writer")
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ document = self.ui_test.get_component()
+
+ #Insert => Insert Table / It's not possible to select a table style
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ formatlbinstable = xDialog.getChild("formatlbinstable")
+ entry = formatlbinstable.getChild("11") #Simple List Shaded
+ entry.executeAction("SELECT", tuple())
+
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+
+ #verify .uno:TableDialog
+ self.ui_test.execute_dialog_through_command(".uno:TableDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4") #tab Background
+
+ btncolor = xDialog.getChild("btncolor")
+ btncolor.executeAction("CLICK", tuple())
+
+ R_custom = xDialog.getChild("R_custom")
+ G_custom = xDialog.getChild("G_custom")
+ B_custom = xDialog.getChild("B_custom")
+ #"Simple List Shaded" -> header should be black
+ self.assertEqual(get_state_as_dict(R_custom)["Text"], "0")
+ self.assertEqual(get_state_as_dict(G_custom)["Text"], "0")
+ self.assertEqual(get_state_as_dict(B_custom)["Text"], "0")
+
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/table/tdf128593.py b/sw/qa/uitest/table/tdf128593.py
index c631fa87db16..3306a58d2b09 100755
--- a/sw/qa/uitest/table/tdf128593.py
+++ b/sw/qa/uitest/table/tdf128593.py
@@ -9,28 +9,30 @@ from uitest.uihelper.common import get_state_as_dict
class tdf128593(UITestCase):
def test_tdf128593_table_background_color(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- MainWindow = self.xUITest.getTopFocusWindow()
+ MainDoc = self.ui_test.create_doc_in_start_center("writer")
+ MainWindow = self.xUITest.getTopFocusWindow()
- self.ui_test.execute_dialog_through_command(".uno:InsertTable")
- InsertTableDialog = self.xUITest.getTopFocusWindow()
- xok = InsertTableDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xok)
+ self.ui_test.execute_dialog_through_command(".uno:InsertTable")
+ InsertTableDialog = self.xUITest.getTopFocusWindow()
+ xok = InsertTableDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xok)
- self.xUITest.executeCommandWithParameters(".uno:TableCellBackgroundColor", mkPropertyValues({"TableCellBackgroundColor" : 16776960 }) )
- self.ui_test.execute_dialog_through_command(".uno:TableDialog")
- writer_edit = MainWindow.getChild("writer_edit")
- writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": "0", "START_POS": "0"}))
- TablePropertiesDialog = self.xUITest.getTopFocusWindow()
- tabcontrol = TablePropertiesDialog.getChild("tabcontrol")
- tabcontrol.executeAction("SELECT", mkPropertyValues({"POS": "4"}))
- Rcustom = TablePropertiesDialog.getChild("R_custom") #255
- self.assertEqual(get_state_as_dict(Rcustom)["Text"], "255")
- Gcustom = TablePropertiesDialog.getChild("G_custom") #255
- self.assertEqual(get_state_as_dict(Gcustom)["Text"], "255")
- Bcustom = TablePropertiesDialog.getChild("B_custom") #0
- self.assertEqual(get_state_as_dict(Bcustom)["Text"], "0")
- xok = TablePropertiesDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xok)
+ self.xUITest.executeCommandWithParameters(".uno:TableCellBackgroundColor", mkPropertyValues({"TableCellBackgroundColor" : 16776960 }) )
+ self.ui_test.execute_dialog_through_command(".uno:TableDialog")
+ writer_edit = MainWindow.getChild("writer_edit")
+ writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": "0", "START_POS": "0"}))
+ TablePropertiesDialog = self.xUITest.getTopFocusWindow()
+ tabcontrol = TablePropertiesDialog.getChild("tabcontrol")
+ tabcontrol.executeAction("SELECT", mkPropertyValues({"POS": "4"}))
+ Rcustom = TablePropertiesDialog.getChild("R_custom") #255
+ self.assertEqual(get_state_as_dict(Rcustom)["Text"], "255")
+ Gcustom = TablePropertiesDialog.getChild("G_custom") #255
+ self.assertEqual(get_state_as_dict(Gcustom)["Text"], "255")
+ Bcustom = TablePropertiesDialog.getChild("B_custom") #0
+ self.assertEqual(get_state_as_dict(Bcustom)["Text"], "0")
+ xok = TablePropertiesDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xok)
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/table/textToTable.py b/sw/qa/uitest/table/textToTable.py
index c40f2a726d41..2b820b360653 100644
--- a/sw/qa/uitest/table/textToTable.py
+++ b/sw/qa/uitest/table/textToTable.py
@@ -12,28 +12,30 @@ from uitest.uihelper.common import get_url_for_data_file, type_text
class textToTable(UITestCase):
def test_text_to_table(self):
- with self.ui_test.create_doc_in_start_center("writer"):
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
- #Enter A;B ; select the text ; dialog Text to table - Semicolon; verify
- type_text(xWriterEdit, "A;B;C")
- xWriterEdit.executeAction("SELECT", mkPropertyValues({"START_POS": "0", "END_POS": "5"}))
- self.ui_test.execute_dialog_through_command(".uno:ConvertTextToTable")
- xDialog = self.xUITest.getTopFocusWindow()
- semicolons = xDialog.getChild("semicolons")
- semicolons.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #verify
- self.assertEqual(document.TextTables.getCount(), 1)
- tables = document.getTextTables()
- self.assertEqual(len(tables[0].getRows()), 1)
- self.assertEqual(len(tables[0].getColumns()), 3)
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.TextTables.getCount(), 0)
- self.assertEqual(document.Text.String[0:5], "A;B;C")
+ writer_doc = self.ui_test.create_doc_in_start_center("writer")
+ document = self.ui_test.get_component()
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ #Enter A;B ; select the text ; dialog Text to table - Semicolon; verify
+ type_text(xWriterEdit, "A;B;C")
+ xWriterEdit.executeAction("SELECT", mkPropertyValues({"START_POS": "0", "END_POS": "5"}))
+ self.ui_test.execute_dialog_through_command(".uno:ConvertTextToTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+ semicolons = xDialog.getChild("semicolons")
+ semicolons.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #verify
+ self.assertEqual(document.TextTables.getCount(), 1)
+ tables = document.getTextTables()
+ self.assertEqual(len(tables[0].getRows()), 1)
+ self.assertEqual(len(tables[0].getColumns()), 3)
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.TextTables.getCount(), 0)
+ self.assertEqual(document.Text.String[0:5], "A;B;C")
+
+ self.ui_test.close_doc()
def test_text_to_table_header(self):
with self.ui_test.load_file(get_url_for_data_file("textToTable.odt")) as writer_doc: