I have a function which is looking for a specific element in an interval:
function waitForElementToDisplay(selector, callback, checkFrequencyInMs, timeoutInMs