mcpbeat Sign in

Testng Skill

> Generates TestNG tests in Java with groups, data providers, parallel execution, XML suite configuration, and listeners. Use when user mentions "TestNG", "testng.xml", "TestNG suite", "parallel tests Java".

7k tokens
context cost
the whole folder, loaded on every use
3
files
instructions only
0
copies elsewhere
how many repositories repackaged it
343
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/LambdaTest/agent-skills --skill testng-skill

The instruction itself

12 sections, as written by the author

TestNG Testing Skill

Core Patterns

Basic Test with Groups

import org.testng.annotations.*;
import org.testng.Assert;

public class LoginTest {
    @BeforeMethod
    public void setUp() { /* setup */ }

    @Test(groups = "smoke")
    public void testLoginSuccess() {
        Assert.assertTrue(loginService.login("[email protected]", "password123"));
    }

    @Test(groups = "regression", dependsOnMethods = "testLoginSuccess")
    public void testAccessDashboard() {
        Assert.assertNotNull(dashboard.getContent());
    }

    @Test(expectedExceptions = AuthenticationException.class)
    public void testLoginInvalidPassword() {
        loginService.login("[email protected]", "wrong");
    }

    @AfterMethod
    public void tearDown() { /* cleanup */ }
}

Data Providers

@DataProvider(name = "loginData")
public Object[][] loginData() {
    return new Object[][] {
        {"[email protected]", "admin123", true},
        {"[email protected]", "password", true},
        {"[email protected]", "wrong", false},
    };
}

@Test(dataProvider = "loginData")
public void testLogin(String email, String password, boolean expected) {
    Assert.assertEquals(loginService.login(email, password), expected);
}

TestNG XML Suite

<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Regression" parallel="tests" thread-count="5">
  <test name="Smoke">
    <groups><run><include name="smoke"/></run></groups>
    <classes><class name="tests.LoginTest"/></classes>
  </test>
  <test name="Full">
    <groups><run><include name="regression"/><exclude name="flaky"/></run></groups>
    <packages><package name="tests.*"/></packages>
  </test>
</suite>

Parallel Execution

<suite parallel="methods" thread-count="5">   <!-- Method level -->
<suite parallel="classes" thread-count="5">    <!-- Class level -->
<suite parallel="tests" thread-count="5">      <!-- Test level -->

Soft Assertions

SoftAssert soft = new SoftAssert();
soft.assertEquals(user.getName(), "Alice");
soft.assertEquals(user.getAge(), 25);
soft.assertTrue(user.isActive());
soft.assertAll();  // Reports all failures at once

Listeners

public class TestListener implements ITestListener {
    @Override public void onTestFailure(ITestResult result) {
        System.out.println("Failed: " + result.getName());
        // Take screenshot, log, etc.
    }
}

@Listeners(TestListener.class)
public class LoginTest { /* ... */ }

Lifecycle Annotations

@BeforeSuite → @BeforeTest → @BeforeClass → @BeforeMethod → @Test → @AfterMethod → @AfterClass → @AfterTest → @AfterSuite

Anti-Patterns

| Bad | Good | Why |

|-----|------|-----|

| dependsOnMethods everywhere | Independent tests | Cascading failures |

| No groups | @Test(groups = "smoke") | Can't run subsets |

| Hard-coded test data | @DataProvider | Reusable |

| Priority ordering | Independent tests | Fragile |

Quick Reference

| Task | Command |

|------|---------|

| Run suite | mvn test -DsuiteXmlFile=testng.xml |

| Run group | mvn test -Dgroups=smoke |

| Run class | mvn test -Dtest=LoginTest |

| Reports | test-output/index.html |

Deep Patterns → reference/playbook.md

| § | Section | Lines |

|---|---------|-------|

| 1 | Project Setup & Configuration | Maven + Surefire config |

| 2 | Suite XML Configuration | Multi-env, parallel, groups |

| 3 | BaseTest & Thread-Safe Driver | ThreadLocal, ConfigReader |

| 4 | Data Providers (Advanced) | Excel, JSON, CSV, parallel, cross-class |

| 5 | Factory Pattern | Cross-browser matrix |

| 6 | Listeners (Production Suite) | Retry, screenshot, timing |

| 7 | Soft Assertions & Dependencies | Groups, method deps |

| 8 | Page Object Integration | PageFactory, fluent POs |

| 9 | Parallel Execution Strategies | Method/class/test/mixed |

| 10 | Reporting Integration | Allure, ExtentReports |

| 11 | CI/CD Integration | GitHub Actions, Jenkins |

| 12 | Debugging Quick-Reference | 12 common problems |

| 13 | Best Practices Checklist | 14 items |

Other skills for the same job

different authors, same section of the catalogue
Loki Mode
by ComeOnOliver
×2

Multi-agent autonomous startup system for Claude Code. Triggers on "Loki Mode". Orchestrates 100+ specialized agents across engineering, QA, DevOps, security, data/ML, business operations, marketing, HR, and customer success. Takes PRD to fully deployed, revenue-generating product with zero human intervention. Features Task tool for subagent dispatch, parallel code review with 3 specialized reviewers, severity-based issue triage, distributed task queue with dead letter handling, automatic deployment to cloud providers, A/B testing, customer feedback loops, incident response, circuit breakers, and self-healing. Handles rate limits via distributed state checkpoints and auto-resume with exponential backoff. Requires --dangerously-skip-permissions flag.

3528k tokens scripts
Error Debugging Multi Agent Review
by lingxling
×1

Use when working with error debugging multi agent review

2k tokens
Evaluation
by lingxling
×1

Build evaluation frameworks for agent systems. Use when testing agent performance systematically, validating context engineering choices, or measuring improvements over time.

3k tokens
Agent Communication Debugger
by ComeOnOliver
×1

Diagnoses and debugs A2A agent communication issues including agent status, message routing, transport connectivity, and log analysis. Use when agents aren't responding, messages aren't being delivered, routing is incorrect, or when debugging orchestrator, coder-agent, tester-agent communication problems.

23k tokens scripts
Error Debugging Multi Agent Review
by ComeOnOliver
×1

Use when working with error debugging multi agent review

4k tokens
Micro Skill Creator
by ComeOnOliver
×1

Rapidly creates atomic, focused skills optimized with evidence-based prompting, specialist agents, and systematic testing. Each micro-skill does one thing exceptionally well using self-consistency, program-of-thought, and plan-and-solve patterns. Enhanced with agent-creator principles and functionality-audit validation. Perfect for building composable workflow components.

6k tokens
Ohmg
by ComeOnOliver
×1

Ultimate multi-agent framework for Google Antigravity. Orchestrates specialized domain agents (PM, Frontend, Backend, Mobile, QA, Debug) via Serena Memory.

3k tokens
Evaluation
by ComeOnOliver
×1

This skill should be used when the user asks to "evaluate agent performance", "build test framework", "measure agent quality", "create evaluation rubrics", or mentions LLM-as-judge, multi-dimensional evaluation, agent testing, or quality gates for agent pipelines.

13k tokens scripts

How to use it

Copy the folder

Take lambdatest/testng-skill from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.