aureuserp-test-case-builder

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

AureusERP Test Case Builder

AureusERP 测试用例构建器

Use this skill to build plugin API tests with Pest using test-only fixes and reusable helpers.
使用本技能基于Pest构建插件API测试,采用仅测试层面的修复方案和可复用helpers。

Scope Tracks

测试赛道

  1. API test-case track (active now)
  • Follow
    references/api.md
    for end-to-end workflow, helper boundaries, assertions, and guardrails.
  1. Filament test-case track (reserved for future)
  • Do not invent Filament-specific testing rules in this skill yet.
  • Keep API conventions unchanged.
  • When Filament guidance is added later, it should be added as separate references (for example
    references/filament-*.md
    ) and selected explicitly by task type.
  1. API测试用例赛道(当前启用)
  • 端到端工作流、helper职责边界、断言规则和约束规范请遵循
    references/api.md
    。
  1. Filament测试用例赛道(预留未来使用)
  • 目前请勿在本技能中自定义Filament专属的测试规则。
  • 保持API约定不变。
  • 后续新增Filament相关指引时,应作为独立参考文档添加(例如
    references/filament-*.md
    ),并通过任务类型显式选择。

Core Rules

核心规则

  1. Use Pest feature tests for API endpoints (
    getJson
    ,
    postJson
    ,
    patchJson
    ,
    deleteJson
    ).
  2. Prefer factories for setup and payload creation.
  3. Keep helper responsibility split strict:
  • SecurityHelper
    for auth/permissions/guards.
  • TestBootstrapHelper
    for non-security bootstrap and plugin installation.
  1. Do not use
    RefreshDatabase
    or
    LazilyRefreshDatabase
    in test files; use global
    DatabaseTransactions
    wiring.
  2. Prefer test/helper fixes before app code edits.
  3. Do not use skip-as-solution.
  1. 针对API端点使用Pest功能测试(使用
    getJson
    、
    postJson
    、
    patchJson
    、
    deleteJson
    方法)。
  2. 优先使用测试工厂进行环境搭建和payload构造。
  3. 严格划分helper职责:
  • SecurityHelper
    负责认证/权限/守卫相关逻辑。
  • TestBootstrapHelper
    负责非安全类的引导配置和插件安装。
  1. 测试文件中请勿使用
    RefreshDatabase
    或
    LazilyRefreshDatabase
    ;请使用全局的
    DatabaseTransactions
    配置。
  2. 优先通过测试/helper修复问题,而非修改应用代码。
  3. 不得将跳过测试作为解决方案。

Quick Routing

快速路由

  1. API controller endpoint tests (
    index/store/show/update/destroy
    , auth, validation, restore/force-delete): use
    references/api.md
    .
  2. API refactor/bugfix with helper cleanup: use
    references/api.md
    .
  3. Template generation for a new plugin API test file: use
    references/api.md
    .
  1. API控制器端点测试(含
    index/store/show/update/destroy
    、认证、校验、恢复/强制删除):参考
    references/api.md
    。
  2. 涉及helper清理的API重构/问题修复:参考
    references/api.md
    。
  3. 新插件API测试文件的模板生成:参考
    references/api.md
    。

Output Expectations

输出要求

  1. Keep tests plugin-scoped and reusable.
  2. Keep assertions deterministic and aligned with JSON resources.
  3. Keep payloads factory-first with targeted overrides only.
  4. Keep install/bootstrap non-interactive and environment-safe.
  1. 测试需保持插件作用域隔离,且具备可复用性。
  2. 断言需具备确定性,且与JSON资源对齐。
  3. payload优先使用测试工厂生成,仅在必要时进行针对性覆盖。
  4. 安装/引导过程需为非交互式,且保证环境安全。