summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
Diffstat (limited to 'uitest')
-rw-r--r--uitest/demo_ui/edit.py26
1 files changed, 25 insertions, 1 deletions
diff --git a/uitest/demo_ui/edit.py b/uitest/demo_ui/edit.py
index 135a72447ea7..6da14333a4d5 100644
--- a/uitest/demo_ui/edit.py
+++ b/uitest/demo_ui/edit.py
@@ -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: