 
     # take the whole screen screenshot
     driver.takeScreenshot opts
+    waitForScreenshot(opts.path, CUSTOM_SCREENSHOT_MAX_DELAY_MS)
     return
 
 tryTakeScreenshot = (opts, isOk) ->

        Expected: #{expectedUri}
    """

takeScreenshot = (opts) ->
    # use target-specified screenshot function
    if opts.env

INITIALIZATION_FILE_PATH = pathUtils.join DEST, 'initialization.png'
SCREENSHOT_TRIES = 100
SCREENSHOT_TRY_DELAY_SEC = 0.2
CUSTOM_SCREENSHOT_MAX_DELAY_MS = 2000
{LOG_SCREENSHOT_DATA_URI} = process.env

if LOG_SCREENSHOT_DATA_URI
