| name | testng-skill |
| description | Generates TestNG tests in Java with groups, data providers, parallel execution, XML suite configuration, and listeners. Use when user mentions "TestNG", "@DataProvider", "testng.xml", "groups". Triggers on: "TestNG", "@DataProvider", "testng.xml", "TestNG suite", "parallel tests Java". |
| risk | unknown |
| source | https://github.com/LambdaTest/agent-skills/tree/main/testng-skill |
| source_repo | LambdaTest/agent-skills |
| source_type | community |
| date_added | 2026-07-01T00:00:00.000Z |
| license | MIT |
| license_source | https://github.com/LambdaTest/agent-skills/blob/main/LICENSE |
TestNG Testing Skill
When to Use
Use this skill when you need generates TestNG tests in Java with groups, data providers, parallel execution, XML suite configuration, and listeners. Use when user mentions "TestNG", "@DataProvider", "testng.xml", "groups". Triggers on: "TestNG", "@DataProvider", "testng.xml", "TestNG suite", "parallel tests Java".
Core Patterns
Basic Test with Groups
import org.testng.annotations.*;
import org.testng.Assert;
public class LoginTest {
@BeforeMethod
public void setUp() { }
@Test(groups = "smoke")
public void testLoginSuccess() {
Assert.assertTrue(loginService.login("user@test.com", "password123"));
}
@Test(groups = "regression", dependsOnMethods = "testLoginSuccess")
public void testAccessDashboard() {
Assert.assertNotNull(dashboard.getContent());
}
@Test(expectedExceptions = AuthenticationException.class)
public void testLoginInvalidPassword() {
loginService.login("user@test.com", "wrong");
}
@AfterMethod
public void tearDown() { }
}
Data Providers
@DataProvider(name = "loginData")
public Object[][] loginData() {
[][] {
{, , },
{, , },
{, , },
};
}
{
Assert.assertEquals(loginService.login(email, password), expected);
}