Merge pull request #2180 from sebv/test-prelaunch

fixing prelaunch tests
rewrote waitForLaunch