2121from ..common .by import By
2222
2323
24- class ShadowRoot () :
24+ class ShadowRoot :
2525
2626 # TODO: We should look and see how we can create a search context like Java/.NET
2727
@@ -33,20 +33,25 @@ def __eq__(self, other_shadowroot):
3333 return self ._id == other_shadowroot ._id
3434
3535 def __hash__ (self ):
36- return int (md5_hash (self ._id .encode (' utf-8' )).hexdigest (), 16 )
36+ return int (md5_hash (self ._id .encode (" utf-8" )).hexdigest (), 16 )
3737
3838 def __ne__ (self , other_shadowroot ):
3939 return not self .__eq__ (other_shadowroot )
4040
4141 def __repr__ (self ):
4242 return '<{0.__module__}.{0.__name__} (session="{1}", element="{2}")>' .format (
43- type (self ), self .session .session_id , self ._id )
43+ type (self ), self .session .session_id , self ._id
44+ )
4445
45- def find_element (self , by = By .ID , value = None ):
46- return self ._execute (Command .FIND_ELEMENT_FROM_SHADOW_ROOT , {"using" : by , "value" : value })['value' ]
46+ def find_element (self , by : By = By .ID , value : str = None ):
47+ return self ._execute (
48+ Command .FIND_ELEMENT_FROM_SHADOW_ROOT , {"using" : by , "value" : value }
49+ )["value" ]
4750
48- def find_elements (self , by = By .ID , value = None ):
49- return self ._execute (Command .FIND_ELEMENTS_FROM_SHADOW_ROOT , {"using" : by , "value" : value })['value' ]
51+ def find_elements (self , by : By = By .ID , value : str = None ):
52+ return self ._execute (
53+ Command .FIND_ELEMENTS_FROM_SHADOW_ROOT , {"using" : by , "value" : value }
54+ )["value" ]
5055
5156 # Private Methods
5257 def _execute (self , command , params = None ):
@@ -61,5 +66,5 @@ def _execute(self, command, params=None):
6166 """
6267 if not params :
6368 params = {}
64- params [' shadowId' ] = self ._id
69+ params [" shadowId" ] = self ._id
6570 return self .session .execute (command , params )
0 commit comments