refactoring waitForActivity test