summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--uitest/demo_ui/edit.py4
-rw-r--r--uitest/uitest/uihelper/common.py3
2 files changed, 5 insertions, 2 deletions
diff --git a/uitest/demo_ui/edit.py b/uitest/demo_ui/edit.py
index 6da14333a4d5..48ada3b1d15e 100644
--- a/uitest/demo_ui/edit.py
+++ b/uitest/demo_ui/edit.py
@@ -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")
diff --git a/uitest/uitest/uihelper/common.py b/uitest/uitest/uihelper/common.py
index a83230b5a723..5056ef764983 100644
--- a/uitest/uitest/uihelper/common.py
+++ b/uitest/uitest/uihelper/common.py
@@ -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: