def wait_for_xblock_initialization(page, xblock_css):
 def _is_finished_loading():
  is_done = page.browser.execute_script("return $({!r}).data('initialized')".format(xblock_css))
  return (is_done, is_done)
 return Promise(_is_finished_loading, 'Finished initializing the xblock.').fulfill()

def wait_for_xblock_initialization ( page , xblock_css ) : def _is_finished_loading ( ) : is_done = page . browser . execute_script ( "return $({!r}).data('initialized')" . format ( xblock_css ) ) return ( is_done , is_done ) return Promise ( _is_finished_loading , 'Finished initializing the xblock.' ) . fulfill ( )
wait for the xblock with the given css to finish initializing .