moved the waitForTrue and sleep method in the tests to a seperate class