In my `db/requirejs` branch, I've [added several new `wait_for` functions](https://github.com/edx/edx-platform/blob/db/requirejs/common/djangoapps/terrain/ui_helpers.py), including a `wait_for_ajax_complete` function. I've reproduced it here:

```python
@world.absorb
def wait_for_ajax_complete():
    """
    Wait until all jQuery AJAX calls have completed. "Complete" means that
    either the server has sent a response (regardless of whether the response
    indicates success or failure), or that the AJAX call timed out waiting for
    a response. For more information about the `jQuery.active` counter that
    keeps track of this information, go here:
    http://stackoverflow.com/questions/3148225/jquery-active-function#3148506
    """
    js = """
        var callback = arguments[arguments.length - 1];
        if(!window.jQuery) {callback(false);}
        var intervalID = setInterval(function() {
          if(jQuery.active == 0) {
            clearInterval(intervalID);
            callback(true);
          }
        }, 100);
    """
    world.browser.driver.execute_async_script(dedent(js))
```

Does that sound like what you want here? If so, I suggest that you add this function to `ui_helpers.py` in your branch, and call the function in your tests.