Refactor acceptance tests to wait for connection before proceeding