Kaydet (Commit) 89a3f789 authored tarafından Muhammet Kara's avatar Muhammet Kara Kaydeden (comit) Markus Mohrhard

Add UI test for the Customize dialog

Change-Id: I00109ef54ec7cfc1f4976794daa92ded3cd6ce4b
Reviewed-on: https://gerrit.libreoffice.org/53119
Tested-by: Jenkins
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 1f8d45c2
# -*- 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:
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment