Default parameters for TestNG IDEA Plugin

Published: 8:11 PM GMT+12, Saturday, 11 November 2006 under: technology
testing  framework  testng  java 

One of the better features of TestNG was the introduction of injectable parameters, via either @DataProvider or @Parameter annotations. However, once I started changing my tests to use parameters I found I lost the ability to simply select a test method and right-click on "Run Test" due to the lack of parameters being defined. It wasn't so much of a hassle to edit the generated IDEA run-profile and setup some parameter entries, or select a properties file, but that extra step soon became annoying.

By adding a new project level component I can now define a series of 'global' parameters and project settings:

Once this is configured I can simply write a test that uses parameters and hit run...

@Test
@Parameters({"username"})
public void testParam(String username) {
    assert "talios".equals(username);
}

...and get the following result:

A few more tweaks and I should have this out to the plugin repository...

Comments (0)

Add Comment