There is a method called sleep()
from Leadfoot in Intern 2 that does the same thing as wait()
in Intern 1.
Leadfoot also provides a setFindTimeout()
method which should set the time that intern continues to look for a element on the page if it not found when a find()
method is first called.
I ended up creating a function specifically for waiting for elements to appear on the page. And then using this inside of a pollUntil()
to explicitly wait for an element to appear or disappear on the page.
element_visible_by_query_selector: function(query) {
return function(query) {
elem = document.querySelector(query);
if (!elem) { return null; }
return (elem.offsetWidth > 0 && elem.offsetHeight > 0) ? elem : null;
}
},
.then(pollUntil(util.element_visible_by_query_selector(), ['<element>'], 22000))