You have this if because the titlewatcher is created too late in some situations I guess.

Suggestion for a future pull request: ideally, we should be able to have a helper function to "load an application", and also have a more "trustworthy" way to identify that the test was finished. It sounds like unnecessary work, but having proper primitives for testing will encourage people to write more tests (and write tests for bugs they fix).