In the last couple of weeks Kit and I have been working on how to integrate automated tests into the QuickDBD (great tool, you should try it if you didn’t) application. The challenge was to make our tests work with gulp and Teamcity, in order to automatically run them every time we deploy a new release. QuickDBD is an angular application so we decided to use protractor as our testing framework.
This nice tutorial showed us all the required steps but we had an issue where our tests started on Teamcity but never stopped, leaving the process running indefinitely on the server. I didn’t find the solution for this problem anywhere on the internet so I’m using this post to share our solution with the world.
As mentioned in the tutorial, in order to integrate protractor with gulp you need to install the gulp-angular-protractor. This package automates everything you need to do in order to run protractor, which includes starting and stopping the selenium server and that was actually where the problem laid.
When you configure your gulp task with gulp-angular-protractor it will look similar to this:
The autoStartStopServer: true is used to tell gulp-angular-protractor that it should handle the stopping and starting of the selenium server. But the stopping part wasn’t working.
In previous versions of selenium the following url was used to shutdown the selenium server (considering you are running selenium on the default port 4444):
Gulp-angular-protractor was trying to shut down the selenium server but since selenium server 3.0, this url for some reason was removed.
The solution we found was to tell gulp-protractor-angular to run a previous version of selenium server, which contained the shutdown url, by configuring the gulp task in the following way:
I hope this helps whoever is going through the same issue.