BeforeSuite/AfterTest and Before/After Method class for multiple Test Classes
I would like to have a class that performs a BeforeSuite and AfterTest method to set up and tear down the environment for the rest of my test classes, and have those test classes share a Before/After Method method, in the same class as the Before and After Suite methods if possible. How would I go about doing this?
As an example, using selenium I have the aforementioned class:
This is a very simple example, my needs would expand on this structure. I haven't included the SetUpTearDown class in the testng.xml because I first tried extending it to NewTest1 and 2, but that would result in NewTest1 failing with a NullPointerException for driver in beforeMethod, but I mainly believe it should be independent of the xml suite, although I am open to any and all suggestions. Thanks in advance.