Kaydet (Commit) 02df8d4a authored tarafından Markus Mohrhard's avatar Markus Mohrhard

uitest: add demo showing how to select text in Edit

Change-Id: I8abb09e7e7b22934648bf0f295155a85da151cf8
Reviewed-on: https://gerrit.libreoffice.org/47549Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 2453c5a6
......@@ -8,7 +8,9 @@
from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.framework import UITestCase
from uitest.uihelper.common import type_text
from uitest.uihelper.common import type_text, get_state_as_dict
import time
class EditTest(UITestCase):
......@@ -28,4 +30,26 @@ class EditTest(UITestCase):
self.ui_test.close_doc()
def test_select_text(self):
self.ui_test.create_doc_in_start_center("calc")
self.ui_test.execute_modeless_dialog_through_command(".uno:AddName")
xAddNameDlg = self.xUITest.getTopFocusWindow()
xEdit = xAddNameDlg.getChild("edit")
type_text(xEdit, "simpleRangeName")
xEdit.executeAction("SELECT", mkPropertyValues({"FROM": "2", "TO": "9"}))
type_text(xEdit, "otherChars")
self.assertEqual("siotherCharsgeName", get_state_as_dict(xEdit)["Text"])
xEdit.executeAction("SELECT", mkPropertyValues({"FROM": "2", "TO": "12"}))
self.assertEqual("otherChars", get_state_as_dict(xEdit)["SelectedText"])
xAddBtn = xAddNameDlg.getChild("cancel")
self.ui_test.close_dialog_through_button(xAddBtn)
self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
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