review-test-code
Review test files for pattern compliance, code quality, correctness, coverage gaps, and best practices — produces actionable feedback
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Review test files for pattern compliance, code quality, correctness, coverage gaps, and best practices — produces actionable feedback
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Scaffold E2E UI test files following project patterns — Playwright assertions, Page Objects, Components, markers, fixtures, Allure decorators, BrowserStorage
Scaffold GraphQL API test files following project patterns — markers, fixtures, Allure decorators, Pydantic assertions, try-finally cleanup
Scaffold REST API test files and factory fixture conftest files — admin auth, RestClient, factory fixtures with auto-teardown, Allure steps, CRUD patterns
Create Page Objects (MainLayout/CheckoutLayout subclasses) and UI Components (Component subclasses) with Playwright locators and data-test-id conventions
Create GraphQL Operations classes (BaseOperations subclass with auto-fragment injection) and Pydantic GqlModel types for response/input types
Migrate a Katalon REST API test module from vc-quality-gate-katalon into the refactored Pytest project — end-to-end flow from inventory to CI-verified PR
| name | review-test-code |
| description | Review test files for pattern compliance, code quality, correctness, coverage gaps, and best practices — produces actionable feedback |
| argument-hint | <file-path-or-pattern> |
When reviewing test code, systematically check every item below and report only actual issues found.
Read the target test file(s) completely. Also read related files:
For every test function, verify:
@pytest.mark.graphql / @pytest.mark.e2e / @pytest.mark.restapi@allure.feature("<Domain> (<TestType>)") with correct naming@allure.title("<Action description>") — descriptive, not generic-> None on test function_PRODUCT_ID = "..." (not inline strings)test_<feature>_<action> patterngraphql_client fixture (not manual GraphQLClient())ctx fixture for store/user/currency/culture (not hardcoded)@pytest.mark.with_cart, @pytest.mark.with_usercart.id, cart.is_anonymous (not cart["id"])has_line_item() for cart line-item assertions (from utils.line_item_utils import has_line_item)CartOperations(client=graphql_client) (keyword arg)cart: Cart | None = NoneCartPage(global_settings=global_settings, page=page)page_object.navigate() (not page.goto())expect() (not bare assert)data-test-id (not CSS class or XPath)time.sleep() anywhereroot= keyword: Component(root=locator)@pytest.mark.with_user (not manual BrowserStorage)make_product, make_catalog (not manual create/delete)with allure.step() blocks@allure.feature("<Module> / <Entity> (REST API)") namingexcept HTTPError as e: with status code check@pytest.mark.serial for tests that mutate global stateglobal_settings or ctxglobal_settings.frontend_base_url etc.finally, not after assertSecretStr access — uses .get_secret_value() for passwordsassert for UI state in E2E testtime.sleep() in any codepage.goto() instead of navigate()data-test-idallure.step() for logical grouping## Review: <file_path>
### Summary
<1-2 sentence assessment: what's good, what needs work>
### Critical Issues
- **[line N]** <issue description> — **Fix:** <specific fix>
### Warnings
- **[line N]** <issue description> — **Suggestion:** <specific improvement>
### Suggestions
- <improvement idea with rationale>
### Coverage Gaps
- <missing test scenario that should exist>
### Verdict
APPROVE | REQUEST_CHANGES | NEEDS_DISCUSSION
When reviewing multiple files, produce one section per file, then a final overall summary.