{"slug":"testng-skill","title":"testng-skill","summary":"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 ","platform":"ChatGPT","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-08-16T13:39:03.338244Z","repo":{"url":"https://github.com/sickn33/agentic-awesome-skills","stars":46883,"forks":6831,"license":"MIT","updatedAt":"2026-09-25T05:43:16Z"},"bodyHtml":"<hr>\n<h2>name: testng-skill\ndescription: '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\".'\nrisk: critical\nsource: <a href=\"https://github.com/LambdaTest/agent-skills/tree/main/testng-skill\">https://github.com/LambdaTest/agent-skills/tree/main/testng-skill</a>\nsource_repo: LambdaTest/agent-skills\nsource_type: community\ndate_added: 2026-07-01\nlicense: MIT\nlicense_source: <a href=\"https://github.com/LambdaTest/agent-skills/blob/main/LICENSE\">https://github.com/LambdaTest/agent-skills/blob/main/LICENSE</a></h2>\n<h1>TestNG Testing Skill</h1>\n<h2>When to Use</h2>\n<p>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\".</p>\n<h2>Core Patterns</h2>\n<h3>Basic Test with Groups</h3>\n<pre><code>import org.testng.annotations.*;\nimport org.testng.Assert;\n\npublic class LoginTest {\n    @BeforeMethod\n    public void setUp() { /* setup */ }\n\n    @Test(groups = \"smoke\")\n    public void testLoginSuccess() {\n        Assert.assertTrue(loginService.login(\"user@test.com\", \"password123\"));\n    }\n\n    @Test(groups = \"regression\", dependsOnMethods = \"testLoginSuccess\")\n    public void testAccessDashboard() {\n        Assert.assertNotNull(dashboard.getContent());\n    }\n\n    @Test(expectedExceptions = AuthenticationException.class)\n    public void testLoginInvalidPassword() {\n        loginService.login(\"user@test.com\", \"wrong\");\n    }\n\n    @AfterMethod\n    public void tearDown() { /* cleanup */ }\n}\n</code></pre>\n<h3>Data Providers</h3>\n<pre><code>@DataProvider(name = \"loginData\")\npublic Object[][] loginData() {\n    return new Object[][] {\n        {\"admin@test.com\", \"admin123\", true},\n        {\"user@test.com\", \"password\", true},\n        {\"invalid@test.com\", \"wrong\", false},\n    };\n}\n\n@Test(dataProvider = \"loginData\")\npublic void testLogin(String email, String password, boolean expected) {\n    Assert.assertEquals(loginService.login(email, password), expected);\n}\n</code></pre>\n<h3>TestNG XML Suite</h3>\n<pre><code>&lt;!DOCTYPE suite SYSTEM \"https://testng.org/testng-1.0.dtd\"&gt;\n&lt;suite name=\"Regression\" parallel=\"tests\" thread-count=\"5\"&gt;\n  &lt;test name=\"Smoke\"&gt;\n    &lt;groups&gt;&lt;run&gt;&lt;include name=\"smoke\"/&gt;&lt;/run&gt;&lt;/groups&gt;\n    &lt;classes&gt;&lt;class name=\"tests.LoginTest\"/&gt;&lt;/classes&gt;\n  &lt;/test&gt;\n  &lt;test name=\"Full\"&gt;\n    &lt;groups&gt;&lt;run&gt;&lt;include name=\"regression\"/&gt;&lt;exclude name=\"flaky\"/&gt;&lt;/run&gt;&lt;/groups&gt;\n    &lt;packages&gt;&lt;package name=\"tests.*\"/&gt;&lt;/packages&gt;\n  &lt;/test&gt;\n&lt;/suite&gt;\n</code></pre>\n<h3>Parallel Execution</h3>\n<pre><code>&lt;suite parallel=\"methods\" thread-count=\"5\"&gt;   &lt;!-- Method level --&gt;\n&lt;suite parallel=\"classes\" thread-count=\"5\"&gt;    &lt;!-- Class level --&gt;\n&lt;suite parallel=\"tests\" thread-count=\"5\"&gt;      &lt;!-- Test level --&gt;\n</code></pre>\n<h3>Soft Assertions</h3>\n<pre><code>SoftAssert soft = new SoftAssert();\nsoft.assertEquals(user.getName(), \"Alice\");\nsoft.assertEquals(user.getAge(), 25);\nsoft.assertTrue(user.isActive());\nsoft.assertAll();  // Reports all failures at once\n</code></pre>\n<h3>Listeners</h3>\n<pre><code>public class TestListener implements ITestListener {\n    @Override public void onTestFailure(ITestResult result) {\n        System.out.println(\"Failed: \" + result.getName());\n        // Take screenshot, log, etc.\n    }\n}\n\n@Listeners(TestListener.class)\npublic class LoginTest { /* ... */ }\n</code></pre>\n<h3>Lifecycle Annotations</h3>\n<pre><code>@BeforeSuite → @BeforeTest → @BeforeClass → @BeforeMethod → @Test → @AfterMethod → @AfterClass → @AfterTest → @AfterSuite\n</code></pre>\n<h3>Anti-Patterns</h3>\n<table>\n<thead>\n<tr>\n<th>Bad</th>\n<th>Good</th>\n<th>Why</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>dependsOnMethods</code> everywhere</td>\n<td>Independent tests</td>\n<td>Cascading failures</td>\n</tr>\n<tr>\n<td>No groups</td>\n<td><code>@Test(groups = \"smoke\")</code></td>\n<td>Can't run subsets</td>\n</tr>\n<tr>\n<td>Hard-coded test data</td>\n<td><code>@DataProvider</code></td>\n<td>Reusable</td>\n</tr>\n<tr>\n<td>Priority ordering</td>\n<td>Independent tests</td>\n<td>Fragile</td>\n</tr>\n</tbody>\n</table>\n<h2>Quick Reference</h2>\n<table>\n<thead>\n<tr>\n<th>Task</th>\n<th>Command</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Run suite</td>\n<td><code>mvn test -DsuiteXmlFile=testng.xml</code></td>\n</tr>\n<tr>\n<td>Run group</td>\n<td><code>mvn test -Dgroups=smoke</code></td>\n</tr>\n<tr>\n<td>Run class</td>\n<td><code>mvn test -Dtest=LoginTest</code></td>\n</tr>\n<tr>\n<td>Reports</td>\n<td><code>test-output/index.html</code></td>\n</tr>\n</tbody>\n</table>\n<h2>Deep Patterns → <code>reference/playbook.md</code></h2>\n<table>\n<thead>\n<tr>\n<th>§</th>\n<th>Section</th>\n<th>Lines</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>1</td>\n<td>Project Setup &amp; Configuration</td>\n<td>Maven + Surefire config</td>\n</tr>\n<tr>\n<td>2</td>\n<td>Suite XML Configuration</td>\n<td>Multi-env, parallel, groups</td>\n</tr>\n<tr>\n<td>3</td>\n<td>BaseTest &amp; Thread-Safe Driver</td>\n<td>ThreadLocal, ConfigReader</td>\n</tr>\n<tr>\n<td>4</td>\n<td>Data Providers (Advanced)</td>\n<td>Excel, JSON, CSV, parallel, cross-class</td>\n</tr>\n<tr>\n<td>5</td>\n<td>Factory Pattern</td>\n<td>Cross-browser matrix</td>\n</tr>\n<tr>\n<td>6</td>\n<td>Listeners (Production Suite)</td>\n<td>Retry, screenshot, timing</td>\n</tr>\n<tr>\n<td>7</td>\n<td>Soft Assertions &amp; Dependencies</td>\n<td>Groups, method deps</td>\n</tr>\n<tr>\n<td>8</td>\n<td>Page Object Integration</td>\n<td>PageFactory, fluent POs</td>\n</tr>\n<tr>\n<td>9</td>\n<td>Parallel Execution Strategies</td>\n<td>Method/class/test/mixed</td>\n</tr>\n<tr>\n<td>10</td>\n<td>Reporting Integration</td>\n<td>Allure, ExtentReports</td>\n</tr>\n<tr>\n<td>11</td>\n<td>CI/CD Integration</td>\n<td>GitHub Actions, Jenkins</td>\n</tr>\n<tr>\n<td>12</td>\n<td>Debugging Quick-Reference</td>\n<td>12 common problems</td>\n</tr>\n<tr>\n<td>13</td>\n<td>Best Practices Checklist</td>\n<td>14 items</td>\n</tr>\n</tbody>\n</table>\n<h2>Limitations</h2>\n<ul>\n<li>Use this skill only when the task clearly matches its upstream source and local project context.</li>\n<li>Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.</li>\n<li>Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.</li>\n</ul>\n","files":[{"path":"SKILL.md","sizeBytes":5385,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-08-16T13:46:58.467649Z","sha256":"4B9BCF489867F3485C7A1259E8E861F686A5E87E0547E69D82BBE7519334D821","sizeBytes":2309},"review":null,"source":{"repositoryUrl":"https://github.com/sickn33/agentic-awesome-skills","path":"skills/testng-skill","license":"MIT","commit":"f2bba339de74414b0771234cbe4f6a15258e32a3","subtreeSha":"487CB2CA81AD69797622980B59A711A33EB94F0A2DBF3543106C0AC883B1E699","lastSyncedAt":"2026-09-25T06:48:39.853703Z"},"reviewedAt":"2026-08-16T13:57:27.234152Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/sickn33/agentic-awesome-skills/tree/main/skills/testng-skill"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install sickn33-agentic-awesome-skills@llmmart"},{"target":"git","command":"git clone https://github.com/sickn33/agentic-awesome-skills.git"}]}