Added waitForTextToAppear() with an explicit timeout