This commit is contained in:
Florian Bruhin 2017-04-28 16:29:44 +02:00
parent 20da495376
commit 5ed870e0c6

View File

@ -53,8 +53,9 @@ class WebEngineElement(webelem.AbstractWebElement):
assert set(js_dict.keys()).issubset(js_dict_types.keys()) assert set(js_dict.keys()).issubset(js_dict_types.keys())
for name, typ in js_dict_types.items(): for name, typ in js_dict_types.items():
if name in js_dict and not isinstance(js_dict[name], typ): if name in js_dict and not isinstance(js_dict[name], typ):
raise TypeError("Got {} for {} from JS but expected {}: {}".format( raise TypeError("Got {} for {} from JS but expected {}: "
type(js_dict[name]), name, typ, js_dict)) "{}".format(type(js_dict[name]), name, typ,
js_dict))
for name, value in js_dict['attributes'].items(): for name, value in js_dict['attributes'].items():
if not isinstance(name, str): if not isinstance(name, str):
raise TypeError("Got {} ({}) for attribute name from JS: " raise TypeError("Got {} ({}) for attribute name from JS: "