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

uitest: add a shared helper method for selecting text

Change-Id: I15d059ea51ec1e7f0923dab5326a9bb8433e664c
Reviewed-on: https://gerrit.libreoffice.org/47550Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 38df2698
......@@ -8,7 +8,7 @@
from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.framework import UITestCase
from uitest.uihelper.common import type_text, get_state_as_dict
from uitest.uihelper.common import type_text, get_state_as_dict, select_text
import time
......@@ -44,7 +44,7 @@ class EditTest(UITestCase):
type_text(xEdit, "otherChars")
self.assertEqual("siotherCharsgeName", get_state_as_dict(xEdit)["Text"])
xEdit.executeAction("SELECT", mkPropertyValues({"FROM": "2", "TO": "12"}))
select_text(xEdit, from_pos="2", to="12")
self.assertEqual("otherChars", get_state_as_dict(xEdit)["SelectedText"])
xAddBtn = xAddNameDlg.getChild("cancel")
......
......@@ -16,4 +16,7 @@ def type_text(ui_object, text):
def select_pos(ui_object, pos):
ui_object.executeAction("SELECT", mkPropertyValues({"POS": pos}))
def select_text(ui_object, from_pos, to):
ui_object.executeAction("SELECT", mkPropertyValues({"FROM": from_pos, "TO": to}))
# 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