bruno-smoke-test-generator
Generator สำหรับสร้าง Bruno API test collections อัตโนมัติจาก OpenAPI specs หรือ endpoint definitions
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Bruno Smoke Test Generator
Overview
สร้าง Bruno (API testing tool) test collections อัตโนมัติจาก OpenAPI specs เพื่อ smoke test APIs
Why This Matters
- Fast testing: Smoke tests ใน 1 นาที
- Auto-generated: จาก OpenAPI spec
- Version control: Bruno files เป็น text
- CI-ready: Run ใน pipeline ได้
Quick Start
# Generate from OpenAPI
npx generate-bruno-tests --from-openapi api-spec.yaml
# Output:
bruno/
├── users/
│ ├── create-user.bru
│ ├── get-users.bru
│ └── get-user.bru
└── bruno.json
Generated Test
# create-user.bru
meta {
name: Create User
type: http
seq: 1
}
post {
url: {{baseUrl}}/users
body: json
auth: bearer
}
auth:bearer {
token: {{authToken}}
}
body:json {
{
"email": "test@example.com",
"name": "Test User",
"password": "password123"
}
}
assert {
res.status: eq 201
res.body.data.email: eq test@example.com
}
tests {
test("should create user", function() {
expect(res.status).to.equal(201);
expect(res.body.data).to.have.property('id');
});
}
Environment Variables
# bruno/environments/local.bru
vars {
baseUrl: http://localhost:3000
authToken: {{process.env.AUTH_TOKEN}}
}
Run Tests
# Run all tests
bruno run bruno/
# Run specific collection
bruno run bruno/users/
# In CI
bruno run bruno/ --env production
Summary
Bruno Test Generator: สร้าง API smoke tests อัตโนมัติ
From:
- OpenAPI specs
- Endpoint definitions
- Existing APIs
Features:
- Auto-assertions
- Environment vars
- Auth handling
- CI-ready
Usage:
npx generate-bruno-tests --from-openapi api.yaml
bruno run bruno/
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!