FYI- you can use this https://developer.mozilla.org/en-US/docs/Marionette/Marionette_JavaScript_Tests#waitFor%28%29