{"id":37017198,"url":"https://github.com/ly1012/groot","last_synced_at":"2026-01-14T01:58:11.801Z","repository":{"id":278848807,"uuid":"935946110","full_name":"ly1012/groot","owner":"ly1012","description":"一个通用、易用、易扩展的 Java 自动化测试工具","archived":false,"fork":false,"pushed_at":"2025-06-28T03:13:26.000Z","size":744,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-28T04:23:39.815Z","etag":null,"topics":["api","automation","test"],"latest_commit_sha":null,"homepage":"https://liyunx.com/groot-docs","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ly1012.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-20T09:26:05.000Z","updated_at":"2025-06-28T03:13:30.000Z","dependencies_parsed_at":"2025-02-22T04:21:33.843Z","dependency_job_id":"bc28b7e9-3397-4f9b-9138-916f77ae01b5","html_url":"https://github.com/ly1012/groot","commit_stats":null,"previous_names":["ly1012/groot"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ly1012/groot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ly1012%2Fgroot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ly1012%2Fgroot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ly1012%2Fgroot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ly1012%2Fgroot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ly1012","download_url":"https://codeload.github.com/ly1012/groot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ly1012%2Fgroot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"ssl_error","status_checked_at":"2026-01-14T01:40:32.775Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","automation","test"],"created_at":"2026-01-14T01:58:11.272Z","updated_at":"2026-01-14T01:58:11.795Z","avatar_url":"https://github.com/ly1012.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003e [!TIP]\n\u003e 当前版本完整实现了核心功能，但生态还较弱。欢迎提交 Pull 请求、扩展组件或 Issues。\n\nGroot 是一款基于 Java 生态构建的轻量级自动化测试工具，为测试人员和技术团队提供高效的自动化能力支撑。通过多种形式的用例支持与简洁的设计理念，帮助快速落地自动化测试、数据工厂构建、接口健康巡检、测试平台开发等核心质量保障场景。\n\n项目提供了多个扩展点，可通过扩展实现功能增强，比如协议扩展、控制器扩展、认证与加解密扩展、断言扩展、报告扩展、函数扩展等等。\n\n同时支持代码风格用例（Java/Groovy）和配置风格用例（Yaml/Json）。代码风格用例推荐 Groovy，配置风格用例推荐 Yaml。\n\n## 下载与文档\n\n本项目为标准 Java 项目，可通过 Maven/Gradle 下载依赖。\n\n帮助文档：[GitHub Pages 访问](https://ly1012.github.io/groot-docs)、[国内站点](https://liyunx.com/groot-docs)。\n\n使用示例：参考源码中的单元测试。\n\n## 用例演示\n\n**Yaml 用例**\n\n```yaml\nname: MultiPart 测试用例\nsteps:\n  - name: 上传多个文件\n    http:\n      url: /multipart/upload\n      method: POST\n      multipart:\n        - file: data/降龙十八掌.txt\n        - file: data/独孤九剑.txt\n    validate:\n      - statusCode: 200\n```\n\n**Json 用例**\n\n```json\n{\n  \"name\": \"MultiPart 测试用例\",\n  \"steps\": [\n    {\n      \"name\": \"上传多个文件\",\n      \"http\": {\n        \"url\": \"/multipart/upload\",\n        \"method\": \"POST\",\n        \"multipart\": [\n          {\n            \"file\": \"data/降龙十八掌.txt\"\n          },\n          {\n            \"file\": \"data/独孤九剑.txt\"\n          }\n        ]\n      },\n      \"validate\": [\n        {\n          \"statusCode\": 200\n        }\n      ]\n    }\n  ]\n}\n```\n\n**Java 用例**\n\n方法命名规范：\n\n- 方法名为关键字或变形关键字：不包含配置和前后置。比如直接发送请求，并在 then 回调中提取或断言响应内容。\n- 方法名为关键字或变形关键字 + With：包含配置和前后置。比如对请求进行额外的配置（比如设置代理）、增加提取操作和断言。\n\n测试框架为 TestNG，依赖 groot-testng 模块。\n\n```java\npublic class PostTest extends GrootTestNGTestCase {\n\n    @GrootSupport\n    @Test(description = \"MultiPart：上传多个文件\")\n    public void testPost() {\n        http(\"上传多个文件1\", request -\u003e request\n            .post(\"/multipart/upload\")\n            .multiPartFile(\"data/降龙十八掌.txt\")\n            .multiPartFile(\"data/独孤九剑.txt\")\n        ).then(r -\u003e {\n            Assertions.assertThat(r.getResponse().getStatus()).isEqualTo(200);\n        });\n\n        httpWith(\"上传多个文件2\", action -\u003e action\n            .request(request -\u003e request\n                .post(\"/multipart/upload\")\n                .multiPartFile(\"data/降龙十八掌.txt\")\n                .multiPartFile(\"data/独孤九剑.txt\"))\n            .validate(validate -\u003e validate\n                .statusCode(200)));\n    }\n\n}\n```\n\n**Groovy 用例**\n\n编码形式的用例推荐使用 Groovy 风格用例，易于书写和阅读。\n\n```groovy\nclass PostGroovyTest extends GrootTestNGTestCase {\n\n    @GrootSupport\n    @Test(description = \"MultiPart：上传多个文件\")\n    void testMultiPart_MultiFile() {\n        http(\"上传多个文件1\") {\n            post \"/multipart/upload\"\n            multiPartFile \"data/降龙十八掌.txt\"\n            multiPartFile \"data/独孤九剑.txt\"\n        }.then {\n            Assertions.assertThat(it.response.status).isEqualTo(200)\n        }\n\n        httpWith(\"上传多个文件2\") {\n            request {\n                post \"/multipart/upload\"\n                multiPartFile \"data/降龙十八掌.txt\"\n                multiPartFile \"data/独孤九剑.txt\"\n            }\n            validate {\n                statusCode 200\n            }\n        }\n    }\n\n}\n```\n\n## 二次开发\n\n基于 Groot 进行定制化开发，通常不需要修改 Groot 项目源码。Groot 采用插拔式插件设计，我们可以新建一个插件（扩展）项目，并根据扩展点规范完成扩展组件开发，用户引入新的扩展组件依赖即可完成功能增强。\n\nGroot 提供的是自动化基础能力，你可以基于此进行更高维度的封装。\n\n详情见帮助文档中的 `使用指南 - 扩展与开发`。\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fly1012%2Fgroot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fly1012%2Fgroot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fly1012%2Fgroot/lists"}