uitest: sw: add test for add and remove in customize dialog
intended to be a test for tdf#149966 but it's not reproducible
with gen. Anyway, it's worth it to have it
Change-Id: I2323bdec1f1c2b17ddd310257edec5156862b176
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138036
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sw/qa/uitest/writer_tests3/customizeDialog.py b/sw/qa/uitest/writer_tests3/customizeDialog.py
index 190abbf..c7b1a68 100644
--- a/sw/qa/uitest/writer_tests3/customizeDialog.py
+++ b/sw/qa/uitest/writer_tests3/customizeDialog.py
@@ -94,4 +94,36 @@ class ConfigureDialog(UITestCase):
xmenugearbtn.executeAction, args=("OPENFROMLIST", mkPropertyValues({"POS": "2"})), close_button="cancel"):
pass
def test_add_remove_items(self):
with self.ui_test.create_doc_in_start_center("writer"):
with self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog") as xDialog:
xTab = xDialog.getChild("tabcontrol")
select_pos(xTab, "0")
xFunctions = xDialog.getChild("functions")
xMenuContents = xDialog.getChild("menucontents")
xAddBtn = xDialog.getChild("add")
xRemoveBtn = xDialog.getChild("remove")
self.assertEqual("1", get_state_as_dict(xFunctions)['SelectionCount'])
sSelectEntryText = get_state_as_dict(xFunctions)['SelectEntryText']
nChildrenCount = int(get_state_as_dict(xMenuContents)['Children'])
self.assertEqual('true',get_state_as_dict(xAddBtn)['Enabled'])
self.assertEqual('false',get_state_as_dict(xRemoveBtn)['Enabled'])
xAddBtn.executeAction("CLICK", tuple())
self.assertEqual(nChildrenCount + 1, int(get_state_as_dict(xMenuContents)['Children']))
self.assertEqual(sSelectEntryText, get_state_as_dict(xMenuContents)['SelectEntryText'])
self.assertEqual('false',get_state_as_dict(xAddBtn)['Enabled'])
self.assertEqual('true',get_state_as_dict(xRemoveBtn)['Enabled'])
xRemoveBtn.executeAction("CLICK", tuple())
self.assertEqual(nChildrenCount, int(get_state_as_dict(xMenuContents)['Children']))
# vim: set shiftwidth=4 softtabstop=4 expandtab: