qa-api
[Testing] REST API & GraphQL xAPI — reference lookup, test execution, and test case generation.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
[Testing] REST API & GraphQL xAPI — reference lookup, test execution, and test case generation.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Initialize / onboard this agentic-QA plugin onto a deployment. Installs deps, then asks the operator only what genuinely shapes the config — the environment NAME, the bug tracker (Jira / Azure Boards), the code host (GitHub / Azure Repos), and an auth preference per axis (PAT recommended, else browser/CLI login). Everything else — whether it is a native-platform or a CLIENT project, the client org, the contribution mode, the fork account — is DERIVED from the token + the filled env + a live module/repo scan. Writes project-profile.json + .env.<env> + .env.local + .mcp.json and verifies access. The whole point is to make /qa-fix route each bug to the RIGHT repo (client custom code vs native platform) and file to the RIGHT tracker. Use when standing the plugin up on a new machine or for a new customer.
Initialize / onboard this agentic-QA plugin onto a deployment. Installs deps, then asks the operator only what genuinely shapes the config — the environment NAME, the bug tracker (Jira / Azure Boards), the code host (GitHub / Azure Repos), and an auth preference per axis (PAT recommended, else browser/CLI login). Everything else — whether it is a native-platform or a CLIENT project, the client org, the contribution mode, the fork account — is DERIVED from the token + the filled env + a live module/repo scan. Writes project-profile.json + .env.<env> + .env.local + .mcp.json and verifies access. The whole point is to make /qa-fix route each bug to the RIGHT repo (client custom code vs native platform) and file to the RIGHT tracker. Use when standing the plugin up on a new machine or for a new customer.
[QA Methodology] Gather ALL fresh CI prerelease artifacts for a change (modules + platform + vc-frontend) and deploy them together to the test env (vc-deploy-dev@<TEST_ENV branch>) in ONE manifest update: resolve a tracker ticket's linked PRs across all repos (or an explicit --module/--platform/--theme/--pr set) → each PR's latest vc3prerelease build → minimal-diff repin of backend/packages.json (AzureBlob/BlobName + PlatformVersion) and theme/artifact.json → dry-run combined diff (default) or a gated deploy PR (direct same-repo when the account has write, else a fork PR) → --verify polls the env-branch pin + /api/platform/modules per target. Never merges (a human merges to deploy); writes route through gh's keyring token; prints the web-edit URL when it can't push. Unblocks /qa-test PR#N and /qa-verify-fix.
[QA Method] Triangulate each BL invariant against docs + live + source code, auto-apply confirmed changes to business-logic.md, and reconcile test-case coverage. Delegates the live axis to qa-testing-expert; runs the triangulation via ba-system-analyzer.
Bring up a local Virto Commerce stack (backend + storefront + DB + ES) via start-local, pinned to the ACTUAL deployed package manifest (vc-deploy-dev @ vcptcore-demo); optionally augment it with the module/PR versions a JIRA task needs. Use when asked to spin up / run / provision a local VC environment, reproduce a deployed env locally, or stand up an env to test a specific ticket.
[QA Method] Defect management lifecycle: JIRA Bug Workflow, triage, classification, report validation, verification protocol, defect metrics.
| name | qa-api |
| description | [Testing] REST API & GraphQL xAPI — reference lookup, test execution, and test case generation. |
| argument-hint | ref <module> | test <scope> | cases <scope> |
| disable-model-invocation | true |
Three modes in one skill: look up API reference, execute tests, or write test cases.
/qa-api ref xCart # Look up xCart GraphQL queries & mutations
/qa-api ref xCatalog # Look up xCatalog product/category queries
/qa-api ref auth # Authentication token flow reference
/qa-api ref pageContext # xFrontend pageContext query reference
/qa-api ref store # Store settings & StoreResponseType fields
/qa-api test catalog # Execute REST catalog API tests (Suite 14 subset)
/qa-api test graphql cart # Execute xCart GraphQL mutation tests (Suite 15 subset)
/qa-api test auth # Execute authentication endpoint tests
/qa-api test full # Execute full API test suite (Suite 14 + Suite 15)
/qa-api cases xCart addCoupon # Write test cases for addCoupon mutation
/qa-api cases REST catalog CRUD # Write test cases for catalog REST CRUD
/qa-api cases auth # Write test cases for auth endpoints
/qa-api cases graphql error-handling # Write test cases for GraphQL error scenarios
cases mode.knowledge/api/graphql-schema.md — Authoritative live introspection snapshot of the GraphQL schema. Lists all queries, mutations, input types, return types, and key rules. Consult this FIRST when writing or reviewing any GraphQL test case.knowledge/api/graphql-test-cases-runner.md — Authoritative authoring contract for runner-native GraphQL test cases (the format consumed by scripts/graphql/graphql-runner.ts): full Steps / Assertions / Cleanup tag grammar, predicate shapes, getByPath filter syntax, @td() resolver, capture chaining, common failure modes, authoring checklist, worked example. Read this BEFORE writing ANY GraphQL test case; gold-standard reference suite is regression/suites/Backend/graphql/050i-graphql-configurations.csv.skills/qa-postman/test-data-fixtures.md — @td(ALIAS.field) resolver, test-data/aliases.json registry, and fixture conventions. Read this BEFORE writing entity IDs, SKUs, prices, emails, addresses, or test-card numbers into request bodies — resolve at authoring time, never hardcode.skills/qa-postman/SKILL.md — Postman MCP entry point (modes, workflow, sub-guide index). The Postman MCP authors collections; it does not execute them — execution happens via Newman/Postman CLI/Postman Monitor (see qa-postman/execution.md).NEVER write a GraphQL query, mutation, or filter without verifying it exists in the schema first. Do not guess field names, mutation names, argument types, or filter syntax.
Before writing ANY GraphQL test case:
{ __schema { queryType { fields { name args { name } } } } } — list all queries{ __schema { mutationType { fields { name args { name } } } } } — list all mutations{ __type(name: "TypeName") { fields { name type { name ofType { name } } } } } — check return fields{ __type(name: "InputTypeName") { inputFields { name type { name ofType { name } kind } } } } — check input fieldsxapi-query-ref.md for known-good query templates/virtocommerce/vc-docs) for any operations not in the local refSchema reference: Consult knowledge/api/graphql-schema.md — live introspection snapshot with all queries, mutations, input types, and return types. Key rules from the schema:
CartType has flat money fields (subTotal, total, discountTotal) — NOT nested under totalstotal — there is NO grandTotalquery arg — NOT keyword (only brands uses keyword)MoneyType = { amount currency { code } } — NOT { amount currencyCode }userId is required per schema type but inferred from auth token — omit in variables when authenticatedCommon mistakes that introspection prevents:
removeItem vs removeCartItem)InputConfigurationSectionType vs ConfigurationSectionInput)totals { grandTotal { amount } } — WRONG. Use total { amount } directlyproducts(keyword: "...") — WRONG. Use products(query: "...")filter: "slug:..." — doesn't exist)textValue vs customText, configurationSections vs configurationSection)ref — API Reference Lookupxapi-query-ref.md for the requested module or operation/virtocommerce/vc-docs) for any fields not in the local refxAPI Modules:
| Module | Purpose | Key Operations |
|---|---|---|
| xCart | Shopping cart | addItem, removeItem, changeItemQuantity, addCoupon, clearCart, addOrUpdateShipment, addOrUpdatePayment |
| xCatalog | Products & categories | products, product, categories, searchProducts |
| xOrder | Order management | createOrderFromCart, orders, order, changeOrderStatus |
| xCMS | Content management | pages, menus, contentItems |
| xProfile | User profiles & orgs | me, organization, contacts, updateProfile |
| xFrontend | Storefront bootstrap | pageContext (store + user + slug + white-labeling in one call) |
REST API Sections:
| Section | Base Path |
|---|---|
| Authentication | /connect/token |
| Catalog | /api/catalog/ |
| Pricing | /api/pricing/ |
| Inventory | /api/inventory/ |
| Orders | /api/order/ |
| Customers | /api/contacts/, /api/members/ |
| Marketing | /api/marketing/ |
| Platform | /api/platform/ |
| Search | /api/search/ |
| Stores | /api/stores/ |
Rules:
{BACK_URL}/graphqlerrors[] in GraphQL responses — HTTP 200 ≠ successskip + take → totalCount in responseAuthorization: Bearer {token}test — Execute TestsDelegate to qa-backend-expert agent with scope and credentials.
graphql, or fulltest-cases-api-graphql.mdqa-backend-expert via Task tool:
BACK_URL, ADMIN_EMAIL, ADMIN_PASSWORD from environmentbrowser_evaluate fetch, curl, npx tsx scripts/graphql/graphql-runner.ts (for runner-native GraphQL CSVs), or a Postman collection authored via Postman MCP and executed with Newman/Postman CLI. The Postman MCP itself does not execute collections — see qa-postman/execution.md.REST API (Suite 14) coverage:
GraphQL xAPI (Suite 15) coverage:
cases — Write Test CasesGenerate test cases in enriched CSV format for test-management-specialist.
api-test-case-patterns.md for coverage checklists and tag referencexapi-query-ref.md for known-good query/mutation templates — cross-check against introspection[HTTP]/[AUTH]/[SETUP] tags; GraphQL → use [GQL]/[VAR] tags)api-test-case-patterns.md for the requested scopeID, Title, Section, Priority, Business_Rule, Edge_Case_Refs, Preconditions, Test_Data, Steps, Assertions, Cross_Layer_Checks, Failure_Signals, Cleanup, References, Automation_Statusnpm run suites:append -- <suite.csv> --rows <new.csv>
(scripts/test-cases/append-test-cases-to-suite.ts): schema + boundary-newline + dedup + round-trip verified. Never
hand-roll the append. Review the generated rows first with npm run suites:review -- <new.csv>.Key rules for API test cases:
[API] errors[] is empty in Cross_Layer_ChecksFailure_Signals (timeout signal + API error signal)[ROUNDTRIP] cross-layer check: mutate then query to confirm persistenceTest_Data column: {{VAR}} bindings only — no freeform text[STATUS] assertions for REST, [ERRORS] + [DATA] for GraphQLKey rules for GraphQL queries/mutations in Steps:
command: input pattern: mutation { mutationName(command: { ...fields }) { ...return } }mutation { addItem(cartId: "...", productId: "...") is WRONGstoreId! in the command; userId! is required per schema type but inferred from auth tokensubTotal { amount }, total { amount } — NOT totals { grandTotal { amount } }grandTotal — the field is totalquery arg — NOT keywordremoveCartItem not removeItem, changeCartItemQuantity not changeItemQuantity)knowledge/api/graphql-schema.md for authoritative field names and types{ amount currency { code } }, not just { amount }). Null checks, type correctness, and nested resolver correctness are only observable when fields are in the selection set. Minimal selection ({ id }, { totalCount }) is allowed ONLY for: (a) counter/invariant probes before/after a mutation, (b) cross-layer roundtrips that match a write, (c) the dedicated "minimal selection" schema-coverage test (one per operation, per the tier rule in graphql-checklist.md:141-144). When using a minimal selection, add a comment in Steps naming the role.Always use env vars — never hardcode URLs or credentials:
BACK_URL — platform backend URLADMIN_EMAIL, ADMIN_PASSWORD — admin credentialsUSER_EMAIL, USER_PASSWORD — regular user credentialsSTORE_ID — store identifierCULTURE_NAME — default en-USCURRENCY_CODE — default USD@td(), Don't HardcodeSame rule applies to entity IDs, SKUs, prices, emails, addresses, coupon codes, test cards, order numbers, and URL path segments — resolve them at authoring time via the project's test-data library. Hardcoding rots: catalogs get re-seeded, orgs get re-created, prices change.
@td(ALIAS.field) → looks up test-data/aliases.json, reads the matching CSV row, returns the requested column. Examples: @td(CYBERSOURCE_VISA.number), @td(STORE_PRIMARY.id), @td(ACME_ADMIN.email), @td(CFG_LAPTOP.id).scripts/lib/test-data-resolver.ts, consumed by scripts/graphql/graphql-runner.ts and the regression suite parsers.npx tsx scripts/test-data/validate-td-refs.ts — verifies every @td() reference resolves.../qa-postman/test-data-fixtures.md covers full conventions (catalog/address/account gotchas, fixture directory layout).