summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-02-18 03:32:41 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-02-18 03:56:54 +0000
commit19d52e56a4581bb12bc271765feec7b8ab78c45b (patch)
treeda21aeaffb6c2dddd5634489c2699774abe3bbc9 /uitest
parentChartDumpTest: Build fix (diff)
downloadcore-19d52e56a4581bb12bc271765feec7b8ab78c45b.tar.gz
core-19d52e56a4581bb12bc271765feec7b8ab78c45b.zip
uitest: use the correct method to close a dialog through a button
Change-Id: I210c1d9a99a93b7a21478f679f440c270375bedc Reviewed-on: https://gerrit.libreoffice.org/34398 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'uitest')
-rw-r--r--uitest/demo_ui/char_dialog.py2
-rw-r--r--uitest/demo_ui/checkbox.py2
-rw-r--r--uitest/demo_ui/combobox.py2
-rw-r--r--uitest/demo_ui/edit.py2
-rw-r--r--uitest/demo_ui/hierarchy.py35
-rw-r--r--uitest/demo_ui/listbox.py4
-rw-r--r--uitest/demo_ui/spinfield.py6
7 files changed, 44 insertions, 9 deletions
diff --git a/uitest/demo_ui/char_dialog.py b/uitest/demo_ui/char_dialog.py
index 4c7716315793..d2b1fb001dc4 100644
--- a/uitest/demo_ui/char_dialog.py
+++ b/uitest/demo_ui/char_dialog.py
@@ -29,7 +29,7 @@ class CharDialogText(UITestCase):
sleep(5)
xCancelBtn = xCharDialog.getChild("cancel")
- xCancelBtn.executeAction("CLICK", tuple())
+ self.ui_test.close_dialog_through_button(xCancelBtn)
self.ui_test.close_doc()
diff --git a/uitest/demo_ui/checkbox.py b/uitest/demo_ui/checkbox.py
index 2138cf6c968f..114473d53851 100644
--- a/uitest/demo_ui/checkbox.py
+++ b/uitest/demo_ui/checkbox.py
@@ -21,7 +21,7 @@ class CheckBoxTest(UITestCase):
xNegativeNumRedCB.executeAction("CLICK",tuple())
okBtn = xCellsDlg.getChild("ok")
- okBtn.executeAction("CLICK", tuple())
+ self.ui_test.close_dialog_through_button(okBtn)
self.ui_test.close_doc()
diff --git a/uitest/demo_ui/combobox.py b/uitest/demo_ui/combobox.py
index 32e64027e55a..8b47f8338fb9 100644
--- a/uitest/demo_ui/combobox.py
+++ b/uitest/demo_ui/combobox.py
@@ -23,7 +23,7 @@ class ComboBoxTest(UITestCase):
select_pos(scopeCB, "1")
xCancelBtn = xAddNameDlg.getChild("cancel")
- xCancelBtn.executeAction("CLICK", tuple())
+ self.ui_test.close_dialog_through_button(xCancelBtn)
self.ui_test.close_doc()
diff --git a/uitest/demo_ui/edit.py b/uitest/demo_ui/edit.py
index 5eff4e0fad90..135a72447ea7 100644
--- a/uitest/demo_ui/edit.py
+++ b/uitest/demo_ui/edit.py
@@ -24,7 +24,7 @@ class EditTest(UITestCase):
type_text(xEdit, "simpleRangeName")
xAddBtn = xAddNameDlg.getChild("cancel")
- xAddBtn.executeAction("CLICK", tuple())
+ self.ui_test.close_dialog_through_button(xAddBtn)
self.ui_test.close_doc()
diff --git a/uitest/demo_ui/hierarchy.py b/uitest/demo_ui/hierarchy.py
new file mode 100644
index 000000000000..5f7b3c25bed6
--- /dev/null
+++ b/uitest/demo_ui/hierarchy.py
@@ -0,0 +1,35 @@
+# -*- 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 libreoffice.uno.propertyvalue import mkPropertyValues
+
+from uitest.framework import UITestCase
+
+import json
+
+class CheckBoxTest(UITestCase):
+
+ def test_get_json(self):
+
+ self.ui_test.create_doc_in_start_center("calc")
+
+ self.ui_test.execute_dialog_through_command(".uno:About")
+
+ xAboutDlg = self.xUITest.getTopFocusWindow()
+
+ json_string = xAboutDlg.getHierarchy()
+ print(json_string)
+ json_content = json.loads(json_string)
+ print(json_content)
+ print(json.dumps(json_content, indent=4))
+
+ closeBtn = xAboutDlg.getChild("close")
+ self.ui_test.close_dialog_through_button(closeBtn)
+
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/uitest/demo_ui/listbox.py b/uitest/demo_ui/listbox.py
index 15bd8ab133d9..780da1ff20b0 100644
--- a/uitest/demo_ui/listbox.py
+++ b/uitest/demo_ui/listbox.py
@@ -23,7 +23,7 @@ class ListBoxTest(UITestCase):
select_pos(categoryLB, "4")
xOkBtn = xCellsDlg.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ self.ui_test.close_dialog_through_button(xOkBtn)
self.ui_test.close_doc()
@@ -41,7 +41,7 @@ class ListBoxTest(UITestCase):
categoryLB.executeAction("SELECT", actionProps)
xOkBtn = xCellsDlg.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ self.ui_test.close_dialog_through_button(xOkBtn)
self.ui_test.close_doc()
diff --git a/uitest/demo_ui/spinfield.py b/uitest/demo_ui/spinfield.py
index a36189afeb16..3f73006b10bd 100644
--- a/uitest/demo_ui/spinfield.py
+++ b/uitest/demo_ui/spinfield.py
@@ -29,7 +29,7 @@ class SpinFieldTest(UITestCase):
assert(decimal_places_state["Text"] == "2")
okBtn = xCellsDlg.getChild("ok")
- okBtn.executeAction("CLICK", tuple())
+ self.ui_test.close_dialog_through_button(okBtn)
self.ui_test.close_doc()
@@ -56,7 +56,7 @@ class SpinFieldTest(UITestCase):
assert(decimal_places_state["Text"] == "2")
okBtn = xCellsDlg.getChild("ok")
- okBtn.executeAction("CLICK", tuple())
+ self.ui_test.close_dialog_through_button(okBtn)
self.ui_test.close_doc()
@@ -74,7 +74,7 @@ class SpinFieldTest(UITestCase):
assert(decimal_places_state["Text"] == "41")
okBtn = xCellsDlg.getChild("ok")
- okBtn.executeAction("CLICK", tuple())
+ self.ui_test.close_dialog_through_button(okBtn)
self.ui_test.close_doc()