summaryrefslogtreecommitdiff
path: root/uitest
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@pardus.org.tr>2018-04-18 12:27:15 +0300
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2018-06-20 12:52:17 +0200
commit89a3f789de928a08650de03681c45cbf544889ad (patch)
treec412221a17bcd760a514c67d751e5d3b1af9a012 /uitest
parent1f8d45c276760a173c3e30c78b8b740414a5b05f (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>
Diffstat (limited to 'uitest')
-rw-r--r--uitest/writer_tests/customizeDialog.py56
1 files changed, 56 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: