rest-api-test-generator
SolidGenerates REST API tests using RestAssured or MockMvc with loop prevention and incremental validation. Triggers on: "test API endpoints", "generate API tests", "test REST API", "create integration tests".
API & Backend 7 stars
3 forks Updated today MIT
Install
Quality Score: 81/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# REST API Test Generator
## Instructions
### Step 1: API Discovery
Ask the user:
1. Which endpoint? (e.g., `POST /api/users`)
2. Framework? (RestAssured, MockMvc)
3. Authentication? (Bearer token, Basic auth, none)
4. Test environment? (Mock server, local, staging)
5. Request body example and expected response codes
Provide an upfront estimate: **15-20 credits per test scenario**.
### Step 2: Generate 3 Scenarios Per Batch
Generate exactly 3 test scenarios:
1. **Success case** (e.g., 201 Created)
2. **Validation error** (e.g., 400 Bad Request)
3. **Business logic error** (e.g., 409 Conflict, 404 Not Found)
Use RestAssured template:
```java
@Test
void shouldCreateUser_whenValidRequest() {
given()
.contentType(ContentType.JSON)
.body(validUserRequest)
.when()
.post("/api/users")
.then()
.statusCode(201)
.body("id", notNullValue())
.body("email", equalTo("test@example.com"));
}
```
**STOP after 3 tests.** Ask the user to run and confirm responses match.
### Step 3: Validation Gate
Validation command:
```bash
python scripts/validate_api_tests.py <TestClassName> --base-url http://localhost:8080
```
Do NOT generate more tests until the user confirms the current batch passes.
### Step 4: Fix or Skip (Max 2 Attempts)
If tests fail:
- **Attempt 1:** Check request/response format, Content-Type, auth token
- **Attempt 2:** Adjust assertions (nested paths, flexible matchers like `hasKey`, `anyOf`)
- **After 2 failu...
Details
- Author
- timwukp
- Repository
- timwukp/agent-skills-best-practice
- Created
- 4 months ago
- Last Updated
- today
- Language
- Python
- License
- MIT
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
Testing & QA Solid
java-unit-test-generator
Generates JUnit unit tests for Java classes with loop prevention and incremental generation. Triggers on: "generate unit tests", "create JUnit tests", "test Java class", "add test coverage".
7 Updated today
timwukp API & Backend Listed
api-test-generate
Auto-generate comprehensive API tests for REST and GraphQL endpoints with request/response validation
1 Updated 1 weeks ago
manastalukdar AI & Automation Featured
api-test-suite-builder
Use when the user asks to generate API tests, create integration test suites, test REST endpoints, or build contract tests.
23,263 Updated 1 weeks ago
alirezarezvani