Used waitsForDone function in test instead of waitsFor.