一键导入
qa-rest-assured-writer
Generate REST Assured API tests for Java with BDD-style syntax, JSON/XML schema validation, authentication handling, and Allure reporting.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate REST Assured API tests for Java with BDD-style syntax, JSON/XML schema validation, authentication handling, and Allure reporting.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Master skill coordinating all QA skills through pipeline modes (full-cycle, docs-only, testcases-only, write-tests, report), formalized handoff chains, scheduler rules, and framework/language selection based on project context.
QA project memory with auto-update. Structured log of bugs, decisions, tests, regressions, environments. Automatically updated after every QA task. Archive system with searchable index for large projects. Trigger phrases (EN): "initialize memory", "init qa memory", "find known bug", "search memory", "show what was done", "check regressions", "memory status", "archive memory", "log a bug", "add decision", "memory summary", "what bugs do we know", "update memory", "show test log". Trigger phrases (UA): "ініціалізувати пам'ять", "знайти відомий баг", "пошук у пам'яті", "показати що було зроблено", "перевірити регресії", "статус пам'яті", "архівувати пам'ять", "залогувати баг", "додати рішення", "зведення пам'яті", "які баги відомі", "оновити пам'ять", "показати лог тестів", "що ми вирішили про", "які тестові середовища є".
Analyze OpenAPI/Swagger spec (JSON or YAML) against existing test files and generate an HTML coverage report with QA automation tasks. Use when user provides an OpenAPI spec file and wants to know test coverage status.
Generate accessibility tests for WCAG 2.2 compliance using axe-core, Pa11y, and Lighthouse with automated checks for ARIA patterns, keyboard navigation, color contrast, and screen reader support.
Manage and formalize API contracts from existing endpoints, swagger/JSON, network traffic, or developer interviews into OpenAPI specifications.
Autonomously explore live web applications using Playwright MCP to collect page structure, form fields, validation rules, API endpoints, and user flows for test case generation.
| name | qa-rest-assured-writer |
| description | Generate REST Assured API tests for Java with BDD-style syntax, JSON/XML schema validation, authentication handling, and Allure reporting. |
| output_dir | tests/api |
| dependencies | {"recommended":["qa-api-contract-curator"]} |
Write REST Assured API tests from test cases and API contracts. Transform structured test cases (from qa-testcase-from-docs, qa-api-contract-curator, OpenAPI specs) into executable REST Assured test files with BDD-style syntax, JSON/XML schema validation, authentication handling, and Allure reporting.
| Feature | Description |
|---|---|
| BDD-style | given().when().then() fluent API for readable tests |
| JSON schema | JsonSchemaValidator for response schema validation |
| XML schema | XML schema validation support |
| Authentication | Basic, Bearer, OAuth2, custom headers |
| Request/Response spec | RequestSpecification, ResponseSpecification for reuse |
| Serialization | Jackson/Gson for POJO serialization/deserialization |
| Extraction | extract().response(), path(), jsonPath() for assertions |
| Allure | @Step, @Description, @Severity for reporting |
{Resource}ApiTest.java with BDD structuremvn test to execute tests| Pattern | Usage |
|---|---|
given().header().body().when().post().then().statusCode(201) | Basic request/response |
given().auth().oauth2(token) | Bearer token auth |
given().auth().basic(user, pass) | Basic auth |
then().body(JsonSchemaValidator.matchesJsonSchema(schema)) | JSON schema validation |
RequestSpecification | Reusable request config (base URI, headers) |
ResponseSpecification | Reusable response assertions |
extract().response() | Extract response for further assertions |
extract().path("$.id") | Extract value from JSON path |
@Test
@DisplayName("Create user returns 201")
void createUser_returns201() {
given()
.contentType(ContentType.JSON)
.body(userRequest)
.when()
.post("/users")
.then()
.statusCode(201)
.body("id", notNullValue())
.body("email", equalTo("user@example.com"));
}
{Resource}ApiTest.java — Test classes (e.g., UserApiTest.java, OrderApiTest.java)src/test/java per Maven conventionCan do (autonomous):
Cannot do (requires confirmation):
Will not do (out of scope):
mvn test)references/patterns.md — CRUD, auth, validation, filters, serializationreferences/config.md — Maven config, base URI, loggingreferences/best-practices.md — API testing best practices with REST Assured{Resource}ApiTest.java convention| Symptom | Likely Cause | Fix |
|---|---|---|
| Connection refused | Wrong base URI, service not running | Verify baseUri; ensure API is up |
| 401/403 | Missing or invalid auth | Add auth to given(); check token expiry |
| Schema validation fails | Schema mismatch, wrong path | Verify schema file; check JSON path |
| Body assertion fails | Wrong JSON path, type mismatch | Use jsonPath() to debug; ensure correct type |
| Timeout | Slow API, network | Increase timeout in config |
| Serialization error | POJO mismatch | Verify POJO fields match JSON; check annotations |