Skills Plugins MCP Prompt Model 博客 我的中心

testng-skill

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".

DeepseekModel 官方收录技能 质量 优秀 · 78 v1.0.0

获取

https://deepseekmodel.com/api/download.php?id=lambdatest-agent-skills-testng-skill-skill-md&format=skill
下载 .skill 标准格式,含 system_prompt 与 model_config,导入任意 Agent 框架即可使用
.skill 文件中 system_prompt 字段的实际内容。
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". languages ["Java"] category unit-testing license MIT metadata {"author":"TestMu AI","version":"1.0"} 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( "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 () { /* cleanup */ } } Data Providers @DataProvider(name = "loginData") public Object[][] loginData() { return new Object [][] { { "admin@test.com" , "admin123" , true }, { "user@test.com" , "password" , true }, { "invalid@test.com" , "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
Agent 识别该技能的关键词,点击任意一个即可复制。

该技能未提供触发词。

下载的 .skill 包内含以下字段。
字段 说明
format格式标识(skill/v1)
skill_id技能唯一 ID
name技能名称
version版本号
description技能描述
category所属分类(数组)
trigger_words触发词列表
tags标签列表
source来源标识
source_url来源链接(本页地址)
exported_at导出时间(每次下载生成)
system_prompt系统提示词正文
model_config模型参数:provider / model / temperature / max_tokens / top_p
examples示例
install_guide各平台导入说明(Coze / Dify / Claude / 自定义框架)
同一份技能可按不同平台格式导出。
.skill 标准格式,含 system_prompt 与 model_config,导入任意 Agent 框架即可使用 下载
.skillpro 增强格式,额外含脚本 / 工具 / 依赖 / 钩子占位 下载
.json 纯 JSON 导出,只含 system_prompt 与模型参数 下载
Coze 带 frontmatter 的 Markdown,Coze 平台导入用 下载
Dify Dify DSL,创建应用后直接导入 下载

每日精选 Skill 推荐,免费送到你邮箱

输入邮箱,每天接收一个精选 AI Agent 技能推荐。完全免费,持续更新。

提交后我们会发送一封确认邮件,点击邮件里的链接才会开始收信。

完全免费,取消任意时间。我们不会发送垃圾邮件。