Ok, so I am wondering how I can get my driver/browser sessions to properly exit if a test is aborted via jenkins. Locally, if I run my tests and abort them, the browser will quit properly. Via jenkins however, this does not happen. If I abort the job during the test phase where my tests are running on the selenium grid, the browser stays open - causing the node to still show up as being used because it did not pick up that the aborted job should have killed its browser session.
I have been messing around with cucumber hooks, but the more I think about it I am not sure if I can handle this with a hook since when ran locally this behavior does not happen. I am now thinking this needs to be either a setting on the selenium grid or jenkins.
My most optimal solution would be to use a hook like the one below that could tell if it was being run remotely and kill the session if aborted/passed/failed. But if there is any solution via jenkins or the selenium grid settings that would be great too! Thank you!
this.registerHandler('After', function (event, done) {
// Some code to clear browser session
done();
});