From b392d126335be68e0b601df39bfb840c4080d606 Mon Sep 17 00:00:00 2001 From: Muhammet Kara Date: Fri, 8 Nov 2019 22:10:23 +0300 Subject: Add UI Test for tdf#128004 Change-Id: Id2b95d21799f8fa4b55a304afda739219fee06ff Reviewed-on: https://gerrit.libreoffice.org/82323 Tested-by: Jenkins Reviewed-by: Muhammet Kara --- uitest/writer_tests/customizeDialog.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/uitest/writer_tests/customizeDialog.py b/uitest/writer_tests/customizeDialog.py index 8b61613a2e31..9d2311eb46a6 100644 --- a/uitest/writer_tests/customizeDialog.py +++ b/uitest/writer_tests/customizeDialog.py @@ -4,10 +4,12 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +import time + from uitest.framework import UITestCase from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_state_as_dict -import time +from uitest.uihelper.common import select_pos from uitest.debug import sleep class ConfigureDialog(UITestCase): @@ -51,6 +53,30 @@ class ConfigureDialog(UITestCase): self.assertEqual(initialEntryCount, finalEntryCount) + xcancBtn = xDialog.getChild("cancel") #button Cancel + xcancBtn.executeAction("CLICK", tuple()) #click the button + + self.ui_test.close_doc() + + def test_category_listbox(self): + self.ui_test.create_doc_in_start_center("writer") + self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog") + xDialog = self.xUITest.getTopFocusWindow() + + xFunc = xDialog.getChild("functions") + xCategory = xDialog.getChild("commandcategorylist") + + initialEntryCount = get_state_as_dict(xFunc)["Children"] + self.assertTrue(initialEntryCount is not 0) + + select_pos(xCategory, "1") + filteredEntryCount = get_state_as_dict(xFunc)["Children"] + self.assertTrue(filteredEntryCount < initialEntryCount) + + select_pos(xCategory, "0") + finalEntryCount = get_state_as_dict(xFunc)["Children"] + self.assertEqual(initialEntryCount, finalEntryCount) + xcancBtn = xDialog.getChild("cancel") #button Cancel xcancBtn.executeAction("CLICK", tuple()) #click the button -- cgit v1.2.3