summaryrefslogtreecommitdiff
path: root/uitest
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-05-21 01:24:01 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-06-18 17:02:33 +0200
commit0a52f261c6969992bb0b7ed3d8618884e1f62272 (patch)
tree5bbdf2d80fb48611145f5c7a12608953706325e6 /uitest
parentb78bd71b8d607e3ff773da1f972fec68934d4840 (diff)
uitest: add demo showing how to use page number
Change-Id: I718f4c6c8f01ceb556b9beadce5af88491c4efe0
Diffstat (limited to 'uitest')
-rw-r--r--uitest/writer_tests/start.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/uitest/writer_tests/start.py b/uitest/writer_tests/start.py
index 83b5ad2643c6..a9b722adc4cb 100644
--- a/uitest/writer_tests/start.py
+++ b/uitest/writer_tests/start.py
@@ -5,7 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-from uitest_helper import UITest
+from uitest_helper import UITest, get_state_as_dict
from helper import mkPropertyValues
@@ -58,4 +58,25 @@ def type_text(xContext):
ui_test.close_doc()
+def goto_first_page(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")
+
+ state = get_state_as_dict(xWriterEdit)
+ print(state)
+ while state["CurrentPage"] is "1":
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ state = get_state_as_dict(xWriterEdit)
+
+ time.sleep(2)
+
+ ui_test.close_doc()
+
# vim:set shiftwidth=4 softtabstop=4 expandtab: */