Add missing docstrings

This commit is contained in:
Luca Benci 2017-10-22 20:02:32 +02:00
parent 8b91a74aef
commit 96bbdb19e6
2 changed files with 2 additions and 0 deletions

View File

@ -134,6 +134,7 @@ class WebEngineElement(webelem.AbstractWebElement):
self._js_call('set_value', value)
def caret_position(self):
"""Get the text caret position for the current element"""
return self._js_dict.get('caret_position', 0)
def insert_text(self, text):

View File

@ -127,6 +127,7 @@ class WebKitElement(webelem.AbstractWebElement):
self._elem.evaluateJavaScript("this.value='{}'".format(value))
def caret_position(self):
"""Get the text caret position for the current element"""
self._check_vanished()
pos = self._elem.evaluateJavaScript('this.selectionStart')
assert isinstance(pos, (int, float, type(None)))