Kaydet (Commit) 19d52e56 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

uitest: use the correct method to close a dialog through a button

Change-Id: I210c1d9a99a93b7a21478f679f440c270375bedc
Reviewed-on: https://gerrit.libreoffice.org/34398Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 5bb5a9da
...@@ -29,7 +29,7 @@ class CharDialogText(UITestCase): ...@@ -29,7 +29,7 @@ class CharDialogText(UITestCase):
sleep(5) sleep(5)
xCancelBtn = xCharDialog.getChild("cancel") xCancelBtn = xCharDialog.getChild("cancel")
xCancelBtn.executeAction("CLICK", tuple()) self.ui_test.close_dialog_through_button(xCancelBtn)
self.ui_test.close_doc() self.ui_test.close_doc()
......
...@@ -21,7 +21,7 @@ class CheckBoxTest(UITestCase): ...@@ -21,7 +21,7 @@ class CheckBoxTest(UITestCase):
xNegativeNumRedCB.executeAction("CLICK",tuple()) xNegativeNumRedCB.executeAction("CLICK",tuple())
okBtn = xCellsDlg.getChild("ok") okBtn = xCellsDlg.getChild("ok")
okBtn.executeAction("CLICK", tuple()) self.ui_test.close_dialog_through_button(okBtn)
self.ui_test.close_doc() self.ui_test.close_doc()
......
...@@ -23,7 +23,7 @@ class ComboBoxTest(UITestCase): ...@@ -23,7 +23,7 @@ class ComboBoxTest(UITestCase):
select_pos(scopeCB, "1") select_pos(scopeCB, "1")
xCancelBtn = xAddNameDlg.getChild("cancel") xCancelBtn = xAddNameDlg.getChild("cancel")
xCancelBtn.executeAction("CLICK", tuple()) self.ui_test.close_dialog_through_button(xCancelBtn)
self.ui_test.close_doc() self.ui_test.close_doc()
......
...@@ -24,7 +24,7 @@ class EditTest(UITestCase): ...@@ -24,7 +24,7 @@ class EditTest(UITestCase):
type_text(xEdit, "simpleRangeName") type_text(xEdit, "simpleRangeName")
xAddBtn = xAddNameDlg.getChild("cancel") xAddBtn = xAddNameDlg.getChild("cancel")
xAddBtn.executeAction("CLICK", tuple()) self.ui_test.close_dialog_through_button(xAddBtn)
self.ui_test.close_doc() self.ui_test.close_doc()
......
# -*- 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:
...@@ -23,7 +23,7 @@ class ListBoxTest(UITestCase): ...@@ -23,7 +23,7 @@ class ListBoxTest(UITestCase):
select_pos(categoryLB, "4") select_pos(categoryLB, "4")
xOkBtn = xCellsDlg.getChild("ok") xOkBtn = xCellsDlg.getChild("ok")
xOkBtn.executeAction("CLICK", tuple()) self.ui_test.close_dialog_through_button(xOkBtn)
self.ui_test.close_doc() self.ui_test.close_doc()
...@@ -41,7 +41,7 @@ class ListBoxTest(UITestCase): ...@@ -41,7 +41,7 @@ class ListBoxTest(UITestCase):
categoryLB.executeAction("SELECT", actionProps) categoryLB.executeAction("SELECT", actionProps)
xOkBtn = xCellsDlg.getChild("ok") xOkBtn = xCellsDlg.getChild("ok")
xOkBtn.executeAction("CLICK", tuple()) self.ui_test.close_dialog_through_button(xOkBtn)
self.ui_test.close_doc() self.ui_test.close_doc()
......
...@@ -29,7 +29,7 @@ class SpinFieldTest(UITestCase): ...@@ -29,7 +29,7 @@ class SpinFieldTest(UITestCase):
assert(decimal_places_state["Text"] == "2") assert(decimal_places_state["Text"] == "2")
okBtn = xCellsDlg.getChild("ok") okBtn = xCellsDlg.getChild("ok")
okBtn.executeAction("CLICK", tuple()) self.ui_test.close_dialog_through_button(okBtn)
self.ui_test.close_doc() self.ui_test.close_doc()
...@@ -56,7 +56,7 @@ class SpinFieldTest(UITestCase): ...@@ -56,7 +56,7 @@ class SpinFieldTest(UITestCase):
assert(decimal_places_state["Text"] == "2") assert(decimal_places_state["Text"] == "2")
okBtn = xCellsDlg.getChild("ok") okBtn = xCellsDlg.getChild("ok")
okBtn.executeAction("CLICK", tuple()) self.ui_test.close_dialog_through_button(okBtn)
self.ui_test.close_doc() self.ui_test.close_doc()
...@@ -74,7 +74,7 @@ class SpinFieldTest(UITestCase): ...@@ -74,7 +74,7 @@ class SpinFieldTest(UITestCase):
assert(decimal_places_state["Text"] == "41") assert(decimal_places_state["Text"] == "41")
okBtn = xCellsDlg.getChild("ok") okBtn = xCellsDlg.getChild("ok")
okBtn.executeAction("CLICK", tuple()) self.ui_test.close_dialog_through_button(okBtn)
self.ui_test.close_doc() self.ui_test.close_doc()
......
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