summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-08-09 13:48:34 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-08-09 18:02:28 +0200
commit4e2ce2a460458f17ee4360c45a2da2fc4b4d753e (patch)
treeda57b30da45a69c58f4dac0efb6919ac86a9ac79
parentMark external/boost/constexpr.patch.0 as upstreamed (diff)
downloadcore-4e2ce2a460458f17ee4360c45a2da2fc4b4d753e.tar.gz
core-4e2ce2a460458f17ee4360c45a2da2fc4b4d753e.zip
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>
-rw-r--r--sw/qa/uitest/writer_tests3/customizeDialog.py32
1 files changed, 32 insertions, 0 deletions
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: