I have a Test Automation project using TestNg.
I want to make sure certain configurations are enabled before I start some of the tests. I have written this as a test and marked other tests as dependent on this. So I have used the TestNG param "dependsOnMethods" for all the individual tests which are dependent on this check.
These tests are distributed across multiple classes and I currently have to do this check in each and every class, which works fine if all tests are passing, but if there is a configuration missing, I get a bunch of errors because the test which is doing this check fails and then I have a copy of this failure in almost every class I have.
So instead of 1 failure, I end up with 10 failures, as this failure happens multiple times.
This can't be a @BeforeTest or @BeforeMethod or @BeforeClass since this is required for only a few of the tests in a TestClass.
I can set a Global Flag based on the failure of this test, but then again I can't skip Testng tests based on Flags. So I will get false Negatives.
Is there a way to create a test in a parent class and skip some tests if this fails?