diff options
Diffstat (limited to 'sw/qa/uitest/table/tableProperties.py')
-rw-r--r-- | sw/qa/uitest/table/tableProperties.py | 407 |
1 files changed, 203 insertions, 204 deletions
diff --git a/sw/qa/uitest/table/tableProperties.py b/sw/qa/uitest/table/tableProperties.py index da75f2218255..4c2b34ab0a16 100644 --- a/sw/qa/uitest/table/tableProperties.py +++ b/sw/qa/uitest/table/tableProperties.py @@ -15,208 +15,207 @@ from uitest.uihelper.common import change_measurement_unit class tableProperties(UITestCase): def test_table_properties(self): - writer_doc = self.ui_test.load_file(get_url_for_data_file("tableToText.odt")) - document = self.ui_test.get_component() - xWriterDoc = self.xUITest.getTopFocusWindow() - - change_measurement_unit(self, "Centimeter") - - #dialog Table Properties - Table - self.ui_test.execute_dialog_through_command(".uno:TableDialog") - xDialog = self.xUITest.getTopFocusWindow() - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - - name = xDialog.getChild("name") - free = xDialog.getChild("free") - widthmf = xDialog.getChild("widthmf") - leftmf = xDialog.getChild("leftmf") - rightmf = xDialog.getChild("rightmf") - abovemf = xDialog.getChild("abovemf") - belowmf = xDialog.getChild("belowmf") - textdirection = xDialog.getChild("textdirection") - - name.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - name.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - name.executeAction("TYPE", mkPropertyValues({"TEXT":"NewName"})) - free.executeAction("CLICK", tuple()) - widthmf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - widthmf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - widthmf.executeAction("TYPE", mkPropertyValues({"TEXT":"15"})) - leftmf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - leftmf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - leftmf.executeAction("TYPE", mkPropertyValues({"TEXT":"1"})) - rightmf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - rightmf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - rightmf.executeAction("TYPE", mkPropertyValues({"TEXT":"1"})) - abovemf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - abovemf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - abovemf.executeAction("TYPE", mkPropertyValues({"TEXT":"1"})) - belowmf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - belowmf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - belowmf.executeAction("TYPE", mkPropertyValues({"TEXT":"1"})) - select_by_text(textdirection, "Left-to-right (LTR)") - xOKBtn = xDialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOKBtn) - #verify - self.ui_test.execute_dialog_through_command(".uno:TableDialog") - xDialog = self.xUITest.getTopFocusWindow() - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - - name = xDialog.getChild("name") - free = xDialog.getChild("free") - widthmf = xDialog.getChild("widthmf") - leftmf = xDialog.getChild("leftmf") - rightmf = xDialog.getChild("rightmf") - abovemf = xDialog.getChild("abovemf") - belowmf = xDialog.getChild("belowmf") - textdirection = xDialog.getChild("textdirection") - - self.assertEqual(get_state_as_dict(name)["Text"], "NewName") - self.assertEqual(get_state_as_dict(free)["Checked"], "true") - self.assertEqual(get_state_as_dict(widthmf)["Text"], "15.00 cm") - self.assertEqual(get_state_as_dict(leftmf)["Text"], "1.00 cm") - self.assertEqual(get_state_as_dict(rightmf)["Text"], "1.00 cm") - self.assertEqual(get_state_as_dict(abovemf)["Text"], "1.00 cm") - self.assertEqual(get_state_as_dict(belowmf)["Text"], "1.00 cm") - xOKBtn = xDialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOKBtn) - - #dialog Table Properties - Text flow - self.ui_test.execute_dialog_through_command(".uno:TableDialog") - xDialog = self.xUITest.getTopFocusWindow() - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "1") - - xbreak = xDialog.getChild("break") - xbreak.executeAction("CLICK", tuple()) - column = xDialog.getChild("column") - column.executeAction("CLICK", tuple()) - after = xDialog.getChild("after") - after.executeAction("CLICK", tuple()) - keep = xDialog.getChild("keep") - keep.executeAction("CLICK", tuple()) - headline = xDialog.getChild("headline") - headline.executeAction("CLICK", tuple()) - textdirection = xDialog.getChild("textorientation") - select_by_text(textdirection, "Vertical (bottom to top)") - vertorient = xDialog.getChild("vertorient") - select_by_text(vertorient, "Bottom") - xOKBtn = xDialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOKBtn) - #verify - self.ui_test.execute_dialog_through_command(".uno:TableDialog") - xDialog = self.xUITest.getTopFocusWindow() - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "1") - - xbreak = xDialog.getChild("break") - self.assertEqual(get_state_as_dict(xbreak)["Selected"], "true") - column = xDialog.getChild("column") - self.assertEqual(get_state_as_dict(column)["Checked"], "true") - after = xDialog.getChild("column") - self.assertEqual(get_state_as_dict(after)["Checked"], "true") - keep = xDialog.getChild("keep") - self.assertEqual(get_state_as_dict(keep)["Selected"], "true") - headline = xDialog.getChild("headline") - self.assertEqual(get_state_as_dict(headline)["Selected"], "true") - textdirection = xDialog.getChild("textorientation") - self.assertEqual(get_state_as_dict(textdirection)["SelectEntryText"], "Vertical (bottom to top)") - vertorient = xDialog.getChild("vertorient") - self.assertEqual(get_state_as_dict(vertorient)["SelectEntryText"], "Bottom") - xOKBtn = xDialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOKBtn) - - #dialog Table Properties - Columns - self.ui_test.execute_dialog_through_command(".uno:TableDialog") - xDialog = self.xUITest.getTopFocusWindow() - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "2") - - adaptwidth = xDialog.getChild("adaptwidth") - adaptwidth.executeAction("CLICK", tuple()) - - xOKBtn = xDialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOKBtn) - #verify - #doesn't work / probably Bug 100537 - Width and relative checkboxes disabled in Table - #dialog by default with automatic alignment -# self.ui_test.execute_dialog_through_command(".uno:TableDialog") -# xDialog = self.xUITest.getTopFocusWindow() -# tabcontrol = xDialog.getChild("tabcontrol") -# select_pos(tabcontrol, "2") -# adaptwidth = xDialog.getChild("adaptwidth") -# self.assertEqual(get_state_as_dict(adaptwidth)["Selected"], "true") -# xOKBtn = xDialog.getChild("ok") -# self.ui_test.close_dialog_through_button(xOKBtn) - - #dialog Table Properties - Borders - self.ui_test.execute_dialog_through_command(".uno:TableDialog") - xDialog = self.xUITest.getTopFocusWindow() - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "3") - - sync = xDialog.getChild("sync") - mergeadjacent = xDialog.getChild("mergeadjacent") - sync.executeAction("CLICK", tuple()) - mergeadjacent.executeAction("CLICK", tuple()) - xOKBtn = xDialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOKBtn) - - #verify - self.ui_test.execute_dialog_through_command(".uno:TableDialog") - xDialog = self.xUITest.getTopFocusWindow() - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "3") - sync = xDialog.getChild("sync") - mergeadjacent = xDialog.getChild("mergeadjacent") -# self.assertEqual(get_state_as_dict(sync)["Selected"], "false") #need change spacing, but ui names are not unique - self.assertEqual(get_state_as_dict(mergeadjacent)["Selected"], "false") - xOKBtn = xDialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOKBtn) - - #dialog Table Properties - Background - self.ui_test.execute_dialog_through_command(".uno:TableDialog") - xDialog = self.xUITest.getTopFocusWindow() - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "4") - - 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") - R_custom.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - R_custom.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - R_custom.executeAction("TYPE", mkPropertyValues({"TEXT":"100"})) - G_custom.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - G_custom.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - G_custom.executeAction("TYPE", mkPropertyValues({"TEXT":"100"})) - B_custom.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - B_custom.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - B_custom.executeAction("TYPE", mkPropertyValues({"TEXT":"100"})) - B_custom.executeAction("UP", tuple()) - B_custom.executeAction("DOWN", tuple()) #need to refresh HEX value... - xOKBtn = xDialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOKBtn) - - #verify - self.ui_test.execute_dialog_through_command(".uno:TableDialog") - xDialog = self.xUITest.getTopFocusWindow() - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "4") - 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") - - self.assertEqual(get_state_as_dict(R_custom)["Text"], "100") - self.assertEqual(get_state_as_dict(B_custom)["Text"], "100") - self.assertEqual(get_state_as_dict(G_custom)["Text"], "100") - xOKBtn = xDialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOKBtn) - - self.ui_test.close_doc() + with self.ui_test.load_file(get_url_for_data_file("tableToText.odt")) as writer_doc: + document = self.ui_test.get_component() + xWriterDoc = self.xUITest.getTopFocusWindow() + + change_measurement_unit(self, "Centimeter") + + #dialog Table Properties - Table + self.ui_test.execute_dialog_through_command(".uno:TableDialog") + xDialog = self.xUITest.getTopFocusWindow() + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + + name = xDialog.getChild("name") + free = xDialog.getChild("free") + widthmf = xDialog.getChild("widthmf") + leftmf = xDialog.getChild("leftmf") + rightmf = xDialog.getChild("rightmf") + abovemf = xDialog.getChild("abovemf") + belowmf = xDialog.getChild("belowmf") + textdirection = xDialog.getChild("textdirection") + + name.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + name.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + name.executeAction("TYPE", mkPropertyValues({"TEXT":"NewName"})) + free.executeAction("CLICK", tuple()) + widthmf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + widthmf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + widthmf.executeAction("TYPE", mkPropertyValues({"TEXT":"15"})) + leftmf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + leftmf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + leftmf.executeAction("TYPE", mkPropertyValues({"TEXT":"1"})) + rightmf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + rightmf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + rightmf.executeAction("TYPE", mkPropertyValues({"TEXT":"1"})) + abovemf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + abovemf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + abovemf.executeAction("TYPE", mkPropertyValues({"TEXT":"1"})) + belowmf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + belowmf.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + belowmf.executeAction("TYPE", mkPropertyValues({"TEXT":"1"})) + select_by_text(textdirection, "Left-to-right (LTR)") + xOKBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + #verify + self.ui_test.execute_dialog_through_command(".uno:TableDialog") + xDialog = self.xUITest.getTopFocusWindow() + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + + name = xDialog.getChild("name") + free = xDialog.getChild("free") + widthmf = xDialog.getChild("widthmf") + leftmf = xDialog.getChild("leftmf") + rightmf = xDialog.getChild("rightmf") + abovemf = xDialog.getChild("abovemf") + belowmf = xDialog.getChild("belowmf") + textdirection = xDialog.getChild("textdirection") + + self.assertEqual(get_state_as_dict(name)["Text"], "NewName") + self.assertEqual(get_state_as_dict(free)["Checked"], "true") + self.assertEqual(get_state_as_dict(widthmf)["Text"], "15.00 cm") + self.assertEqual(get_state_as_dict(leftmf)["Text"], "1.00 cm") + self.assertEqual(get_state_as_dict(rightmf)["Text"], "1.00 cm") + self.assertEqual(get_state_as_dict(abovemf)["Text"], "1.00 cm") + self.assertEqual(get_state_as_dict(belowmf)["Text"], "1.00 cm") + xOKBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + + #dialog Table Properties - Text flow + self.ui_test.execute_dialog_through_command(".uno:TableDialog") + xDialog = self.xUITest.getTopFocusWindow() + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "1") + + xbreak = xDialog.getChild("break") + xbreak.executeAction("CLICK", tuple()) + column = xDialog.getChild("column") + column.executeAction("CLICK", tuple()) + after = xDialog.getChild("after") + after.executeAction("CLICK", tuple()) + keep = xDialog.getChild("keep") + keep.executeAction("CLICK", tuple()) + headline = xDialog.getChild("headline") + headline.executeAction("CLICK", tuple()) + textdirection = xDialog.getChild("textorientation") + select_by_text(textdirection, "Vertical (bottom to top)") + vertorient = xDialog.getChild("vertorient") + select_by_text(vertorient, "Bottom") + xOKBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + #verify + self.ui_test.execute_dialog_through_command(".uno:TableDialog") + xDialog = self.xUITest.getTopFocusWindow() + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "1") + + xbreak = xDialog.getChild("break") + self.assertEqual(get_state_as_dict(xbreak)["Selected"], "true") + column = xDialog.getChild("column") + self.assertEqual(get_state_as_dict(column)["Checked"], "true") + after = xDialog.getChild("column") + self.assertEqual(get_state_as_dict(after)["Checked"], "true") + keep = xDialog.getChild("keep") + self.assertEqual(get_state_as_dict(keep)["Selected"], "true") + headline = xDialog.getChild("headline") + self.assertEqual(get_state_as_dict(headline)["Selected"], "true") + textdirection = xDialog.getChild("textorientation") + self.assertEqual(get_state_as_dict(textdirection)["SelectEntryText"], "Vertical (bottom to top)") + vertorient = xDialog.getChild("vertorient") + self.assertEqual(get_state_as_dict(vertorient)["SelectEntryText"], "Bottom") + xOKBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + + #dialog Table Properties - Columns + self.ui_test.execute_dialog_through_command(".uno:TableDialog") + xDialog = self.xUITest.getTopFocusWindow() + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "2") + + adaptwidth = xDialog.getChild("adaptwidth") + adaptwidth.executeAction("CLICK", tuple()) + + xOKBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + #verify + #doesn't work / probably Bug 100537 - Width and relative checkboxes disabled in Table + #dialog by default with automatic alignment + # self.ui_test.execute_dialog_through_command(".uno:TableDialog") + # xDialog = self.xUITest.getTopFocusWindow() + # tabcontrol = xDialog.getChild("tabcontrol") + # select_pos(tabcontrol, "2") + # adaptwidth = xDialog.getChild("adaptwidth") + # self.assertEqual(get_state_as_dict(adaptwidth)["Selected"], "true") + # xOKBtn = xDialog.getChild("ok") + # self.ui_test.close_dialog_through_button(xOKBtn) + + #dialog Table Properties - Borders + self.ui_test.execute_dialog_through_command(".uno:TableDialog") + xDialog = self.xUITest.getTopFocusWindow() + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "3") + + sync = xDialog.getChild("sync") + mergeadjacent = xDialog.getChild("mergeadjacent") + sync.executeAction("CLICK", tuple()) + mergeadjacent.executeAction("CLICK", tuple()) + xOKBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + + #verify + self.ui_test.execute_dialog_through_command(".uno:TableDialog") + xDialog = self.xUITest.getTopFocusWindow() + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "3") + sync = xDialog.getChild("sync") + mergeadjacent = xDialog.getChild("mergeadjacent") + # self.assertEqual(get_state_as_dict(sync)["Selected"], "false") #need change spacing, but ui names are not unique + self.assertEqual(get_state_as_dict(mergeadjacent)["Selected"], "false") + xOKBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + + #dialog Table Properties - Background + self.ui_test.execute_dialog_through_command(".uno:TableDialog") + xDialog = self.xUITest.getTopFocusWindow() + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "4") + + 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") + R_custom.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + R_custom.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + R_custom.executeAction("TYPE", mkPropertyValues({"TEXT":"100"})) + G_custom.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + G_custom.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + G_custom.executeAction("TYPE", mkPropertyValues({"TEXT":"100"})) + B_custom.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + B_custom.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + B_custom.executeAction("TYPE", mkPropertyValues({"TEXT":"100"})) + B_custom.executeAction("UP", tuple()) + B_custom.executeAction("DOWN", tuple()) #need to refresh HEX value... + xOKBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + + #verify + self.ui_test.execute_dialog_through_command(".uno:TableDialog") + xDialog = self.xUITest.getTopFocusWindow() + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "4") + 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") + + self.assertEqual(get_state_as_dict(R_custom)["Text"], "100") + self.assertEqual(get_state_as_dict(B_custom)["Text"], "100") + self.assertEqual(get_state_as_dict(G_custom)["Text"], "100") + xOKBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + # vim: set shiftwidth=4 softtabstop=4 expandtab: |