webdriverio-boneyard / gulp-webdriver

gulp-webdriver is a gulp plugin to run selenium tests with the WebdriverIO testrunner
http://webdriver.io
MIT License
76 stars 33 forks source link

Reordering tasks to kill everything on each run #5

Closed jimschubert closed 9 years ago

jimschubert commented 9 years ago

Experienced an issue where mocha throwing errors would cause things to not shut down. Also, there's a weird issue with invoking http from within a gulp task that can hold the response stream open and cause gulp to hang without exiting... so the selenium task has to force the stream on the HTTP query to end before hitting the callback.

This commit should resolve all issues with emitted errors either killing gulp before selenium can shut down (which causes issues on subsequent calls). There was also an issue with the selenium GET request's response locking gulp, causing successful or unsuccessful runs to prevent gulp from exiting.

I did remove comments from self-documenting functions (like runMocha commented with run mocha tests), added explicit returns on callbacks, and split a couple of functions to keep logic clean. Let me know if these don't fit the intended style and I'll make adjustments.

christian-bromann commented 9 years ago

Thanks