LearnBoost / soda

Selenium Node.JS adapter
http://labs.learnboost.com
464 stars 43 forks source link

Closing browser after test failure #43

Closed juriejan closed 11 years ago

juriejan commented 12 years ago

When my tests fail, the browser window it ran in doesn't close. What could I be doing wrong?

I think it might have something to do with the fact that the 'testComplete' method doesn't work for me as it is presented in the documentation.

The documentation suggests that I use it like this:

browser
  .chain
  .session()
  .open('/')
  .end(function(err){
    browser.testComplete(function() {
      if(err) throw err;
      done()
    });
  });

The 'done' callback in the previous code never gets called and my test never knows that it was completed.

This is what I currently use:

browser
  .chain
  .session()
  .open('/')
  .testComplete()
  .end(function(err){
    if(err) throw err;
    done();
  });

Any tips?

juriejan commented 11 years ago

When the test fails the chain of commands are exited. Ons should find a way to close the browser in the function that runs after each test.