summaryrefslogtreecommitdiff
path: root/uitest
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-03-17 18:58:44 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-03-21 11:31:04 +0100
commit53c4a93e32a5bcdc06a580e9652cde535134b3f6 (patch)
tree2905b3cd35f37e8b7395c5c66b626940b1e0355f /uitest
parent31d4f6c35a10a4bee4f4aebb86f05f8a9fd872bb (diff)
select_by_text helper method for uitests
reduce the boilerplate associated with selecting an item in a combobox Change-Id: I035967d7b45c84788d67b9ab5bebf2dbfc13fdf9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112817 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'uitest')
-rw-r--r--uitest/uitest/uihelper/common.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/uitest/uitest/uihelper/common.py b/uitest/uitest/uihelper/common.py
index cb9a761cb7f9..0ce04dbe780a 100644
--- a/uitest/uitest/uihelper/common.py
+++ b/uitest/uitest/uihelper/common.py
@@ -18,6 +18,9 @@ def type_text(ui_object, text):
def select_pos(ui_object, pos):
ui_object.executeAction("SELECT", mkPropertyValues({"POS": pos}))
+def select_by_text(ui_object, text):
+ ui_object.executeAction("SELECT", mkPropertyValues({"TEXT": text}))
+
def select_text(ui_object, from_pos, to):
ui_object.executeAction("SELECT", mkPropertyValues({"FROM": from_pos, "TO": to}))