diff options
author | Muhammet Kara <muhammet.kara@pardus.org.tr> | 2018-04-18 12:27:15 +0300 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2018-06-20 12:52:17 +0200 |
commit | 89a3f789de928a08650de03681c45cbf544889ad (patch) | |
tree | c412221a17bcd760a514c67d751e5d3b1af9a012 | |
parent | 1f8d45c276760a173c3e30c78b8b740414a5b05f (diff) |
Add UI test for the Customize dialog
Change-Id: I00109ef54ec7cfc1f4976794daa92ded3cd6ce4b
Reviewed-on: https://gerrit.libreoffice.org/53119
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r-- | uitest/writer_tests/customizeDialog.py | 56 | ||||
-rw-r--r-- | vcl/source/uitest/uiobject.cxx | 6 |
2 files changed, 62 insertions, 0 deletions
diff --git a/uitest/writer_tests/customizeDialog.py b/uitest/writer_tests/customizeDialog.py new file mode 100644 index 000000000000..e6fef69cb50e --- /dev/null +++ b/uitest/writer_tests/customizeDialog.py @@ -0,0 +1,56 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This Source Code Form is subject to the terms of the Mozilla Public +# 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/. + +from uitest.framework import UITestCase +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.common import get_state_as_dict +import time +from uitest.debug import sleep + +class ConfigureDialog(UITestCase): + + def test_open_ConfigureDialog_writer(self): + + self.ui_test.create_doc_in_start_center("writer") + self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog") + xDialog = self.xUITest.getTopFocusWindow() + + xcancBtn = xDialog.getChild("cancel") + xcancBtn.executeAction("CLICK", tuple()) + + self.ui_test.close_doc() + + def test_search_filter(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") + xSearch = xDialog.getChild("searchEntry") + + initialEntryCount = get_state_as_dict(xfunc)["Children"] + self.assertTrue(initialEntryCount is not 0) + + xSearch.executeAction("SET", mkPropertyValues({"TEXT":"format"})) + + # Wait for the search/filter op to be completed + time.sleep(1) + + filteredEntryCount = get_state_as_dict(xfunc)["Children"] + self.assertTrue(filteredEntryCount < initialEntryCount) + + xSearch.executeAction("CLEAR", tuple()) + + finalEntryCount = get_state_as_dict(xfunc)["Children"] + self.assertEqual(initialEntryCount, finalEntryCount) + + + xcancBtn = xDialog.getChild("cancel") #button Cancel + xcancBtn.executeAction("CLICK", tuple()) #click the button + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index adf26cbb2ac8..e5ac0895dea8 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -659,6 +659,12 @@ void EditUIObject::execute(const OUString& rAction, mxEdit->SetSelection(aSelection); } } + else if (rAction == "CLEAR") + { + mxEdit->SetText(""); + mxEdit->UpdateData(); + bHandled = true; + } else { bHandled = false; |