jeudi 27 juillet 2017

Is it a bad practice to have very long Mocha test?

When doing unit test, each case tends to be short and exclusive. But now I'm writing end-to-end tests with Selenium, thus, I have long scenarios which contain several closely related steps, for instance:

  1. User register
  2. User Login
  3. User post an article
  4. User edit that article

Should any error is caught I didn't expect other test to continue. So, seems I should put all of above in just one single it block. But of course this will make the block very long, and I have to set a big timeout, expect long finishing time etc.

Is this a bad practice?

Aucun commentaire:

Enregistrer un commentaire