sw/qa/uitest/writer_tests3/customizeDialog.py | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
New commits: commit 4e2ce2a460458f17ee4360c45a2da2fc4b4d753e Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Aug 9 13:48:34 2022 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Aug 9 18:02:28 2022 +0200 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 <xiscofa...@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/qa/uitest/writer_tests3/customizeDialog.py b/sw/qa/uitest/writer_tests3/customizeDialog.py index 190abbf3692a..c7b1a68e8123 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: