mercredi 16 août 2017

TestNG: Should running tests by tests by method or class call the @BeforeSuite method?

I have a suite of tests that has a setUp method annotated with @BeforeSuite which runs before the suite. Occasionally I will need to run tests individually or all tests in a class. Is there a way to get my setUp method to run before these too.

My understanding is that TestNG creates a default suite so it shouldn't matter how I run the tests, if I have a method annotated with @BeforeSuite it should run before all tests. However this doesn't work for me. It runs only when I run the full suite.

Aucun commentaire:

Enregistrer un commentaire