vendredi 11 septembre 2015

How correctly add my tests' errors to a stack so the tests don't stop executing?

I use SeleniumWebdriver C# to build automated tests. I also use NUnit to mark test methods (so I can run them).

In each of the tests there are several verification and when the first verification fails then the test stops executing (an exception is thrown).

I want the test to continue executing so more errors could be found!

Please guys, give me a clue how to do it right.

I think about something like that:

  1. Instead of throwing Exception in verification I'll add an error to a stack
  2. When a test ends I check if my stack is not empty
  3. If the stack is not empty I push to console all errors and fail the test
  4. If the stack is empty then the test passed successfully.

Are these steps good? Is there a better way?

Aucun commentaire:

Enregistrer un commentaire