diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-12-22 03:38:34 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-12-24 17:10:56 +0000 |
commit | 57e785e1cf52e422ac60cb259a2f53b696d3c4cc (patch) | |
tree | ff5adff271b61d0eb8e2c20839cf1a5a146ba47c /uitest/uitest | |
parent | 2dc821572e23dd0ac553e49244179e1e19d0df37 (diff) |
uitest: add a helper method for typing text
Change-Id: If450e3f0ff1e2a8f33db05e9512a13e5771115a8
Reviewed-on: https://gerrit.libreoffice.org/32406
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'uitest/uitest')
-rw-r--r-- | uitest/uitest/uihelper/calc.py | 3 | ||||
-rw-r--r-- | uitest/uitest/uihelper/common.py | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/uitest/uitest/uihelper/calc.py b/uitest/uitest/uihelper/calc.py index 29e8ce44df38..e34304c69082 100644 --- a/uitest/uitest/uihelper/calc.py +++ b/uitest/uitest/uihelper/calc.py @@ -6,10 +6,11 @@ # from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.common import type_text def enter_text_to_cell(gridwin, cell, text): gridwin.executeAction("SELECT", mkPropertyValues({"CELL": cell})) - gridwin.executeAction("TYPE", mkPropertyValues({"TEXT": text})) + type_text(gridwin, text) gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/uitest/uitest/uihelper/common.py b/uitest/uitest/uihelper/common.py index e0314a22c93a..b05bec7167f6 100644 --- a/uitest/uitest/uihelper/common.py +++ b/uitest/uitest/uihelper/common.py @@ -5,9 +5,12 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -from libreoffice.uno.propertyvalue import convert_property_values_to_dict +from libreoffice.uno.propertyvalue import convert_property_values_to_dict, mkPropertyValues def get_state_as_dict(ui_object): return convert_property_values_to_dict(ui_object.getState()) +def type_text(ui_object, text): + ui_object.executeAction("TYPE", mkPropertyValues({"TEXT": text})) + # vim: set shiftwidth=4 softtabstop=4 expandtab: |