Overriding annotations

12 views
Skip to first unread message

edwolb

unread,
Oct 24, 2012, 9:34:15 AM10/24/12
to testng...@googlegroups.com
I looked around and couldn't find anything describing this, other than perhaps the AnnotationTransformer, but it looks to only modify the value of an annotation, not the actual annotation.

I have a base class which has a bunch of @BeforeClass setup methods:

class TestTemplate {
  
  public WebDriver driver;

  @BeforeClass
  public void setupDriver() {
    driver = new ChromeDriver();
  }
}

I now have a test class which extends it, however for this particular class I want to run its method in parallel.  This involves making sure drivers are setup before the method, not before the class:

class Test extends TestTemplate {
  
  // Can I tell setupDriver() to run beforeMethod instead of beforeClass()?
  @BeforeMethod
  public void setupDriver() {
    super.setupDriver();  ?? or something similar?
  }

}
Reply all
Reply to author
Forward
0 new messages