summaryrefslogtreecommitdiff
path: root/uitest/writer_tests
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-05-21 01:50:46 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-06-18 17:02:35 +0200
commit83b0ec6201172190bdcb16753c1166264f5f6cc5 (patch)
tree5ea732cf22805d80e51189e527a829cb13a0c580 /uitest/writer_tests
parentc1317d040c93816021268426d593b3e2cae871fe (diff)
uitest: add demo for selecting writer text
Change-Id: Iffc3e16bf0fa5a02058b6ad008ff3f61ea2a23af
Diffstat (limited to 'uitest/writer_tests')
-rw-r--r--uitest/writer_tests/start.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/uitest/writer_tests/start.py b/uitest/writer_tests/start.py
index a0fe7d2b96aa..a5a23ca0044b 100644
--- a/uitest/writer_tests/start.py
+++ b/uitest/writer_tests/start.py
@@ -81,4 +81,29 @@ def goto_first_page(xContext):
ui_test.close_doc()
+
+def select_text(xContext):
+ xUITest = xContext.ServiceManager.createInstanceWithContext(
+ "org.libreoffice.uitest.UITest", xContext)
+
+ ui_test = UITest(xUITest, xContext)
+
+ ui_test.create_doc_in_start_center("writer")
+
+ xWriterDoc = xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "This is my first writer text written through the UI testing"}))
+
+ time.sleep(2)
+ print(get_state_as_dict(xWriterEdit))
+
+ xWriterEdit.executeAction("SELECT", mkPropertyValues({"START_POS": "0", "END_POS": "4"}))
+
+ print(get_state_as_dict(xWriterEdit))
+
+ time.sleep(2)
+
+ ui_test.close_doc()
+
# vim:set shiftwidth=4 softtabstop=4 expandtab: */