Files
edx-platform/common/test/acceptance/pages/xblock/utils.py
Feanil Patel 9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00

19 lines
553 B
Python

"""
Utility methods useful for XBlock page tests.
"""
from bok_choy.promise import Promise
def wait_for_xblock_initialization(page, xblock_css):
"""
Wait for the xblock with the given CSS to finish initializing.
"""
def _is_finished_loading():
# Wait for the xblock javascript to finish initializing
is_done = page.browser.execute_script(u"return $('{}').data('initialized')".format(xblock_css))
return is_done, is_done
return Promise(_is_finished_loading, 'Finished initializing the xblock.').fulfill()